/* Common CSS Variables */
:root {
    --primary: #3b82f6;
    --primary-dark: #1d4ed8;
    --secondary: #1e40af;
    --accent: #06b6d4;
    --gradient-1: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    --gradient-2: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    --gradient-3: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    --gradient-4: linear-gradient(135deg, #22d3ee 0%, #06b6d4 100%);
    --gradient-hero: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #06b6d4 100%);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-light: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(59, 130, 246, 0.2);
    --dark-glass: rgba(255, 255, 255, 0.9);
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-light: #ffffff;
    --animated-bg-gradient: linear-gradient(-45deg, #dbeafe, #bfdbfe, #93c5fd, #7dd3fc);
}

/* Dark theme overrides */
body.theme-dark {
    --text-primary: #ffffff;
    --text-secondary: #e2e8f0;
    --text-light: #cbd5e1;
    --text-muted: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --dark-glass: rgba(15, 23, 42, 0.85);
    --bg-primary: #0f172a;
    --bg-secondary: rgba(15, 23, 42, 0.9);
    --bg-light: #0b1220;
    --animated-bg-gradient: linear-gradient(-45deg, #1e40af, #3b82f6, #06b6d4, #0891b2);
}

    /* Dark theme text adjustments */
    body.theme-dark .feature-title-modern,
    body.theme-dark .section-title,
    body.theme-dark .cta-title,
    body.theme-dark .hero-badge,
    body.theme-dark .stat-label {
        color: #ffffff !important;
    }

    body.theme-dark .feature-description-modern,
    body.theme-dark .section-subtitle,
    body.theme-dark .cta-subtitle,
    body.theme-dark .hero-subtitle {
        color: #e2e8f0 !important;
    }

    body.theme-dark .text-muted {
        color: #94a3b8 !important;
    }

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

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

/* Animated Background */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: var(--animated-bg-gradient);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

    .animated-bg::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%233b82f6' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    }

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

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Floating Orbs */
.orb {
    position: absolute;
    border-radius: 50%;
    opacity: 0.7;
    animation: float 6s ease-in-out infinite;
    backdrop-filter: blur(20px);
    filter: blur(1px);
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: var(--gradient-3);
    top: 10%;
    left: -10%;
    animation-delay: -2s;
}

.orb-2 {
    width: 200px;
    height: 200px;
    background: var(--gradient-2);
    top: 60%;
    right: -5%;
    animation-delay: -4s;
}

.orb-3 {
    width: 150px;
    height: 150px;
    background: var(--gradient-4);
    bottom: 20%;
    left: 10%;
    animation-delay: -6s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }

    33% {
        transform: translateY(-20px) rotate(120deg);
    }

    66% {
        transform: translateY(20px) rotate(240deg);
    }
}

/* Glassmorphism Navigation */
.navbar {
    background: var(--dark-glass);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1rem 0;
}

.navbar-brand {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 800;
    font-size: 1.8rem;
    background: var(--gradient-3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-nav .nav-link {
    color: var(--text-primary) !important;
    font-weight: 500;
    margin: 0 0.8rem;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

    .navbar-nav .nav-link:hover {
        transform: translateY(-2px);
        color: var(--primary) !important;
    }

    .navbar-nav .nav-link::before {
        content: '';
        position: absolute;
        bottom: -5px;
        left: 50%;
        width: 0;
        height: 2px;
        background: var(--gradient-3);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        transform: translateX(-50%);
    }

    .navbar-nav .nav-link:hover::before {
        width: 100%;
    }

/* Button Styles */
.btn-modern {
    background: var(--gradient-3);
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    color: white;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(14, 165, 233, 0.3);
}

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

    .btn-modern:hover {
        transform: translateY(-3px);
        box-shadow: 0 20px 40px rgba(14, 165, 233, 0.4);
        color: white;
        text-decoration: none;
    }

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

.btn-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 1rem 2.5rem;
    border-radius: 50px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

    .btn-glass:hover {
        background: rgba(59, 130, 246, 0.1);
        transform: translateY(-2px);
        color: var(--text-primary);
        text-decoration: none;
    }

/* Theme toggle button */
.theme-toggle {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    color: var(--text-primary);
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

    .theme-toggle:hover {
        background: rgba(59, 130, 246, 0.1);
        transform: translateY(-2px);
    }

    .theme-toggle i {
        font-size: 1rem;
    }

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 5rem;
}

.section-badge {
    background: var(--gradient-3);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 1rem;
}

.section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

body.theme-dark .section-subtitle {
    color: #cfd8e3;
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    color: var(--text-primary);
    padding: 4rem 0 2rem;
    border-top: 1px solid var(--glass-border);
}

.footer-brand {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--gradient-3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 0.5rem;
    display: block;
    transition: all 0.3s ease;
}

body.theme-dark .footer-links a {
    color: var(--text-light);
}

.footer-links a:hover {
    color: var(--primary);
    transform: translateX(5px);
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    color: var(--text-primary);
    margin-right: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

    .social-links a:hover {
        background: var(--gradient-3);
        transform: translateY(-5px);
        box-shadow: 0 10px 25px rgba(14, 165, 233, 0.3);
    }

/* Footer headings should follow theme */
.footer h5 {
    color: var(--text-primary) !important;
}

/* Modern Enhancements */
.glass-effect {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 16px;
}

/* Dark theme glass tuning for better contrast on cards (non-hover) */
body.theme-dark .glass-effect {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.neon-glow {
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.3);
}

    .neon-glow:hover {
        box-shadow: 0 0 30px rgba(14, 165, 233, 0.5);
    }

/* Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

    .fade-in-up.visible {
        opacity: 1;
        transform: translateY(0);
    }

/* Dark theme pattern override */
body.theme-dark .animated-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Navbar Toggle Button Styling */
.navbar-toggler {
    border: 2px solid var(--primary);
    border-radius: 8px;
    padding: 0.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
}

    .navbar-toggler:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
    }

    .navbar-toggler:hover {
        background: rgba(59, 130, 246, 0.1);
        transform: translateY(-2px);
    }

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%233b82f6' stroke-linecap='round' stroke-miterlimit='10' stroke-width='3' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    width: 24px;
    height: 24px;
}

/* Dark mode navbar toggle */
body.theme-dark .navbar-toggler {
    border-color: #22d3ee;
    background: rgba(255, 255, 255, 0.1);
}

body.theme-dark .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%2322d3ee' stroke-linecap='round' stroke-miterlimit='10' stroke-width='3' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

body.theme-dark .navbar-toggler:hover {
    background: rgba(34, 211, 238, 0.1);
}

/* Enhanced Mobile Responsive Design */
@media (max-width: 768px) {
    /* Navigation Mobile */
    .navbar {
        padding: 0.5rem 0;
    }

    .navbar-brand {
        font-size: 1.5rem;
    }

    .navbar-nav .nav-link {
        padding: 0.8rem 1rem;
        text-align: center;
    }

    /* Button Mobile */
    .btn-modern, .btn-glass {
        padding: 0.8rem 2rem;
        font-size: 1rem;
        text-align: center;
    }

    /* Section Mobile */
    .section-title {
        font-size: 2.2rem;
        margin-bottom: 0.8rem;
    }

    .section-subtitle {
        font-size: 1rem;
        padding: 0 1rem;
    }

    /* Footer Mobile */
    .footer {
        padding: 3rem 0 1rem;
    }

    .footer-brand {
        font-size: 1.5rem;
    }

    .social-links a {
        width: 40px;
        height: 40px;
        margin-right: 0.5rem;
    }
}

/* Extra Small Devices (phones, 576px and down) */
@media (max-width: 576px) {
    .section-title {
        font-size: 1.8rem;
    }
}

/* iOS Safari Specific Fixes */
@supports (-webkit-touch-callout: none) {
    .navbar {
        -webkit-backdrop-filter: blur(20px) saturate(180%);
    }

    .btn-modern,
    .btn-glass {
        -webkit-appearance: none;
        border-radius: 50px;
    }
}

/* Android Chrome Specific Fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .animated-bg {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn-modern:hover,
    .btn-glass:hover {
        transform: none;
    }

    .navbar-nav .nav-link:hover {
        transform: none;
    }

    /* Larger touch targets for mobile */
    .btn-modern,
    .btn-glass {
        min-height: 44px;
        min-width: 44px;
    }

    .navbar-nav .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .social-links a {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Safe Area Support for iPhone X and newer */
@supports (padding: max(0px)) {
    .navbar {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .footer {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
}
