/* ===== Header Container ===== */
.header-container {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    margin-bottom: 10px;
    font-family: Arial, sans-serif;
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #fff8e1;
    padding-top: 4px;
    border-radius: 0 0 12px 12px;
}

.header-container h1 {
    margin: 0;
    flex: 1;
}

.header-container h1 a {
    color: #fff;
    text-decoration: none;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 8px rgba(255, 255, 255, 0.3);
}

/* ===== Main Header Bar ===== */
.header-container > .site-header {
    background-color: #ffa726;
    color: #FFF;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    position: relative;
    flex: 1;
    margin: 10px;
}

/* ===== Header Links ===== */
.header-container .header-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.header-container .header-links a {
    display: inline-block;
    white-space: nowrap;
    padding: 8px 16px;
    background-color: #ffa726;
    color: #fff;
    border: 1px solid #ff9800;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.header-container .header-links a:hover {
    background-color: #ff9800;
    color: #fff;
}

.header-container .header-links a.current-page,
.header-container .header-links a.active {
    background-color: #ff9800;
    color: #fff;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.header-container .header-links a:active {
    background-color: #e68a00;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ===== Header Right Container ===== */
.header-right {
    display: flex;
    align-items: center;
    margin-left: auto;
    flex-wrap: wrap;
}

/* ===== Burger Menu ===== */
.burger-menu {
    cursor: pointer;
    margin-right: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 22px;
    height: 22px;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.burger-menu:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.burger-bar {
    display: block;
    height: 2.5px;
    border-radius: 2px;
    background-color: #fff;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.burger-bar.open:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}

.burger-bar.open:nth-child(2) {
    opacity: 0;
}

.burger-bar.open:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
}

/* ===== Dropdown Menu ===== */
.menu-dropdown {
    display: none;
    position: absolute;
    top: 60px;
    left: 20px;
    background-color: #fff8e1;
    color: #333;
    border: 1px solid #ffcc80;
    box-shadow: 0 8px 24px rgba(255, 152, 0, 0.2);
    border-radius: 12px;
    z-index: 1000;
    overflow: hidden;
    min-width: 180px;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.2s ease;
    text-align: left;
}

.menu-dropdown.visible {
    display: block;
}

.menu-dropdown a {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.15s, border-color 0.15s;
    border-left: 3px solid transparent;
}

.menu-dropdown a:hover {
    background-color: #fff3e0;
    border-left-color: #ffcc80;
}

.menu-dropdown a.current-page {
    background-color: #fff3e0;
    font-weight: bold;
    border-left-color: #ff9800;
    color: #e65100;
}

.menu-dropdown .menu-divider {
    border-top: 1px solid #ffe0b2;
    margin: 4px 16px;
}

/* ===== Login Link ===== */
.login-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    margin-left: 16px;
    background-color: #ffa726;
    border: 2px solid #fff;
    border-radius: 16px;
    text-decoration: none;
    color: #fff;
    font-size: 1rem;
    transition: background-color 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.login-link:hover {
    background-color: #ffb84d;
    box-shadow: 0 4px 12px rgba(255, 120, 0, 0.6);
}

.login-link.logged-in {
    background-color: #e68a00;
}

.login-icon {
    margin-right: 4px;
    font-size: 1.1rem;
    filter: sepia(100%) saturate(500%) hue-rotate(350deg);
}

/* ===== Animated Site Title ===== */
.site-title {
    display: inline;
    font-size: 1.5rem;
    white-space: nowrap;
}

.title-word {
    display: inline-flex;
}

.title-cap {
    display: inline;
}

.title-rest {
    display: inline-block;
    overflow: hidden;
    max-width: var(--rest-width, 8em);
    opacity: 1;
    transition: max-width 1s ease, opacity 0.75s ease;
    white-space: nowrap;
    vertical-align: baseline;
}

.title-spacer {
    display: inline-block;
    width: 0.35em;
    transition: width 1s ease;
}

/* ===== Login Popup Animation ===== */
@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 20px 5px rgba(255, 140, 0, 0.9);
        transform: translate(-50%, -50%) rotate(0deg);
    }
    50% {
        box-shadow: 0 0 30px 10px rgba(255, 140, 0, 0.5);
        transform: translate(-50%, -50%) rotate(2deg);
    }
    100% {
        box-shadow: 0 0 20px 5px rgba(255, 140, 0, 0.9);
        transform: translate(-50%, -50%) rotate(0deg);
    }
}

/* ===== Responsive: Tablet ===== */
@media (max-width: 768px) {
    .header-container > .site-header {
        margin: 5px !important;
        padding: 8px 12px !important;
        justify-content: flex-start !important;
    }

    .header-container h1 {
        margin: 0 !important;
        flex: 0 1 auto;
    }

    .header-container .header-right {
        display: none !important;
    }
}

/* ===== Responsive: Phone ===== */
@media (max-width: 480px) {
    .site-title {
        font-size: 1.2rem;
    }

    .title-rest {
        max-width: 0;
        opacity: 0;
        transition: max-width 1.2s ease, opacity 1s ease;
    }

    .title-spacer {
        width: 0.15em;
        transition: width 1.2s ease;
    }
}
