:root {
    --primary-color: #1976d2;
    --secondary-color: #2196f3;
    --accent-color: #ff5722;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --background-color: #fafafa;
    --card-background: #ffffff;
    --text-primary: #212121;
    --text-secondary: #757575;
    --text-light: #bdbdbd;
    --border-color: #e0e0e0;
    --border-hover: #9e9e9e;
    --shadow-light: rgba(0, 0, 0, 0.12);
    --shadow-medium: rgba(0, 0, 0, 0.16);
    --shadow-dark: rgba(0, 0, 0, 0.24);
    --header-color: #1565c0;
    --button-color: #ff4081;
    --button-hover: #e91e63;
    --header-height: 80px;
    --nav-height: 50px;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
}

.header-nav-container {
    background-color: var(--header-color);
    color: white;
    position: sticky;
    top: 0;
    z-index: 101;
    box-shadow: 0 4px 8px var(--shadow-medium);
}

.header-content {
    padding: 0.75rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    min-height: var(--header-height);
    box-sizing: border-box;
}

/* Search Container Styles */
.search-container {
    display: flex;
    justify-content: center;
    margin: 0;
    max-width: 400px;
    flex: 1;
}

/* Blog Link Styles */
.blog-link {
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.blog-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-1px);
}

#search-input {
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: 4px 0 0 4px;
    width: 70%;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    outline: none;
}

#search-input:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

#search-button {
    padding: 0.5rem 1rem;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px var(--shadow-light);
    text-transform: uppercase;
    font-weight: 500;
}

#search-button:hover {
    background-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px var(--shadow-medium);
}

/* Search Results Styles */
#search-results h2 {
    text-align: center;
    margin-top: 2rem;
    color: var(--primary-color);
}

#clear-search {
    display: block;
    margin: 1rem auto;
    padding: 0.5rem 1rem;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px var(--shadow-light);
}

#clear-search:hover {
    background-color: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px var(--shadow-medium);
}

.no-results {
    text-align: center;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 600px;
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--shadow-light);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}



/* Main Navigation Styles */
.main-nav {
    background-color: var(--primary-color);
    border-bottom: none;
    width: 100%;
    height: var(--nav-height);
}

.nav-menu {
    display: flex;
    list-style: none;
    list-style-type: none;
    margin: 0;
    padding: 0;
    max-width: 1200px;
    margin: 0 auto;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
}

.nav-menu li {
    list-style: none;
    list-style-type: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-button {
    background: none;
    border: none;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    height: var(--nav-height);
    display: flex;
    align-items: center;
}

/* Desktop-only responsive navigation fixes */
@media (min-width: 769px) {
    .main-nav {
        overflow-x: auto; /* Allow horizontal scrolling on desktop only */
        overflow-y: hidden;
    }
    
    .nav-menu {
        flex-wrap: nowrap; /* Prevent wrapping on desktop */
        min-width: max-content; /* Ensure menu doesn't shrink below content width */
    }
    
    .nav-button {
        flex-shrink: 0; /* Prevent buttons from shrinking on desktop */
    }
}

/* Medium desktop screens - reduce padding */
@media (min-width: 769px) and (max-width: 1024px) {
    .nav-button {
        padding: 12px 12px;
        font-size: 13px;
    }
}

/* Large desktop screens - normal padding */
@media (min-width: 1025px) {
    .nav-button {
        padding: 15px 20px;
        font-size: 14px;
    }
}

/* Scroll indicator for small desktop screens */
@media (min-width: 769px) and (max-width: 900px) {
    .main-nav {
        position: relative;
    }
    
    .main-nav::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 20px;
        background: linear-gradient(to left, var(--primary-color), transparent);
        pointer-events: none;
        z-index: 1;
    }
    
    .nav-menu {
        padding-right: 20px;
    }
}

