:root {
    /* Dark theme colors */
    --dark-bg: #021019;
    --dark-surface: #041f2d;
    --dark-primary: #40E0D0;
    --dark-secondary: #FF00FF;
    --dark-text: #a0f0f0;
    --dark-accent: #39FF14;
    
    /* Light theme colors */
    --light-bg: #f0f9ff;
    --light-surface: #ffffff;
    --light-primary: #3b82f6;
    --light-secondary: #8b5cf6;
    --light-text: #0f172a;
    --light-accent: #22c55e;
    
    /* Default theme (dark) */
    --bg: var(--dark-bg);
    --surface: var(--dark-surface);
    --primary: var(--dark-primary);
    --secondary: var(--dark-secondary);
    --text: var(--dark-text);
    --accent: var(--dark-accent);
}

/* Light theme overrides */
body.light-theme {
    --bg: var(--light-bg);
    --surface: var(--light-surface);
    --primary: var(--light-primary);
    --secondary: var(--light-secondary);
    --text: var(--light-text);
    --accent: var(--light-accent);
}

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

body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    opacity: 0;
    animation: pageFadeIn 0.6s ease-out forwards;
}

@keyframes pageFadeIn {
    from { 
        opacity: 0; 
        transform: translate3d(0, 15px, 0);
    }
    to { 
        opacity: 1; 
        transform: translate3d(0, 0, 0);
    }
}

body.page-exiting {
    animation: pageFadeOut 0.4s ease-in forwards;
    pointer-events: none; /* Prevent interactions during exit */
}

@keyframes pageFadeOut {
    from { 
        opacity: 1; 
        transform: translate3d(0, 0, 0);
    }
    to { 
        opacity: 0; 
        transform: translate3d(0, -15px, 0);
    }
}

.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.08;
    overflow: hidden;
    pointer-events: none;
    transform: translate3d(0, 0, 0);
}

.background-animation::before {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: 
        linear-gradient(45deg, var(--primary) 25%, transparent 25%) 0 0,
        linear-gradient(-45deg, var(--primary) 25%, transparent 25%) 0 0,
        linear-gradient(45deg, transparent 75%, var(--primary) 75%) 0 0,
        linear-gradient(-45deg, transparent 75%, var(--primary) 75%) 0 0;
    background-size: 100px 100px;
    animation: backgroundMove 20s linear infinite;
    will-change: transform;
    backface-visibility: hidden;
}

@keyframes backgroundMove {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(-100px, -100px, 0);
    }
}

.nav-header {
    background: rgba(4, 31, 45, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(64, 224, 208, 0.1);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.home-link {
    text-decoration: none;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
}

.logo {
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: bold;
    font-family: 'Nunito', sans-serif;
    text-decoration: none;
}

.logo-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-right: 0.5rem;
    vertical-align: middle;
    display: inline-block;
}

.nav-pagelinks {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: rgba(64, 224, 208, 0.1);
    transform: translateY(-2px);
}

.nav-link.active-page {
    background: var(--primary);
    color: var(--bg);
}

/* Light theme navbar */
body.light-theme .nav-header {
    background: rgba(224, 242, 254, 0.8);
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
}

body.light-theme .nav-link:hover {
    background: rgba(59, 130, 246, 0.1);
}

/* Update theme toggle button to match main page */
.theme-btn {
    background: rgba(11, 31, 58, 0.8);
    border: 1px solid rgba(64, 224, 208, 0.2);
    color: var(--text);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-btn:hover {
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(64, 224, 208, 0.2);
    transform: translateY(-2px);
}

.theme-btn .light-icon {
    display: none;
}

.theme-btn .dark-icon {
    display: block;
}

body.light-theme .theme-btn .light-icon {
    display: block;
    color: #f59e0b;
}

body.light-theme .theme-btn .dark-icon {
    display: none;
}

body.light-theme .theme-btn {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(59, 130, 246, 0.2);
}

main {
    padding: 80px 20px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.hero {
    text-align: center;
    padding: 4rem 1rem;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 4rem);
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    color: transparent;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    margin-top: 2rem;
    background: var(--primary);
    color: var(--bg);
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(var(--primary), 0.3);
}

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

.feature-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), border-color 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(var(--primary), 0.05),
        transparent
    );
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.feature-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.2),
        0 0 20px rgba(var(--primary), 0.2);
}

