/* styles.css */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa;
}

/* Navbar Styles */
.navbar {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

/* Logo */
.logo {
    font-size: 24px;
    font-weight: 700;
    color: #c42a2a;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 28px;
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 5px;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 18px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: #f8f9fa;
    color: #c42a2a;
}

.nav-link i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.nav-item:hover .nav-link i {
    transform: rotate(180deg);
}

/* Mega Menu */
.mega-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border-radius: 12px;
    padding: 30px;
    min-width: 800px;
    max-width: 1000px;
    opacity: 0;
    visibility: hidden;
    margin-top: 20px;
    transition: all 0.3s ease;
    pointer-events: none;
}

.nav-item:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    margin-top: 10px;
    pointer-events: all;
}

.mega-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* Mega Menu Column */
.mega-column h3 {
    color: #c42a2a;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mega-links {
    list-style: none;
}

.mega-links li {
    margin-bottom: 8px;
}

.mega-links a {
    color: #555;
    text-decoration: none;
    font-size: 14px;
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.mega-links a:hover {
    background: #fff5f5;
    color: #c42a2a;
    padding-left: 16px;
}

/* Popular Badge */
.popular-badge {
    display: inline-block;
    background: #ff4444;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 6px;
    font-weight: 600;
}

/* CTA Buttons */
.cta-buttons {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #c42a2a;
    color: white;
}

.btn-primary:hover {
    background: #a82323;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(196,42,42,0.3);
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    font-size: 24px;
    background: none;
    border: none;
    color: #333;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

/* Hero Section (Demo) */
.hero {
    padding: 60px 20px;
    text-align: center;
}

.hero h1 {
    font-size: 42px;
    color: #333;
    margin-bottom: 20px;
}

.hero p {
    font-size: 18px;
    color: #666;
}

/* Breadcrumb */
.breadcrumb {
    padding: 10px 0;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

.breadcrumb a {
    color: #c42a2a;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Page Header */
.page-header {
    margin-bottom: 40px;
    text-align: center;
}

.page-header h1 {
    font-size: 36px;
    margin-bottom: 15px;
    color: #1f2937;
}

.page-description {
    font-size: 18px;
    color: #6b7280;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Category Cards for Homepage */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin: 40px 0;
}

.category-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.category-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.category-card h3 {
    margin-bottom: 15px;
    font-size: 22px;
}

.category-card h3 a {
    color: #1f2937;
    text-decoration: none;
}

.category-card h3 a:hover {
    color: #c42a2a;
}

.category-card p {
    color: #6b7280;
    line-height: 1.6;
}

/* Quick Calculators */
.quick-calculators {
    margin: 50px 0;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 25px;
}

.quick-link {
    display: flex;
    align-items: center;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    text-decoration: none;
    color: #374151;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
}

.quick-link:hover {
    border-color: #c42a2a;
    background: #fff5f5;
    transform: translateY(-2px);
}

.quick-icon {
    font-size: 24px;
    margin-right: 15px;
}

.quick-text {
    font-weight: 600;
}

/* Calculators Grid for Category Pages */
.calculators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.calculator-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.calculator-card h2 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #1f2937;
}

.calculator-card > p {
    color: #6b7280;
    margin-bottom: 25px;
    font-size: 16px;
}

/* Related Calculators */
.related-calculators {
    margin: 60px 0;
    padding: 30px;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
    border-radius: 12px;
    text-align: center;
}

.related-calculators h3 {
    margin-bottom: 20px;
    color: #1f2937;
}

.related-links {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.related-links a {
    background: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    color: #374151;
    font-weight: 600;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.related-links a:hover {
    border-color: #c42a2a;
    color: #c42a2a;
    transform: translateY(-2px);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .mega-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mega-menu {
        min-width: 600px;
    }

    .calculators-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: #fff;
        width: 100%;
        padding: 20px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.1);
        transition: left 0.3s ease;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        z-index: 999;
        gap: 0;
    }

    .nav-menu.active {
        left: 0;
    }

    /* Make ALL nav items visible in mobile menu */
    .nav-menu .nav-item {
        display: block !important;
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
        opacity: 1 !important;
        visibility: visible !important;
        height: auto !important;
    }

    .nav-menu .nav-item:last-child {
        border-bottom: none;
    }

    /* Show ALL nav links in mobile menu */
    .nav-link {
        width: 100%;
        justify-content: space-between;
        padding: 15px 20px;
        font-size: 16px;
        border-radius: 0;
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* Don't use hover on mobile for nav links */
    .nav-link:hover {
        background: none;
    }

    /* Show mega menu on click, not hover - mobile only */
    .mega-menu {
        position: static;
        transform: none;
        box-shadow: none;
        padding: 0;
        min-width: auto;
        margin-top: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        border-radius: 0;
        background: #f8f9fa;
        width: 100%;
    }

    /* Show mega menu when parent nav-item has 'active' class */
    .nav-item.mobile-active .mega-menu {
        max-height: 1000px;
        opacity: 1;
        visibility: visible;
        padding: 15px 0;
        margin-top: 10px;
    }

    /* Don't use hover on mobile */
    .nav-item:hover .mega-menu {
        opacity: 0;
        visibility: hidden;
        max-height: 0;
        margin-top: 0;
    }

    /* Rotate arrow when active */
    .nav-item.mobile-active .nav-link i {
        transform: rotate(180deg);
    }

    .mega-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0 15px;
    }

    .mega-column {
        background: white;
        padding: 15px;
        border-radius: 8px;
        margin-bottom: 10px;
    }

    .mega-column h3 {
        font-size: 13px;
        margin-bottom: 10px;
    }

    .mega-links a {
        padding: 10px 15px;
        font-size: 14px;
    }

    .cta-buttons {
        flex-direction: column;
        padding: 20px 0;
        width: 100%;
        margin-top: 20px;
        border-top: 1px solid #f0f0f0;
    }

    .btn {
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }

    .btn:last-child {
        margin-bottom: 0;
    }
}

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #c42a2a;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.page-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #c42a2a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.nav-link.active {
    background: #fff5f5;
    color: #c42a2a;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.back-to-top:hover {
    background: #a82323;
    transform: translateY(-5px);
}

.page-header h1 {
    font-size: 28px;
}

.categories-grid {
    grid-template-columns: 1fr;
}

.calculators-grid {
    grid-template-columns: 1fr;
}

.quick-grid {
    grid-template-columns: 1fr;
}

/* Print Styles */
@media print {
    .navbar,
    .related-calculators,
    .btn {
        display: none !important;
    }
    
    .container {
        margin: 0;
        padding: 0;
    }
    
    body {
        background: white;
        font-size: 12pt;
    }
    
    .calculator-card {
        border: 1px solid #000;
        page-break-inside: avoid;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for accessibility */
a:focus,
button:focus,
input:focus,
select:focus {
    outline: 3px solid #c42a2a;
    outline-offset: 2px;
}

/* Skip to main content link */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 0;
    background: #c42a2a;
    color: white;
    padding: 8px;
    z-index: 1001;
    text-decoration: none;
}

.skip-to-main:focus {
    top: 0;
}

body.dark-mode {
    background: #1a1a1a;
    color: #fff;
}

body.dark-mode .navbar,
body.dark-mode .tool-card,
body.dark-mode .category-section {
    background: #2d2d2d;
    color: #fff;
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 10px;
    color: #333;
}

body.dark-mode .theme-toggle {
    color: #fff;
}

/* Footer Styles */
.site-footer {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: #e2e8f0;
    margin-top: 80px;
    padding: 60px 20px 20px 20px;
}

.footer-grid {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-box h3 {
    color: #ffffff;
    font-size: 20px;
    margin-bottom: 20px;
    font-weight: 700;
}

.footer-box p {
    color: #cbd5e0;
    line-height: 1.8;
    margin-bottom: 10px;
}

.footer-box ul {
    list-style: none;
    padding: 0;
}

.footer-box ul li {
    margin-bottom: 12px;
}

.footer-box ul li a {
    color: #cbd5e0;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.footer-box ul li a:hover {
    color: #667eea;
    padding-left: 5px;
}

/* Footer Social Icons */
.footer-social {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.footer-social a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e0;
    font-size: 18px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.footer-social a:hover {
    background: #667eea;
    color: white;
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
    text-align: center;
}

.footer-bottom p {
    color: #a0aec0;
    font-size: 14px;
    margin: 0;
}

.footer-bottom a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.footer-bottom a:hover {
    text-decoration: underline;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 60px 40px;
    border-radius: 20px;
    text-align: center;
    color: white;
    margin: 60px 0;
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.3);
}

.cta-section h2 {
    font-size: 42px;
    margin-bottom: 20px;
    font-weight: 800;
}

.cta-section p {
    font-size: 18px;
    margin-bottom: 30px;
    opacity: 0.95;
}

.cta-button {
    display: inline-block;
    background: white;
    color: #667eea;
    padding: 18px 40px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 18px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
    background: #f8f9fa;
}

/* Responsive Footer */
@media (max-width: 768px) {
    .site-footer {
        padding: 40px 20px 20px 20px;
        margin-top: 50px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .cta-section {
        padding: 40px 25px;
        margin: 40px 0;
    }
    
    .cta-section h2 {
        font-size: 28px;
    }
    
    .cta-section p {
        font-size: 16px;
    }
    
    .cta-button {
        padding: 15px 30px;
        font-size: 16px;
    }
}

/* Prevent body scroll when menu is open */
body.no-scroll {
    overflow: hidden;
    height: 100vh;
}

/* Improve accessibility focus styles */
.nav-link:focus,
.mega-links a:focus,
.btn:focus,
.mobile-toggle:focus {
    outline: 3px solid #c42a2a;
    outline-offset: 2px;
}

/* Loading state for mobile menu */
.nav-menu.loading * {
    pointer-events: none;
}

/* Home button styles for mobile */
@media (max-width: 768px) {
    .mobile-home-item {
        display: block !important;
        border-bottom: 1px solid #f0f0f0;
        background: #fff5f5;
    }
    
    .mobile-home-link {
        color: #c42a2a !important;
        font-weight: 600;
    }
    
    .mobile-home-link i {
        margin-right: 10px;
    }
    
    /* Hide logo text on mobile, show only icon */
    .logo-text {
        display: inline;
    }
}

/* Floating Home Button */
.floating-home-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

/* Show floating button on calculator pages */
body.calculator-page .floating-home-btn {
    opacity: 1;
    visibility: visible;
}

.floating-home-link {
    background: linear-gradient(135deg, #c42a2a 0%, #a82323 100%);
    color: white;
    border-radius: 50px;
    padding: 12px 25px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(196, 42, 42, 0.4);
    transition: all 0.3s ease;
    text-decoration: none;
}

.floating-home-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(196, 42, 42, 0.6);
    color: white;
}

/* Home Indicator on Logo */
.home-indicator {
    display: none;
    font-size: 11px;
    background: #c42a2a;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    margin-left: 5px;
}

/* Show "Home" indicator on logo when on calculator pages */
body.calculator-page .home-indicator {
    display: inline-block;
}

/* Mobile Home Menu Item */
.mobile-home-item {
    display: none;
}

.mobile-home-link {
    color: #c42a2a !important;
    font-weight: 600;
}

.mobile-home-link i {
    margin-right: 10px;
}

.home-badge {
    background: #c42a2a;
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
    font-weight: 600;
    display: none;
}

/* Show home badge on mobile when NOT on home page */
body.calculator-page .mobile-home-item .home-badge {
    display: inline-block;
}

/* Desktop theme toggle */
.desktop-theme {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 10px;
    color: #333;
    margin-left: 10px;
    display: flex;
    align-items: center;
}

body.dark-mode .desktop-theme {
    color: #fff;
}

/* Theme toggle in mobile menu */
.theme-menu-item {
    display: none;
}

.theme-toggle-btn {
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: 16px;
    cursor: pointer;
    padding: 15px 20px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Mobile Styles */
@media (max-width: 768px) {
    /* Show mobile home item */
    .mobile-home-item {
        display: block;
        border-bottom: 1px solid #f0f0f0;
        background: #fff5f5;
    }
    
    /* Hide desktop theme toggle on mobile */
    .desktop-theme {
        display: none;
    }
    
    /* Show theme toggle in mobile menu */
    .theme-menu-item {
        display: block;
        border-top: 1px solid #f0f0f0;
        margin-top: 10px;
    }
    
    /* Floating button for mobile */
    .floating-home-btn {
        bottom: 90px;
        left: 20px;
    }
    
    .floating-home-link {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    /* Hide text on very small screens */
    @media (max-width: 480px) {
        .logo-text {
            display: none;
        }
        
        .floating-home-link span {
            display: none;
        }
        
        .floating-home-link {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            justify-content: center;
            padding: 0;
        }
    }
}

/* Desktop: Hide mobile home item */
@media (min-width: 769px) {
    .mobile-home-item {
        display: none !important;
    }
}













/* Performance optimizations for mobile */
@media (max-width: 768px) {
    /* Hardware acceleration for smoother animations */
    .nav-menu,
    .mega-menu,
    .nav-link {
        transform: translateZ(0);
        backface-visibility: hidden;
        perspective: 1000px;
    }
    
    /* Optimize transitions */
    .nav-menu {
        will-change: transform;
        transform: translate3d(-100%, 0, 0);
    }
    
    .nav-menu.active {
        transform: translate3d(0, 0, 0);
    }
    
    /* Reduce animation complexity on mobile */
    .mega-menu {
        transition: max-height 0.3s ease, opacity 0.2s ease;
    }
    
    /* Optimize scrolling performance */
    .tools-list,
    .mega-grid {
        contain: layout style paint;
    }
    
    /* Reduce paint operations */
    .tool-card {
        transform: translateZ(0);
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch target sizes */
    .nav-link,
    .mega-links a,
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .nav-link:hover {
        background: none;
    }
    
    .tool-card:hover {
        transform: none;
    }
}                                                        /* ==================== ROOT VARIABLES ==================== */
:root {
    --primary-color: #c42a2a;
    --primary-hover: #a82323;
    --text-dark: #333;
    --text-light: #666;
    --bg-white: #fff;
    --bg-light: #f8f9fa;
    --border-color: #e5e7eb;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

/* Dark Mode */
body.dark-mode {
    --text-dark: #f9fafb;
    --text-light: #d1d5db;
    --bg-white: #2d2d2d;
    --bg-light: #1a1a1a;
    --border-color: #444;
}

/* ==================== RESET ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

/* ==================== NAVBAR ==================== */
.navbar {
    background: var(--bg-white);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    position: relative;
}

/* ==================== LOGO ==================== */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--primary-color);
    font-size: 24px;
    font-weight: 700;
    transition: var(--transition);
}

.logo:hover {
    color: var(--primary-hover);
}

.logo i {
    font-size: 28px;
}

.home-indicator {
    display: none;
    font-size: 11px;
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    margin-left: 5px;
}

/* ==================== MOBILE TOGGLE (Hidden on Desktop) ==================== */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-dark);
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

/* ==================== DESKTOP THEME TOGGLE ==================== */
.desktop-theme {
    display: block;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-dark);
    font-size: 18px;
    transition: var(--transition);
    margin-left: auto;
    margin-right: 20px;
}

.desktop-theme:hover {
    background-color: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

/* ==================== NAV MENU (Desktop Layout) ==================== */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 5px;
    list-style: none;
}

.mobile-home-item {
    display: none;
}

.theme-menu-item {
    display: none;
}

/* ==================== NAV ITEMS & LINKS ==================== */
.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 18px;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    border-radius: 8px;
    transition: var(--transition);
    white-space: nowrap;
    cursor: pointer;
}

.nav-link:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
}

.nav-link i.fa-chevron-down {
    font-size: 12px;
    transition: transform 0.3s ease;
}

/* ==================== DESKTOP MEGA MENU (Hover Only) ==================== */
.mega-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 30px;
    min-width: 800px;
    max-width: 1000px;
    opacity: 0;
    visibility: hidden;
    margin-top: 20px;
    transition: opacity 0.3s ease, visibility 0.3s ease, margin-top 0.3s ease;
    pointer-events: none;
    z-index: 999;
}

/* DESKTOP: Show mega menu on hover */
.nav-item:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    margin-top: 10px;
    pointer-events: all;
}

/* DESKTOP: Rotate chevron on hover */
.nav-item:hover .fa-chevron-down {
    transform: rotate(180deg);
}

/* ==================== MEGA MENU GRID ==================== */
.mega-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.mega-column h3 {
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mega-links {
    list-style: none;
}

.mega-links li {
    margin-bottom: 8px;
}

.mega-links a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.mega-links a:hover {
    background: #fff5f5;
    color: var(--primary-color);
    padding-left: 16px;
}

/* ==================== POPULAR BADGE ==================== */
.popular-badge {
    display: inline-block;
    background: #ff4444;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 6px;
    font-weight: 600;
}

/* ==================== CTA BUTTONS ==================== */
.cta-buttons {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(196, 42, 42, 0.3);
}

/* ==================== CONTAINER ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ==================== RESPONSIVE: TABLET ==================== */
@media (max-width: 1024px) {
    .mega-menu {
        min-width: 600px;
    }
    
    .mega-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==================== RESPONSIVE: MOBILE ==================== */
@media (max-width: 768px) {
    /* Show mobile toggle button */
    .mobile-toggle {
        display: block;
    }
    
    /* Hide desktop theme toggle */
    .desktop-theme {
        display: none;
    }
    
    /* Show mobile home item */
    .mobile-home-item {
        display: block !important;
        border-bottom: 1px solid #f0f0f0;
        background: #fff5f5;
    }
    
    .mobile-home-link {
        color: var(--primary-color) !important;
        font-weight: 600;
    }
    
    .home-badge {
        background: var(--primary-color);
        color: white;
        font-size: 11px;
        padding: 2px 8px;
        border-radius: 10px;
        margin-left: auto;
        font-weight: 600;
    }
    
    /* Show theme toggle in mobile menu */
    .theme-menu-item {
        display: block;
        border-top: 1px solid #f0f0f0;
        margin-top: 10px;
    }
    
    .theme-toggle-btn {
        background: none;
        border: none;
        width: 100%;
        text-align: left;
        font-family: inherit;
        font-size: 16px;
        cursor: pointer;
        padding: 15px 20px;
        color: var(--text-dark);
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    /* Mobile menu styles */
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: var(--bg-white);
        width: 100%;
        padding: 20px;
        box-shadow: var(--shadow-lg);
        transition: left 0.3s ease;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        z-index: 999;
        gap: 0;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    /* Mobile nav items */
    .nav-item {
        display: block !important;
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .nav-item:last-child {
        border-bottom: none;
    }
    
    /* Mobile nav links */
    .nav-link {
        width: 100%;
        justify-content: space-between;
        padding: 15px 20px;
        font-size: 16px;
        border-radius: 0;
    }
    
    /* MOBILE: Disable hover effects */
    .nav-link:hover {
        background: none;
        color: var(--text-dark);
    }
    
    .nav-item:hover .mega-menu {
        opacity: 0;
        visibility: hidden;
        margin-top: 20px;
        pointer-events: none;
    }
    
    .nav-item:hover .fa-chevron-down {
        transform: none;
    }
    
    /* MOBILE: Mega menu becomes accordion */
    .mega-menu {
        position: static;
        transform: none;
        box-shadow: none;
        padding: 0;
        min-width: auto;
        max-width: none;
        margin-top: 0;
        border: none;
        border-radius: 0;
        background: var(--bg-light);
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease;
    }
    
    /* MOBILE: Show mega menu when parent has 'mobile-active' class */
    .nav-item.mobile-active .mega-menu {
        max-height: 2000px;
        opacity: 1;
        visibility: visible;
        padding: 15px 0;
        margin-top: 10px;
    }
    
    /* MOBILE: Rotate chevron when active */
    .nav-item.mobile-active .fa-chevron-down {
        transform: rotate(180deg);
    }
    
    /* Mobile mega grid */
    .mega-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0 15px;
    }
    
    .mega-column {
        background: white;
        padding: 15px;
        border-radius: 8px;
        margin-bottom: 10px;
    }
    
    .mega-column:last-child {
        margin-bottom: 0;
    }
    
    .mega-column h3 {
        font-size: 13px;
        margin-bottom: 10px;
    }
    
    .mega-links a {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .mega-links a:hover {
        background: #fff5f5;
        padding-left: 15px;
    }
    
    /* Mobile CTA buttons */
    .cta-buttons {
        flex-direction: column;
        padding: 20px 0;
        width: 100%;
        margin-top: 20px;
        border-top: 1px solid #f0f0f0;
    }
    
    .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
        margin-bottom: 10px;
    }
    
    .btn:last-child {
        margin-bottom: 0;
    }
}

/* ==================== PREVENT BODY SCROLL WHEN MENU OPEN ==================== */
body.no-scroll {
    overflow: hidden;
    height: 100vh;
}

/* ==================== ACCESSIBILITY ==================== */
a:focus,
button:focus,
input:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* ==================== DEMO CONTENT ==================== */
.hero {
    padding: 60px 20px;
    text-align: center;
}

.hero h1 {
    font-size: 42px;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.hero p {
    font-size: 18px;
    color: var(--text-light);
}