/* Mobile styles remain unchanged - keep original vertical menu */
@media (max-width: 768px) {
    .hamburger-menu {
        display: flex;
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--primary-color);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 100;
        box-shadow: 0 4px 8px var(--shadow-medium);
        /* Keep original mobile behavior - no horizontal scroll */
        overflow: visible;
    }
    
    .main-nav.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-menu {
        flex-direction: column; /* Keep vertical layout for mobile */
        padding: 1rem 0;
        flex-wrap: wrap; /* Allow wrapping on mobile if needed */
    }
    
    .nav-item {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .nav-button {
        width: 100%;
        text-align: left;
        padding: 15px 20px;
        border-bottom: none;
        flex-shrink: 1; /* Allow shrinking on mobile */
    }
    
    .dropdown-menu {
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        background: var(--card-background);
        border-radius: 0;
        opacity: 1;
        visibility: visible;
    }
    
    .dropdown-link {
        color: var(--text-primary);
        padding: 12px 30px;
    }
    
    .dropdown-link:hover {
        background-color: var(--primary-color);
        color: #ffffff;
    }
}
.nav-button:hover {
    color: #ffd700;
    border-bottom-color: #ffd700;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Desktop dropdown styles - ensure they work properly */
@media (min-width: 769px) {
    /* Remove all existing dropdown styles and replace with this unified system */
    
    /* Base dropdown styles - shared between desktop and mobile */
    .dropdown-menu {
        list-style: none;
        margin: 0;
        padding: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-radius: 12px;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow: hidden;
    }
    
    .dropdown-list {
        list-style: none !important;
        margin: 0;
        padding: 8px 0;
    }
    
    .dropdown-list li {
        list-style: none !important;
        margin: 0;
        padding: 0;
    }
    
    .dropdown-link {
        display: block;
        width: 100%;
        padding: 12px 20px;
        color: #333;
        text-decoration: none;
        font-size: 14px;
        font-weight: 500;
        background: none;
        border: none;
        text-align: left;
        cursor: pointer;
        transition: all 0.25s ease;
        border-left: 3px solid transparent;
        position: relative;
    }
    
    .dropdown-link:hover,
    .dropdown-link:focus {
        background: linear-gradient(135deg, var(--primary-color), #4a90e2);
        color: white;
        border-left-color: var(--warning-color);
        transform: translateX(4px);
    }
    
    /* Desktop-specific dropdown styles */
    @media (min-width: 769px) {
        .dropdown-menu {
            position: absolute;
            top: calc(100% + 8px);
            left: 0;
            min-width: 280px;
            max-width: 320px;
            z-index: 1003;
            transform: translateY(-10px) scale(0.95);
            border: 1px solid rgba(0, 0, 0, 0.1);
        }
        
        .nav-item:hover .dropdown-menu {
            opacity: 1;
            visibility: visible;
            transform: translateY(0) scale(1);
        }
        
        /* Adjust position for right-side dropdowns */
        .nav-item:last-child .dropdown-menu,
        .nav-item:nth-last-child(2) .dropdown-menu {
            left: auto;
            right: 0;
        }
        
        .dropdown-link {
            font-size: 14px;
            padding: 14px 20px;
        }
    }
    
    /* Mobile-specific dropdown styles */
    @media (max-width: 768px) {
        .dropdown-menu {
            position: static;
            background: rgba(255, 255, 255, 0.08);
            backdrop-filter: blur(8px);
            border-radius: 0;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
            max-height: 0;
            transform: none;
            border: none;
            margin: 0;
        }
        
        .nav-item:hover .dropdown-menu,
        .nav-item.active .dropdown-menu {
            opacity: 1;
            visibility: visible;
            max-height: 400px;
        }
        
        .dropdown-list {
            padding: 0;
        }
        
        .dropdown-link {
            color: rgba(255, 255, 255, 0.9);
            font-size: 15px;
            padding: 16px 30px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }
        
        .dropdown-link:last-child {
            border-bottom: none;
        }
        
        .dropdown-link:hover,
        .dropdown-link:focus {
            background: rgba(255, 255, 255, 0.15);
            color: white;
            transform: translateX(8px);
        }
    }
    
    /* Ensure proper layering and overflow */
    .main-nav {
        position: relative;
        z-index: 1001;
        overflow: visible !important;
    }
    
    .nav-item {
        position: relative;
        z-index: 1002;
    }
    
    .header-content,
    #navigation {
        overflow: visible !important;
    }
    
    /* Dark mode support */
    @media (prefers-color-scheme: dark) {
        .dropdown-menu {
            background: rgba(30, 30, 30, 0.95);
            border-color: rgba(255, 255, 255, 0.1);
        }
        
        .dropdown-link {
            color: rgba(255, 255, 255, 0.9);
        }
        
        @media (max-width: 768px) {
            .dropdown-menu {
                background: rgba(0, 0, 0, 0.3);
            }
        }
    }
    
    /* Smooth staggered animation for dropdown items */
    .dropdown-link:nth-child(1) { transition-delay: 0ms; }
    .dropdown-link:nth-child(2) { transition-delay: 50ms; }
    .dropdown-link:nth-child(3) { transition-delay: 100ms; }
    .dropdown-link:nth-child(4) { transition-delay: 150ms; }
    .dropdown-link:nth-child(5) { transition-delay: 200ms; }
}

@media (max-width: 768px) {
    .dropdown-list {
        list-style: none;
        list-style-type: none;
        margin: 0;
        padding: 10px 0;
    }
    
    .dropdown-list li {
        list-style: none;
        list-style-type: none;
        margin: 0;
        padding: 0;
    }
    
    .dropdown-link {
        display: block;
        width: 100%;
        padding: 14px 24px;
        color: var(--text-primary);
        background: none;
        border: none;
        text-align: left;
        font-size: 14px;
        font-weight: 500;
        transition: all 0.3s ease;
        border-left: 4px solid transparent;
        position: relative;
        cursor: pointer;
    }
    
    .dropdown-link:hover {
        background-color: var(--primary-color);
        color: #ffffff;
        border-left-color: var(--warning-color);
        transform: translateX(5px);
    }
}

@media (min-width: 769px) {
    :root {
        --header-height: 90px;
        --nav-height: 55px;
    }
    
    .header-content {
        padding: 1rem;
    }
    
    .nav-button {
        padding: 15px 20px;
        height: var(--nav-height);
    }
    
    #simulations-container {
        padding: 2rem;
    }
    
    .simulation-grid {
        gap: 2rem;
        padding: 2rem 0;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 70px;
        --nav-height: auto;
    }
    
    .header-content {
        padding: 0.5rem 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .header-content h1 {
        font-size: 1.5rem;
        margin: 0;
    }
    
    .search-container {
        margin: 0;
        max-width: 100%;
    }
    
    .blog-link {
        align-self: center;
    }
    
    .main-nav {
        width: 100%;
        height: auto;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-menu {
        flex-direction: column;
        width: 100%;
    }
    
    .nav-item {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .nav-button {
        width: 100%;
        text-align: left;
        padding: 12px 20px;
        border-bottom: none;
        border-radius: 0;
        text-transform: none;
        letter-spacing: normal;
        font-size: 16px;
        height: auto;
    }
    
    .nav-button:hover {
        background: rgba(255, 255, 255, 0.15);
        border-bottom: none;
        transform: none;
    }
    
    .dropdown-menu {
        position: static;
        transform: none;
        opacity: 0;
        visibility: hidden;
        max-height: 0;
        overflow: hidden;
        transition: all 0.3s ease;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background: rgba(255, 255, 255, 0.95);
        min-width: auto;
        left: auto;
    }
    
    /* Use class-based approach instead of hover for mobile */
    .nav-item.dropdown-open .dropdown-menu {
        opacity: 1;
        visibility: visible;
        max-height: 400px;
    }
    
    /* Keep hover for desktop compatibility */
    .nav-item:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        max-height: 400px;
    }
    
    .dropdown-link {
        width: 100%;
        padding: 12px 40px;
        background: none;
        border: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        text-align: left;
        color: #2c3e50;
        font-size: 14px;
        cursor: pointer;
    }
    
    .dropdown-link:hover {
        background-color: var(--primary-color);
        color: #ffffff;
        transform: none;
        padding-left: 40px;
    }
    
    /* Adjust main content margin for mobile */
    #simulations-container {
        margin-top: 10px;
        padding: 1rem 0.5rem;
    }
    
    .simulation-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1rem;
        padding: 1rem 0;
    }
    
    .simulation-card {
        width: 100%;
        max-width: 320px;
    }
}