.feature-card:hover::before {
    transform: translateX(100%);
}

.feature-card:hover .feature-icon {
    transform: scale(1.2) rotate(10deg);
    color: var(--primary);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    transition: all 0.4s ease;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.step {
    position: relative;
    padding: 2rem;
    background: var(--surface);
    border-radius: 12px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), border-color 0.3s ease;
    overflow: hidden;
    border: 1px solid transparent;
}

.step:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 
        0 15px 30px rgba(0, 0, 0, 0.15),
        0 0 15px rgba(var(--accent), 0.2);
}

.step::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        transparent,
        rgba(var(--accent), 0.05),
        transparent
    );
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.step:hover::before {
    transform: translateX(100%);
}

.step:hover .step-number {
    transform: scale(1.1) rotate(-10deg);
    box-shadow: 
        0 0 20px var(--primary),
        0 0 40px rgba(var(--primary), 0.2);
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: var(--bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-weight: bold;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Animation classes */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.slide-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

footer {
    text-align: center;
    padding: 2rem;
    background: var(--surface);
    margin-top: 4rem;
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: 0.5rem;
    transition: color 0.3s ease;
}

.mobile-menu-toggle:hover {
    color: var(--primary);
}

/* Mobile sidebar */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: var(--surface);
    z-index: 2000;
    padding: 2rem 1rem;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.mobile-sidebar.open {
    transform: translateX(280px);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(64, 224, 208, 0.1);
}

.sidebar-header h2 {
    color: var(--primary);
    margin: 0;
    font-size: 1.5rem;
}

.sidebar-close {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.3s ease;
}

.sidebar-close:hover {
    color: var(--primary);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-link {
    color: var(--text);
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.sidebar-link:hover {
    background: rgba(64, 224, 208, 0.1);
    transform: translateX(5px);
}

.sidebar-link.active-page {
    background: var(--primary);
    color: var(--bg);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* Light theme sidebar */
body.light-theme .mobile-sidebar {
    background: var(--light-surface);
}

body.light-theme .sidebar-header {
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
}

body.light-theme .sidebar-link:hover {
    background: rgba(59, 130, 246, 0.1);
}

/* Improved mobile responsive design */
@media (max-width: 768px) {
    .nav-header {
        padding: 0.75rem 1rem;
    }
    
    .nav-pagelinks {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .hero {
        padding: 6rem 1rem 2rem;
    }
    
    .features-grid, .steps {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .step {
        padding: 1.5rem;
    }
    
    /* Added visibility for mobile sidebar */
    .mobile-sidebar {
        visibility: hidden;
        opacity: 0;
        transition: all 0.3s ease;
    }
    
    .mobile-sidebar.open {
        visibility: visible;
        opacity: 1;
    }
    
    .sidebar-overlay {
        transition: all 0.3s ease;
    }
    
    main {
        padding-top: 0;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }
    
    .nav-header {
        padding: 0.5rem 0.75rem;
    }
    
    .logo-icon {
        width: 40px;
        height: 40px;
    }
    
    .logo {
        font-size: 1.1rem;
    }
    
    .feature-card {
        padding: 1.25rem;
    }
    
    .feature-icon {
        font-size: 2.25rem;
    }
    
    .step {
        padding: 1.25rem;
    }
    
    .step-number {
        width: 40px;
        height: 40px;
        line-height: 40px;
        font-size: 1.25rem;
    }
    
    .cta-button {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }
    
    /* Fix background animation */
    .background-animation::before {
        background-size: 60px 60px;
    }
}

/* Added for medium-sized tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .feature-card {
        padding: 1.75rem;
    }
    
    .hero {
        padding: 7rem 2rem 3rem;
    }
}