/* Global and Navigation Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "montserrat";
}
body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden; 
    background-color: var(--bg-color);
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(223, 57, 148, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(218, 0, 120, 0.05) 0%, transparent 30%),
        radial-gradient(circle at 50% 50%, rgba(255, 238, 238, 0.3) 0%, transparent 0%);
    z-index: -1;
    animation: bgMove 20s ease-in-out infinite alternate;
}

:root {
    /* Light Theme (Default) */
    --bg-color: #fdf3f3;
    --text-color-primary: #333;
    --text-color-secondary: #555;
    --primary-accent: rgb(223, 57, 148);
    --primary-accent-hover: rgb(218, 0, 120);
    --card-bg: white;
    --header-bg: rgba(29, 29, 29, 0.959);
    --header-text: white;
    --header-scrolled-bg: #ffeeee;
    --header-scrolled-text: #1a1a1a;
    --hamburger-bar: white;
    --hamburger-scrolled-bar: #333;
    --section-bg-light: rgba(243, 243, 243, 0.959);
    --card-shadow: 0 0 7px rgba(0, 0, 0, 0.1);
    --card-hover-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

body.dark-mode {
    /* Dark Theme */
    --bg-color: #121212;
    --text-color-primary: #e0e0e0;
    --text-color-secondary: #b0b0b0;
    --card-bg: #1e1e1e;
    --header-scrolled-bg: #2c2c2c;
    --header-scrolled-text: #e0e0e0;
    --hamburger-scrolled-bar: #e0e0e0;
    --section-bg-light: #1a1a1a;
    --card-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    --card-hover-shadow: 0 5px 15px rgba(0, 0, 0, 0.6);
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background-color: var(--bg-color);
    position: relative;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Scroll Fade-in Animation */
.fade-in-from-left, .fade-in-from-right {
    opacity: 0;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    will-change: opacity, transform;
}

.fade-in-from-left {
    transform: translateX(-50px);
}

.fade-in-from-right {
    transform: translateX(50px);
}

.fade-in-from-left.is-visible, .fade-in-from-right.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Initial Load Animation */
.head-er, .about-snippet, .container, .main-container, .software-pro, .design-dici, .prof-and-soft {
    animation: fadeIn 0.8s ease-in-out forwards;
    opacity: 0;
}

@keyframes fadeIn { to { opacity: 1; } }

/* Common Header & Navigation */
.head-er {
    background-color: var(--header-bg);
    margin: 0 10%;
    border-radius: 40px;
    position: sticky;
    top: 10px;
    z-index: 1000;
    transition: background-color 0.4s ease, box-shadow 0.4s ease;
    outline: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

header {
    display: flex;
    margin: 10px 40px;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

header h1 {
    color: var(--header-text);
}

nav ul {
    list-style: none;
    display: flex; /* Use flexbox for alignment */
    align-items: center;
}

nav li {
    display: inline-block;
    padding-left: 25px;
    transition: 0.3s;
}

nav li:hover {
    transform: scale(1.1);
}

nav ul li a {
    text-decoration: none;
    font-weight: bold;
    color: var(--header-text);
}

nav ul li a:hover {
    color: var(--primary-accent);
}

.btn-email {
    padding-left: 40px;
}

.btn-email button {
    height: 40px;
    width: 110px;
    color: white;
    font-family: "montserrat";
    background-color: var(--primary-accent);
    outline: none;
    border: none;
    border-radius: 20px;
    transition: 0.3s;
    cursor: pointer;
}

.btn-email button:hover {
    transform: scale(1.1);
    box-shadow: 3px 3px 40px rgba(218, 0, 120, 0.815);
    background-color: var(--primary-accent-hover);
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    margin-left: 15px;
    font-size: 22px;
    color: var(--header-text);
    position: relative;
    width: 32px;
    height: 32px;
}

.dark-mode-toggle i {
    position: absolute;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.dark-mode-toggle .bxs-sun {
    transform: scale(1);
    opacity: 1;
}
.dark-mode-toggle .bxs-moon {
    transform: scale(0);
    opacity: 0;
}

body.dark-mode .dark-mode-toggle .bxs-sun {
    transform: scale(0);
    opacity: 0;
}
body.dark-mode .dark-mode-toggle .bxs-moon {
    transform: scale(1);
    opacity: 1;
}

/* Scrolled State */
.head-er.scrolled {
    background-color: var(--header-scrolled-bg);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.head-er.scrolled h1 {
    color: var(--header-scrolled-text);
}

.head-er.scrolled nav ul li a {
    color: var(--header-scrolled-text) !important;
}

.head-er.scrolled nav ul li a:hover {
    color: var(--primary-accent) !important;
}

.head-er.scrolled .dark-mode-toggle {
    color: var(--header-scrolled-text);
}

.head-er.scrolled .bar {
    background-color: var(--hamburger-scrolled-bar);
}

/* Hamburger Menu */
.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    -webkit-transition: all 0.3s ease-in-out;
    transition: all 0.3s ease-in-out;
    background-color: var(--hamburger-bar);
}

/* Common Decorative Bars */
.just-hr1 {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    height: 60px;
    width: 100%;
    background-color: var(--primary-accent);
    color: white;
    transform: rotate(-0.8deg);
}

.just-hr {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    height: 40px;
    width: 100%;
    background-color: #131313;
    color: white;
    margin-top: -20px;
}

/* ==========================================================================
   Responsive Design & Mobile Navigation
   ========================================================================== */

.mobile-header-controls {
    display: none; /* Hidden by default */
    align-items: center;
    gap: 10px;
}

/* Large Screens & Laptops (max-width: 1200px) */
@media screen and (max-width: 1200px) {
    .head-er, header {
        margin-left: 40px;
        margin-right: 40px;
    }
}

/* Tablet View (max-width: 1024px) */
@media screen and (min-width: 851px) and (max-width: 1035px) {
    header h1{
        font-size: 23px;
    }
    nav ul li a{
        font-size: 14px;
    }
    .btn-email button{
        width: 100px;
        height: 35px;
    }
}

/* Mobile & Small Tablets (max-width: 850px) */
@media screen and (max-width: 850px) {
    .head-er {
        margin: 0 10%;
        border-radius: 40px;
    }
    header {
        margin: 5px 0;
        padding: 0 25px;
    }
    header h1 {
        font-size: 22px;
    }
    
    .hamburger {
        z-index: 1001;
        display: block;
    }
    .mobile-header-controls {
        display: flex;
    }
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    nav ul {
        position: fixed;
        left: 0;
        top: 0;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        background-color: rgba(29, 29, 29, 0.98); /* Professional dark background */
        backdrop-filter: blur(5px);
        width: 100%;
        height: 100vh;
        transition: transform 0.3s ease-in-out;
        transform: translateY(-100%); /* Start off-screen */
    }

    nav ul.active {
        transform: translateY(0); /* Slide into view */
    }

    nav ul li {
        margin: 15px 0; /* Vertical spacing */
        padding: 0;
    }
    
    /* Hide the original toggle in the mobile menu and show the new one in the header */
    nav ul .dark-mode-toggle {
        display: none;
    }

    .dark-mode-toggle {
        margin: 15px 0;
    }

    nav ul li a {
        font-size: 1.2rem; /* Reduced, readable font size */
        color: #fff;
    }
    
    .btn-email {
        padding: 0;
        margin-top: 20px;
    }

    /* Ensure links inside the active mobile menu are always white, even on scroll */
    nav ul.active li a {
        color: #fff !important;
    }
}

/* Site Footer */
.site-footer {
    background-color: var(--section-bg-light);
    color: var(--text-color-secondary);
    text-align: center;
    padding: 30px 20px;
    /* margin-top: 50px; Removed to eliminate space below pre-footer */
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.6; /* Add line-height for better readability if text wraps */
}

body.dark-mode .site-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive Footer */
@media screen and (max-width: 768px) {
    .site-footer {
        font-size: 0.8rem;
        padding: 25px 15px;
    }
}

/* Extra refinement for small mobile screens */
@media screen and (max-width: 480px) {
    .site-footer {
        font-size: 0.75rem; /* Further reduce font size for very small screens */
        padding: 20px 10px;
    }
}

/* Pre-Footer Section */
.pre-footer {
    background-color: var(--section-bg-light);
    padding: 60px 20px;
    text-align: center;
    margin-top: 50px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

body.dark-mode .pre-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.pre-footer-content {
    max-width: 700px;
    margin: 0 auto;
}

.availability-status {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.blinking-circle {
    width: 10px;
    height: 10px;
    background-color: var(--primary-accent); /* Changed to match theme */
    border-radius: 50%;
    animation: blink 1.5s infinite ease-in-out;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

.availability-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color-primary);
}

.available-tag {
    background-color: rgba(223, 57, 148, 0.15); /* Changed to match theme */
    color: var(--primary-accent); /* Changed to match theme */
    padding: 4px 10px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 0.9rem;
}

body.dark-mode .available-tag {
    background-color: rgba(223, 57, 148, 0.2); /* Changed for dark mode */
    color: #ff8ccb; /* Lighter pink for dark mode readability */
}

.pre-footer-tagline {
    font-size: 2.2rem;
    color: var(--text-color-primary);
    margin-bottom: 25px;
    line-height: 1.3;
}

.pre-footer-socials {
    margin-bottom: 35px;
}

.pre-footer-socials a {
    color: var(--text-color-secondary);
    font-size: 28px;
    margin: 0 15px;
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease;
    display: inline-block;
}

.pre-footer-socials a:hover {
    color: var(--primary-accent);
    transform: translateY(-3px);
}

.pre-footer .back-to-top-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 10px 25px;
    background-color: var(--card-bg);
    color: var(--text-color-primary);
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--card-shadow);
}

.pre-footer .back-to-top-btn i {
    margin-left: 8px;
}

.pre-footer .back-to-top-btn:hover {
    background-color: var(--primary-accent);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(218, 0, 120, 0.3);
}

@media screen and (max-width: 768px) {
    .pre-footer-tagline {
        font-size: 1.8rem;
    }
    .pre-footer-socials a {
        font-size: 24px;
        margin: 0 10px;
    }
}