/* Navigation container styling */
#navigation {
    width: 100%;
}

/* Ensure no list bullets anywhere in navigation */
#navigation ul,
#navigation li {
    list-style: none !important;
    list-style-type: none !important;
    margin: 0;
    padding: 0;
}

/* Force horizontal layout for main navigation */
#navigation .nav-menu {
    display: flex !important;
    flex-direction: row !important;
}

/* Add margin to main content */
#simulations-container {
    margin-top: 20px;
    padding: 1rem;
}

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

.simulation-card {
    background: var(--card-background);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px var(--shadow-light);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.simulation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow-medium);
    border-color: var(--border-hover);
}

.simulation-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.simulation-info {
    padding: 1rem;
}

.platform {
    display: block;
    color: #666;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.button {
    display: inline-block;
    background-color: var(--secondary-color);
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 1rem;
}

/* Add these new styles */
.simulation-container {
    width: 100%;
    max-width: 800px;
    margin: 2rem auto;
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.geogebra-iframe {
    width: 100%;
    height: 600px;
    border: none;
}


/* Topic Section Styling */
section {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow-light);
    border: 1px solid var(--border-color);
}

section h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 0.5rem;
    font-size: 1.8rem;
    text-transform: capitalize;
}

/* Remove the hover styles */
section h2:hover {
    background-color: transparent;
    transform: none;
}

/* Simulation Grid Layout */
.simulation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

/* Simulation Card Styling */
.simulation-card {
    width: 250px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 0 auto;
}

.simulation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.simulation-card img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
}

