/* Header Controls (Language Selector) */
.header-controls {
    position: absolute;
    top: 20px;
    right: 30px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 16px;
}

.auth-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    /* Ground the absolute notice */
}

.btn-login,
.btn-signup {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 0 20px;
    /* Horizontal padding */
    height: 40px;
    /* Fixed height to match dropdown */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.95rem;
    /* Match dropdown font size */
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.btn-login:hover,
.btn-signup:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-1px);
}

.btn-login {
    background: rgba(255, 255, 255, 0.3);
    font-weight: 600;
}

.auth-controls button[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
    transform: none !important;
}

.launch-notice {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.75rem;
    font-style: italic;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-help {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
    padding: 0;
}

.btn-help:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
    transform: rotate(15deg);
}



.language-select-header {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    /* Globe icon added */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='2' y1='12' x2='22' y2='12'%3E%3C/line%3E%3Cpath d='M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
    padding: 8px 16px 8px 40px;
    /* Extra left padding for icon */
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    -webkit-appearance: none;
    /* Remove default arrow in some browsers */
    -moz-appearance: none;
    appearance: none;
    text-align: left;
    /* Remove center alignment to align with icon naturally */
}

.language-select-header:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
}

.language-select-header option {
    background: white;
    color: var(--text-primary);
}

/* Responsive adjustment */
@media (max-width: 768px) {
    .header-controls {
        top: 15px;
        right: 15px;
    }

    .language-select-header {
        padding: 6px 12px;
        font-size: 16px;
        /* Increased for mobile readability */
    }
}

/* Custom Language Dropdown Styling (Light Theme) */
.custom-dropdown-btn.language-select-header+.custom-dropdown-menu {
    background: white;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl);
    top: calc(100% + 8px);
    /* Add spacing */
}

.custom-dropdown-btn.language-select-header+.custom-dropdown-menu .custom-dropdown-item {
    color: var(--text-primary);
    font-weight: 500;
}

.custom-dropdown-btn.language-select-header+.custom-dropdown-menu .custom-dropdown-item:hover {
    background: #f1f5f9;
}

.custom-dropdown-btn.language-select-header+.custom-dropdown-menu .custom-dropdown-item.selected {
    background: #eff6ff;
    color: var(--primary-color);
    font-weight: 600;
}

/* Ensure the button maintains its header styling when it becomes a custom dropdown btn */
button.custom-dropdown-btn.language-select-header {
    display: flex;
    justify-content: space-between;
    width: auto;
    min-width: 160px;
}

/* Hide default arrow if custom btn has one, or adjust spacing */
button.custom-dropdown-btn.language-select-header .custom-dropdown-arrow {
    margin-left: 12px;
}

/* Explicitly style the arrow to ensure visibility */
button.custom-dropdown-btn.language-select-header .custom-dropdown-arrow {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    margin-left: 10px;
    color: white;
    /* Force white color */
}

/* Standardized Desktop Language Selector */
@media (min-width: 769px) {
    .header-language-selector {
        width: 200px !important;
    }

    .header-language-selector .custom-select-trigger {
        height: 40px !important;
        background: rgba(255, 255, 255, 0.2) !important;
        border: 1px solid rgba(255, 255, 255, 0.4) !important;
        backdrop-filter: blur(8px) !important;
        border-radius: 20px !important;
        padding-left: 42px !important;
        /* Space for globe icon */
        padding-right: 16px !important;
        font-size: 0.95rem !important;
        color: white !important;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='2' y1='12' x2='22' y2='12'%3E%3C/line%3E%3Cpath d='M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'%3E%3C/path%3E%3C/svg%3E") !important;
        background-repeat: no-repeat !important;
        background-position: 14px center !important;
        transition: all 0.2s ease !important;
        display: flex !important;
        align-items: center !important;
    }

    .header-language-selector .custom-option {
        padding: 6px 16px !important;
        font-size: 0.95em !important;
    }

    .header-language-selector .custom-select-trigger:hover {
        background: rgba(255, 255, 255, 0.3) !important;
        border-color: rgba(255, 255, 255, 0.6) !important;
        transform: translateY(-1px);
    }

    /* Ensure icon color matches text */
    .header-language-selector .arrow {
        border-color: white !important;
    }
}

/* Mobile Language Dropdown Width Fix */
@media (max-width: 768px) {
    .header-language-selector .custom-dropdown-menu {
        width: auto !important;
        min-width: auto !important;
        max-width: 90vw;
        right: 0;
        left: auto;
    }
}