/* ==========================================
   Standardized Header Stylesheet
   ========================================== */

/* Universal Box-Sizing Reset specifically for header and its descendants */
header,
header *,
header *::before,
header *::after {
    box-sizing: border-box;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 3.75rem; /* Exactly 60px */
    padding: 0 2rem;
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background-color var(--transition), border-color var(--transition);
}

#header-title {
    flex: 0 0 auto;
    text-align: left;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

#header-title h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
    color: var(--text);
}

.header-title-link {
    text-decoration: none;
    color: inherit;
    display: inline-flex;
    align-items: baseline;
}

.header-version-link {
    text-decoration: none;
    display: inline-flex;
    align-items: baseline;
}

.header-version {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    opacity: 0.7;
    transition: opacity var(--transition), color var(--transition);
}

.header-version-link:hover .header-version {
    opacity: 1;
    color: var(--primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.icon-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-color, var(--text));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, opacity 0.2s ease;
    width: 40px;
    height: 40px;
}

.icon-button:hover {
    background-color: var(--button-hover);
}

.icon-button:disabled {
    color: var(--text-color, var(--text));
    opacity: 0.4;
    cursor: not-allowed;
}

.icon-button:disabled:hover {
    background-color: transparent;
}

.icon-button svg {
    display: block;
    width: 1.5rem;
    height: 1.5rem;
}

.language-select-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.language-select {
    background-color: var(--container-bg, var(--container));
    color: var(--text-color, var(--text));
    border: 1px solid var(--border-color, var(--border));
    border-radius: 8px;
    padding: 0.35rem 1.8rem 0.35rem 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
    font-weight: 500;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1rem;
}

.language-select option {
    background-color: var(--bg-color);
    color: var(--text);
}

.language-select:hover {
    background-color: var(--button-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.icon-button:hover svg {
    stroke: var(--primary);
}

/* Theme Icon Colors */
#theme-toggle .cloud-rain { color: #818cf8; }
#theme-toggle .leaf { color: #a3e635; }
#theme-toggle .flame { color: #ff5555; }
#theme-toggle .ghost { color: #ff79c6; }
#theme-toggle .waves { color: #2dd4bf; }
#theme-toggle .target { color: #22c55e; }

/* Responsive styles */
@media (max-width: 768px) {
    header {
        height: auto;
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    #header-title {
        display: none;
    }
    .header-right {
        width: 100%;
        justify-content: center;
    }
}
