/* Reset and base styles */
:root {
    --navigation-height: 120px; /* Approximate height for navigation + secondary nav */
}

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

body {
    font-family: system-ui, sans-serif;
    background: var(--layer-background);
    color: var(--on-background);
    margin: 0;
    min-height: 100vh;
    font-size: 18px;
}

/* Main layout */
.main-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
}

/* Desktop navigation */
.navigation_container {
    position: sticky;
    top: 0;
    z-index: var(--layer-navigation);
    box-shadow: var(--elevation-1);
    background: var(--layer-surface);
    border-bottom: 1px solid var(--outline-variant);
}

.secondary-nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--size-3) var(--size-4);
    display: flex;
    align-items: center;
    gap: var(--size-3);
    overflow-x: auto;
}

.secondary-nav-content::-webkit-scrollbar {
    display: none;
}

/* Secondary nav items */
.secondary-nav-item {
    display: inline-flex;
    align-items: center;
    gap: var(--size-2);
    padding: var(--size-2) var(--size-3);
    border-radius: var(--radius-medium);
    text-decoration: none;
    color: var(--on-surface-variant);
    font-size: var(--font-size-body-medium);
    white-space: nowrap;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.secondary-nav-item:hover {
    background: var(--layer-surface-variant);
    color: var(--on-surface);
}

.secondary-nav-item.active {
    background: var(--primary);
    color: var(--on-primary);
}

/* Filter-style items */
.secondary-nav-filter {
    padding: var(--size-2) var(--size-3);
    background: var(--layer-surface-variant);
    border: 1px solid var(--outline-variant);
    border-radius: var(--radius-full);
    font-size: var(--font-size-body-medium);
    color: var(--on-surface-variant);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: var(--size-2);
    white-space: nowrap;
}

.secondary-nav-filter:hover {
    background: var(--primary);
    color: var(--on-primary);
}

.secondary-nav-filter.active {
    background: var(--primary);
    color: var(--on-primary);
}

/* Select dropdown in secondary nav */
.secondary-nav-select {
    padding: var(--size-2) var(--size-3);
    border: 1px solid var(--outline);
    border-radius: var(--radius-small);
    background: var(--layer-surface);
    color: var(--on-surface);
    font-size: var(--font-size-body-medium);
    min-width: 120px;
    cursor: pointer;
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--size-3) var(--size-4);
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.nav-left {
    display: flex;
    align-items: center;
    flex: 1;
    gap: var(--size-4);
}
.nav-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: var(--size-4);
}

.nav-right {
    text-align: right;
    flex: 1;
}

/* Logo/Brand */
.logo-icon {
    color: var(--primary);
    width: 24px;
    height: 24px;
}

/* Desktop and mobile navigation logo - make mark_2 larger */
.desktop-nav .dropdown .button svg:first-child {
    width: 3rem;
    height: 3rem;
}
.mobile-nav .mobile-nav-content > svg {
    width: 2rem;
    height: 2rem;
}


.chevron-icon {
    transition: transform 0.2s ease;
}

.dropdown.show .chevron-icon {
    transform: rotate(180deg);
}

/* Search */
.search-container {
    position: relative;
    min-width: 300px;
}

.search-input {
    width: 100%;
    padding: var(--size-3) var(--size-4);
    padding-left: 2.5rem;
    border: 2px solid var(--outline);
    border-radius: var(--radius-full);
    background: var(--layer-surface);
    font-size: var(--font-size-body-medium);
    outline: 1px solid var(--outline);
    transition: border-color 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(103, 80, 164, 0.2);
}

.search-icon {
    position: absolute;
    left: var(--size-3);
    top: 50%;
    transform: translateY(-50%);
    color: var(--outline);
    width: 20px;
    height: 20px;
}


/* Mobile navigation */
.mobile-nav {
    display: none;

}

.mobile-nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--size-3);
}

.mobile-search {
    flex: 1;
    margin: 0 var(--size-3);
}


/* Dropdown menu */
.dropdown {
    position: relative;
    display: inline-block;
}

/* Desktop navigation dropdown - centered and mobile-width */
.dropdown:has(#mainDropdown) {
    position: static;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    text-align: left;
    margin-top: var(--size-2);
    background: var(--layer-surface);
    border: 1px solid var(--outline-variant);
    border-radius: var(--radius-medium);
    box-shadow: var(--elevation-2);
    min-width: 200px;
    z-index: var(--layer-modal);
}

/* Main navigation dropdown styles */
#mainDropdown {
    position: fixed;
    left: 50%;
    top: 64px; /* Height of nav */
    transform: translateX(-50%);
    /* width: 390px; Mobile display width */
    width: min(100%, var(--size-content-2));
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    right: auto;
    margin-top: 0;
}

.dropdown-content.show {
    display: block;
}

.dropdown-item {
    display: block;
    padding: var(--size-3);
    color: var(--on-surface);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background: var(--layer-surface-variant);
}

.dropdown-item:first-child {
    border-radius: var(--radius-medium) var(--radius-medium) 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 var(--radius-medium) var(--radius-medium);
}


/* Mobile overlay menu */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--layer-modal);
    display: none;
}

.mobile-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--layer-surface);
    border-radius: var(--radius-large) var(--radius-large) 0 0;
    transform: translateY(100%);
    transition: height 0.3s ease, transform 0.3s ease;
    z-index: calc(var(--layer-modal) + 1);
    height: 74vh; /* Initial height */
}

.mobile-menu.show {
    transform: translateY(0);
}

/* Expandable behavior - when user scrolls down */
.mobile-menu.is-expanded {
    height: 100vh;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--size-4);
    padding: var(--size-4);
    border-bottom: 1px solid var(--outline-variant);
    flex-shrink: 0;
}

.mobile-menu-content {
    height: calc(100%); /* Subtract header height */
    overflow-y: auto;
}

/* Content area */
.content {
    flex: 1; /* Take all remaining space after nav */
    padding: var(--size-4);
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: flex; /* Make it a flex container */
    flex-direction: column;
}

/* Desktop adjustments to clear notification tray */
@media (min-width: 769px) {
    .content {
        padding-bottom: 100px; /* Extra padding to clear notification tray */
    }
}

/* Mobile adjustments for secondary nav */
@media (max-width: 768px) {
    .desktop-nav {
        display: none;
    }

    .mobile-nav {
        display: block;
    }

    .fab.fixed {
        display: flex;
    }

    .search-container {
        min-width: auto;
    }

    .mobile-overlay.show {
        display: block;
    }

    /* Mobile secondary nav adjustments */
    .secondary-nav {
        top: 56px; /* Height of mobile nav */
        margin-top: 0;
    }

    .secondary-nav-content {
        padding: var(--size-3);
        gap: var(--size-2);
    }

    .secondary-nav-item,
    .secondary-nav-filter {
        font-size: var(--font-size-body-medium);
        padding: var(--size-2);
    }

    /* Remove any bottom padding that was for mobile navigation */
    .content {
        padding-bottom: var(--size-4);
    }
}

@media (min-width: 769px) {
    .desktop-nav {
        display: block;
    }

    .mobile-nav {
        display: none;
    }

    .fab.fixed {
        display: none;
    }
}