:root {
    --bg-light: #f7f8fc;
    --bg-dark: #0a0a0f;
    --text-light: #1e1e1e;
    --text-dark: #e0e0e0;
    --card-light: #ffffff;
    --card-dark: #1a1a24;
    --brand-primary: #6366f1;
    --brand-secondary: #8b5cf6;
    --accent: #ec4899;
    --border-light: #e5e7eb;
    --border-dark: #2d2d3a;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-light);
    color: var(--text-light);
    transition: background 0.5s ease, color 0.5s ease;
    overflow-x: hidden;
}

body.dark {
    background: var(--bg-dark);
    color: var(--text-dark);
}

/* Animated Background */
.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.03;
    background-image: 
        linear-gradient(90deg, var(--brand-primary) 1px, transparent 1px),
        linear-gradient(0deg, var(--brand-primary) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: patternMove 20s linear infinite;
}

body.dark .bg-pattern {
    opacity: 0.05;
}

@keyframes patternMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* Floating Orbs */
.floating-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: float 20s infinite ease-in-out;
    pointer-events: none;
    z-index: -1;
}

body.dark .floating-orb {
    opacity: 0.08;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--brand-primary);
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.orb-2 {
    width: 350px;
    height: 350px;
    background: var(--brand-secondary);
    bottom: -100px;
    right: -100px;
    animation-delay: -7s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: var(--accent);
    top: 50%;
    left: 50%;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(100px, -100px) rotate(120deg); }
    66% { transform: translate(-100px, 100px) rotate(240deg); }
}

/* Header */
header {
    position: sticky;
    top: 0;
    /* === Z-INDEX FIX === */
    z-index: 50; 
    backdrop-filter: blur(20px) saturate(180%);
    background: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

body.dark header {
    background: rgba(10, 10, 15, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-text {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary), var(--accent));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    font-size: 1.5rem;
    cursor: pointer;
    animation: gradientShift 3s ease infinite;
    letter-spacing: -0.5px;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* === Navbar Animation Fix (UPDATED for 'lg' screen) === */
/* Desktop Nav Links */
/* Note: Changed 'md:flex' to 'lg:flex' to match HTML changes */
nav.hidden.lg\:flex a {
    position: relative;
    transition: all 0.3s ease;
    font-weight: 600; /* Bold text restored */
    font-size: 0.95rem;
    color: var(--text-light); /* Ensure visibility */
}

body.dark nav.hidden.lg\:flex a {
    color: var(--text-dark);
}

nav.hidden.lg\:flex a::before {
    content: '';
    position: absolute;
    bottom: -6px; /* Positioned 6px below text */
    left: 0; /* Align to the left edge of the link */
    width: 100%; /* Full width of the link */
    height: 2px;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
    transition: all 0.3s ease;
    transform: scaleX(0); /* Start scaled to 0 (invisible) */
    transform-origin: center; /* Scale from center */
}

nav.hidden.lg\:flex a:hover {
    color: var(--brand-primary);
    transform: translateY(-2px);
}

nav.hidden.lg\:flex a:hover::before {
    transform: scaleX(1); /* Scale to 100% on hover */
}


/* Hero Section */
.hero-section {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    perspective: 1000px;
}

.hero-content {
    text-align: center;
    animation: fadeInUp 1s ease-out;
}

.hero-title {
    font-size: 4.5rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -2px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary), var(--accent));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease infinite;
}

.hero-subtitle {
    font-size: 1.25rem;
    line-height: 1.8;
    max-width: 700px;
    margin: 0 auto 3rem;
    opacity: 0.8;
    font-weight: 400;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Floating Badge */
.floating-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.5rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 50px;
    margin-bottom: 2rem;
    animation: floatBadge 3s ease-in-out infinite;
    font-size: 0.9rem;
    font-weight: 500;
}

body.dark .floating-badge {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
}

@keyframes floatBadge {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* CTA Buttons */
.cta-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.btn-primary {
    position: relative;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 12px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1.05rem;
    transition: all 0.4s ease;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--brand-primary);
    padding: 1rem 2.5rem;
    border: 2px solid var(--brand-primary);
    border-radius: 12px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1.05rem;
    transition: all 0.3s ease;
}

body.dark .btn-secondary {
    color: var(--text-dark);
    border-color: var(--brand-primary);
}

.btn-secondary:hover {
    background: var(--brand-primary);
    color: white;
    transform: translateY(-3px);
}

/* Tools Section */
.tools-section {
    padding: 5rem 0;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.section-subtitle {
    font-size: 1.1rem;
    opacity: 0.7;
    max-width: 600px;
    margin: 0 auto;
}

/* Tool Cards */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    perspective: 1000px;
}

.tool-card {
    position: relative;
    background: var(--card-light);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 2.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}

body.dark .tool-card {
    background: var(--card-dark);
    border: 1px solid var(--border-dark);
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary), var(--accent));
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s ease;
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
}

.tool-icon {
    width: 70px;
    height: 70px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.tool-card:hover .tool-icon {
    transform: scale(1.05);
}

.icon-converter { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.icon-editor { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.icon-pdf { background: linear-gradient(135deg, #ef4444, #f97316); }
.icon-image { background: linear-gradient(135deg, #10b981, #14b8a6); }
.icon-ai { background: linear-gradient(135deg, #f59e0b, #ec4899); }
.icon-coming { background: linear-gradient(135deg, #6b7280, #9ca3af); }

.tool-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-light);
}

body.dark .tool-title {
    color: var(--text-dark);
}

.tool-description {
    opacity: 0.7;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.tool-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--brand-primary);
    font-weight: 600;
    transition: all 0.3s;
}

.tool-link:hover {
    gap: 1rem;
}

/* Features Section */
.features-section {
    padding: 5rem 0;
    background: rgba(99, 102, 241, 0.03);
    border-radius: 40px;
    margin: 4rem 0;
}

body.dark .features-section {
    background: rgba(99, 102, 241, 0.05);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-item {
    text-align: center;
    padding: 2rem;
    transition: transform 0.3s;
}

.feature-item:hover {
    transform: translateY(-10px);
}

.feature-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.feature-description {
    opacity: 0.7;
    line-height: 1.7;
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: 70px; /* Header ki height ke niche se shuru ho */
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    padding: 1.5rem;
    animation: slideDown 0.3s ease-out;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

body.dark .mobile-menu {
    background: rgba(10, 10, 15, 0.95);
    border-bottom: 1px solid var(--border-dark);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-menu.active {
    display: block;
}

.mobile-menu a {
    display: block;
    padding: 1rem;
    border-radius: 10px;
    transition: all 0.3s;
    font-weight: 600; /* Bold text */
}

.mobile-menu a:hover {
    background: rgba(99, 102, 241, 0.1);
    transform: translateX(10px);
}

/* Footer */
footer {
    margin-top: 5rem;
    padding: 3rem 0;
    border-top: 1px solid var(--border-light);
    text-align: center;
}

body.dark footer {
    border-top: 1px solid var(--border-dark);
}

footer a {
    color: var(--brand-primary);
    transition: all 0.3s;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive (Mobile view) */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .cta-group {
        flex-direction: column;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

/* Theme Toggle */
#themeToggle {
    transition: all 0.3s;
}

#themeToggle:hover {
    transform: rotate(180deg) scale(1.1);
}