.simulation-info {
    padding: 1.2rem;
}

.card-content {
    padding: 1.5rem;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.simulation-info h3 {
    margin: 0 0 0.8rem 0;
    color: #2c3e50;
    font-size: 1.2rem;
    text-transform: capitalize;
}

/* Remove the hover effect for h3 */
.simulation-card:hover .simulation-info h3 {
    background-color: transparent;
    transform: none;
}

.simulation-info p {
    color: #7f8c8d;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.author-info {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 500;
    font-style: italic;
    margin-bottom: 0.8rem;
}

.platform {
    display: inline-block;
    color: var(--secondary-color);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    font-weight: 500;
    background-color: rgba(52, 152, 219, 0.1);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
}

.button {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background-color: var(--button-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px var(--shadow-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.button:hover {
    background-color: var(--button-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px var(--shadow-medium);
}

/* Add to your existing styles */
.home-link {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.home-link:hover {
    opacity: 0.8;
}

header h1 {
    margin: 0;
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

footer {
    text-align: center;
    padding: 1rem;
    background-color: var(--header-color);
    color: white;
    margin-top: 2rem;
    box-shadow: 0 -4px 8px var(--shadow-medium);
}

.admin-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
}

.admin-link:hover {
    color: white;
    text-decoration: underline;
}

#back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--accent-color);
    color: white;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 24px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px var(--shadow-medium);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#back-to-top:hover {
    background-color: #d84315;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--shadow-dark);
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* Force mobile navigation when overflow is detected */
.force-mobile-nav .hamburger-menu {
    display: flex !important;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.force-mobile-nav .main-nav {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    width: 100% !important;
    background-color: var(--primary-color) !important;
    transform: translateY(-100%) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.3s ease !important;
    z-index: 100 !important;
    box-shadow: 0 4px 8px var(--shadow-medium) !important;
    overflow: visible !important;
}

.force-mobile-nav .main-nav.active {
    transform: translateY(0) !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.force-mobile-nav .nav-menu {
    flex-direction: column !important;
    padding: 1rem 0 !important;
    flex-wrap: wrap !important;
}

.force-mobile-nav .nav-item {
    width: 100% !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.force-mobile-nav .nav-button {
    width: 100% !important;
    text-align: left !important;
    padding: 15px 20px !important;
    border-bottom: none !important;
    flex-shrink: 1 !important;
    height: auto !important;
}

.force-mobile-nav .nav-button:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-bottom: none !important;
    transform: none !important;
}

.force-mobile-nav .dropdown-menu {
    position: static !important;
    background: rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(8px) !important;
    border-radius: 0 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    max-height: 0 !important;
    transform: none !important;
    border: none !important;
    margin: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
}

.force-mobile-nav .nav-item.dropdown-open .dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    max-height: 400px !important;
}

.force-mobile-nav .dropdown-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 15px !important;
    padding: 16px 30px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    width: 100% !important;
    text-align: left !important;
}

.force-mobile-nav .dropdown-link:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: white !important;
    transform: translateX(8px) !important;
}

/* Hamburger menu styles */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 102;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background-color: white;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger-line:not(:last-child) {
    margin-bottom: 4px;
}

/* Hamburger animation */
.hamburger-menu.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile Navigation Styles */
@media (max-width: 768px) {
    .hamburger-menu {
        display: flex;
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--primary-color);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 100;
        box-shadow: 0 4px 8px var(--shadow-medium);
    }
    
    .main-nav.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-menu {
        flex-direction: column;
        padding: 1rem 0;
    }
    
    .nav-item {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .nav-button {
        width: 100%;
        text-align: left;
        padding: 15px 20px;
        border-bottom: none;
    }
    
    .dropdown-menu {
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        background: var(--card-background);
        border-radius: 0;
        opacity: 1;
        visibility: visible;
    }
    
    .dropdown-link {
        color: var(--text-primary);
        padding: 12px 30px;
    }
    
    .dropdown-link:hover {
        background-color: var(--primary-color);
        color: #ffffff;
    }
}

/* Desktop dropdown stability fixes */
@media (min-width: 769px) {
  /* Ensure dropdown visibility - add this to fix layering issues */
  .main-nav {
    position: relative;
    z-index: 1001; /* Higher than other elements */
    overflow: visible !important; /* Prevent clipping */
  }
  
  .nav-item {
    position: relative;
    z-index: 1002;
  }
  
  .dropdown-menu {
    z-index: 1003 !important; /* Ensure it's on top */
    position: absolute !important;
  }
  
  /* Fix any overflow clipping from parent containers */
  .header-content,
  #navigation {
    overflow: visible !important;
  }
}
