/* =========================================
   1. VARIABLES & VIBRANT THEME
   ========================================= */
:root {
    /* --- LIGHT MODE VARIABLES --- */
    --bg-body: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --primary: #6366f1; /* Indigo */
    --accent: #a855f7;  /* Purple */
    
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.5);
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-hover-bg: #ffffff; 
    --card-shadow: 0 10px 40px -10px rgba(0,0,0,0.08);
    
    /* Inputs */
    --input-bg: rgba(255, 255, 255, 0.8);
    --input-border: #e2e8f0;
    
    --blob-opacity: 0.6;
    --ease-bounce: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* --- DARK MODE VARIABLES (Added) --- */
body.dark-mode {
    --bg-body: #0f172a; /* Dark Slate */
    --text-main: #f8fafc; /* White */
    --text-muted: #cbd5e1; /* Light Grey */
    
    /* Adjust Glass for Dark Mode */
    --glass-bg: rgba(15, 23, 42, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(30, 41, 59, 0.6);
    --card-hover-bg: rgba(30, 41, 59, 0.9);
    --card-shadow: 0 10px 40px -10px rgba(0,0,0,0.5);
    
    /* Adjust Inputs */
    --input-bg: rgba(30, 41, 59, 0.8);
    --input-border: #334155;
    
    /* Dim the background blobs */
    --blob-opacity: 0.2; 
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* 🔴 CRITICAL FIX: Prevent White Space on Right Side */
html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden; 
    position: relative;
    scroll-behavior: smooth;
    /* Smooth Transition for Dark Mode */
    transition: background-color 0.3s ease, color 0.3s ease;
}

body { 
    font-family: 'Inter', sans-serif; 
    background: var(--bg-body); 
    color: var(--text-main); 
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

/* =========================================
   2. ANIMATED BACKGROUNDS (Blobs)
   ========================================= */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: var(--bg-body); /* Changed to variable */
    overflow: hidden; 
    pointer-events: none;
    transition: background-color 0.3s ease;
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: var(--blob-opacity); /* Changed to variable */
    animation: floatBlob 20s infinite alternate;
    transition: opacity 0.3s ease;
}
.blob-1 { top: -10%; left: -10%; width: 500px; height: 500px; background: #6366f1; animation-delay: 0s; } /* Fixed Color */
.blob-2 { bottom: -10%; right: -10%; width: 600px; height: 600px; background: #a855f7; animation-delay: -5s; } /* Fixed Color */
.blob-3 { top: 40%; left: 40%; width: 400px; height: 400px; background: #ec4899; animation-delay: -10s; } /* Fixed Color */

@keyframes floatBlob {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* =========================================
   3. STICKERS (Floating Elements)
   ========================================= */
.sticker {
    position: absolute;
    font-size: 3rem;
    filter: drop-shadow(0 10px 10px rgba(0,0,0,0.1));
    animation: floatSticker 6s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
    user-select: none;
    transition: opacity 0.3s ease;
}
/* Dim stickers in dark mode */
body.dark-mode .sticker { opacity: 0.5; }

@keyframes floatSticker {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

/* =========================================
   4. DETAILED GLASS NAVIGATION (Desktop)
   ========================================= */
.navbar { 
    position: fixed; 
    top: 20px; 
    left: 50%;
    transform: translateX(-50%); 
    width: 90%;
    max-width: 1200px;
    height: 70px;
    
    background: var(--glass-bg); /* Use variable */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    
    border-radius: 50px;
    border: 1px solid var(--glass-border); /* Use variable */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    
    z-index: 1000;
    transition: all 0.4s ease;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 10px;
}

/* Logo Styling */
.logo { 
    font-weight: 800; 
    font-size: 1.5rem; 
    color: var(--text-main); 
    text-decoration: none;
    letter-spacing: -0.5px;
    padding-left: 15px;
    display: flex; align-items: center; gap: 10px;
}

/* Desktop Links */
.nav-links { 
    display: flex; 
    gap: 35px; 
    list-style: none; 
    margin: 0; 
    padding: 0; 
    align-items: center;
}

.nav-links a { 
    font-weight: 600; 
    color: var(--text-muted); 
    text-decoration: none;
    font-size: 0.95rem;
    transition: 0.3s;
    position: relative;
}

/* Hover Dot Animation */
.nav-links a:not(.btn-nav):hover { color: var(--primary); }
.nav-links a:not(.btn-nav)::after {
    content: '';
    position: absolute;
    width: 5px; height: 5px;
    background: var(--primary);
    bottom: -8px; left: 50%;
    border-radius: 50%;
    transform: translateX(-50%) scale(0);
    transition: transform 0.3s ease;
}
.nav-links a:not(.btn-nav):hover::after { transform: translateX(-50%) scale(1); }

/* "Hire Me" Button in Nav */
.btn-nav {
    background: var(--primary);
    color: white !important;
    padding: 10px 25px;
    border-radius: 30px;
    transition: transform 0.2s;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}
.btn-nav:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

/* --- THEME TOGGLE BUTTON (Added) --- */
.theme-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    transition: transform 0.3s ease;
}
.theme-toggle:hover { transform: rotate(15deg) scale(1.1); }

/* =========================================
   MOBILE HAMBURGER ANIMATION
   ========================================= */
.mobile-menu-icon {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    margin-right: 15px;
    z-index: 1002;
}

.bar {
    width: 100%;
    height: 3px;
    background-color: var(--text-main);
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

/* Transform to X when open */
.mobile-menu-icon.open .bar1 { transform: translateY(9px) rotate(45deg); }
.mobile-menu-icon.open .bar2 { opacity: 0; }
.mobile-menu-icon.open .bar3 { transform: translateY(-9px) rotate(-45deg); }

/* Backdrop Overlay */
.mobile-backdrop {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); /* Darker backdrop for visibility */
    backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}
.mobile-backdrop.open { opacity: 1; visibility: visible; }

/* =========================================
   5. BUTTONS & UI ELEMENTS
   ========================================= */
.btn {
    background: var(--primary-gradient);
    color: white;
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
    transition: all 0.3s var(--ease-bounce);
    border: none;
    cursor: pointer;
}
.btn:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 15px 30px rgba(99, 102, 241, 0.4); }
.btn:active { transform: translateY(-1px); }

.btn-secondary { 
    background: transparent; 
    color: var(--text-main); 
    border: 2px solid var(--input-border); /* Use variable */
    box-shadow: none; 
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

.badge { 
    display: inline-block;
    background: rgba(99, 102, 241, 0.1); 
    padding: 6px 14px; 
    border-radius: 20px; 
    font-size: 0.85rem; 
    font-weight: 700; 
    margin-right: 6px; 
    color: var(--primary); 
    margin-bottom: 6px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* =========================================
   6. CARDS & GRID
   ========================================= */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; }
.section-padding { padding: 100px 0; }

.grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 40px; 
}

.card {
    background: var(--card-bg); /* Use variable */
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border); /* Use variable */
    padding: 30px;
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    transition: 0.4s;
    height: 100%;
    display: flex;
    flex-direction: column;
    color: var(--text-main);
}

.card:hover { 
    transform: translateY(-10px); 
    background: var(--card-hover-bg); /* Use variable */
    box-shadow: 0 20px 40px -10px rgba(99, 102, 241, 0.15);
}

/* =========================================
   7. FORMS & FAQ & TYPOGRAPHY
   ========================================= */
input, textarea, select {
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    border: 2px solid var(--input-border); /* Use variable */
    background: var(--input-bg); /* Use variable */
    font-family: inherit;
    font-size: 1rem;
    transition: 0.3s;
    outline: none;
    color: var(--text-main);
}

input:focus, textarea:focus {
    border-color: var(--primary);
    background: var(--bg-body);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

details { overflow: hidden; }
summary { outline: none; user-select: none; color: var(--text-main); }
details[open] summary ~ * { animation: sweep .3s ease-in-out; }
@keyframes sweep { 0% {opacity: 0; transform: translateY(-10px)} 100% {opacity: 1; transform: translateY(0)} }

h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); line-height: 1.1; margin-bottom: 20px; letter-spacing: -2px; color: var(--text-main); }
h2 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 15px; letter-spacing: -1px; color: var(--text-main); }
h3 { font-size: 1.5rem; margin-bottom: 10px; font-weight: 700; color: var(--text-main); }
p { font-size: 1.1rem; line-height: 1.7; color: var(--text-muted); margin-bottom: 20px; }

footer {
    background: #0f172a; /* Footer stays consistently dark */
    color: #cbd5e1;
    padding: 60px 0 30px;
    margin-top: auto;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.05);
}
footer a:hover { color: #fff; text-decoration: underline; }

/* =========================================
   11. MOBILE RESPONSIVENESS (FORCE FIX)
   ========================================= */
@media (max-width: 992px) {
    .nav-cta { display: none; } /* Hide Hire Me button on tablet */
    .container { padding: 0 25px; }
    .sticker { opacity: 0.3; transform: scale(0.7); } 
}

@media (max-width: 768px) {
    /* 1. Navbar: Reset to top bar for better UX */
    .navbar {
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 0 !important;
        padding: 15px 20px !important;
        animation: none !important;
        background: var(--glass-bg) !important;
        border: none !important;
        border-bottom: 1px solid var(--glass-border) !important;
        height: auto !important;
    }

    /* 2. Show Hamburger Icon */
    .mobile-menu-icon { display: flex !important; }

    /* 3. FLOATING CARD MENU (Center Pop-up) */
    .nav-links {
        position: fixed !important;
        right: auto !important; 
        height: auto !important;
        top: 85px !important;
        left: 50% !important;
        transform: translateX(-50%) translateY(-20px) !important; 
        width: 90% !important;
        max-width: 350px !important;
        
        background: var(--bg-body) !important; /* Adaptive bg */
        border: 1px solid var(--glass-border) !important;
        border-radius: 24px !important;
        box-shadow: 0 20px 50px rgba(0,0,0,0.3) !important;
        
        flex-direction: column !important;
        align-items: center !important;
        padding: 30px 0 !important;
        gap: 15px !important;
        
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
        z-index: 999;
    }

    /* 4. Active State: Visible */
    .nav-links.active { 
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: all !important;
        transform: translateX(-50%) translateY(0) !important;
    }

    /* Links inside the menu */
    .nav-links li { margin: 0; width: 100%; text-align: center; }
    .nav-links a { 
        font-size: 1.2rem; 
        display: block;
        padding: 10px 0;
        color: var(--text-main);
    }
    
    /* Show CTA inside mobile menu */
    .nav-cta { display: block !important; margin-top: 10px; }
    .btn-nav { width: 100%; display: block; }

    /* Layout Fixes */
    .hero-section { padding-top: 100px; text-align: center; overflow: hidden; }
    .sticker { display: none !important; }
    .grid { grid-template-columns: 1fr !important; }
}
