/* Header */
header {
    background-color: var(--header-bg);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px var(--shadow);
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}



nav ul {
    display: flex;
    list-style: none;
    gap: 25px;
}

nav a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    position: relative;
    padding: 5px 0;
}

nav a:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--secondary);
    transition: width 0.3s;
}

nav a:hover:after {
    width: 100%;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--surface);
}

.mobile-menu {
    display: none;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
}

/* Responsive Header:
   - Mobile/tablet mode with dropdown menu: 800px <= width <= 1023px
   - Desktop / web mode: width >= 1024px shows inline tabs
*/
@media (max-width: 767px) {
    /* Small mobile: show mobile button and collapse nav */
    .mobile-menu {
        display: block;
    }

    nav ul {
        display: flex;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--header-bg);
        flex-direction: column;
        padding: 0 16px;
        box-shadow: 0 5px 10px var(--shadow);
        overflow: hidden;
        max-height: 0;
        transition: max-height 0.32s ease, padding 0.32s ease;
    }

    nav ul.active {
        max-height: 600px;
        padding: 16px;
    }

    nav ul li {
        margin: 10px 0;
    }

    .mobile-menu[aria-expanded="true"] {
        transform: rotate(90deg);
        transition: transform 0.2s ease;
    }
}

@media (min-width: 800px) and (max-width: 1023px) {
    .mobile-menu {
        display: block;
    }

    /* Dropdown hidden by default, expand with .active */
    nav ul {
        display: flex;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--header-bg);
        flex-direction: column;
        padding: 0 20px;
        box-shadow: 0 5px 10px var(--shadow);
        overflow: hidden;
        max-height: 0;
        transition: max-height 0.32s ease, padding 0.32s ease;
    }

    nav ul.active {
        max-height: 600px;
        padding: 20px;
    }

    nav ul li {
        margin: 10px 0;
    }

    .mobile-menu[aria-expanded="true"] {
        transform: rotate(90deg);
        transition: transform 0.2s ease;
    }
}

/* Desktop / Web mode: show inline tabs and hide mobile button */
@media (min-width: 1024px) {
    .mobile-menu {
        display: none;
    }

    nav ul {
        display: flex !important;
        position: static;
        top: auto;
        left: auto;
        width: auto;
        background: transparent;
        flex-direction: row;
        padding: 0;
        box-shadow: none;
        overflow: visible;
        max-height: none;
        gap: 25px;
    }

    nav ul li {
        margin: 0;
    }

    .header-actions {
        display: flex;
        align-items: center;
        gap: 10px;
    }
}

/* Prevent background scroll when menu open */
body.menu-open {
    overflow: hidden;
}
