/* Header Language Selector - Single Flag with Dropdown */
.header-language-selector {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

.language-dropdown-container {
    position: relative;
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.current-language-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.current-language-btn:hover {
    background: rgba(59, 130, 246, 0.2);
}

.current-language-btn.active {
    background: rgba(59, 130, 246, 0.2);
}

.current-flag-image {
    width: 24px;
    height: 18px;
    border-radius: 3px;
    object-fit: cover;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.dropdown-arrow {
    font-size: 10px;
    color: #D1D5DB;
    transition: transform 0.3s ease;
}

.current-language-btn.active .dropdown-arrow {
    transform: rotate(180deg);
}

.current-language-btn .language-name {
    color: white;
    font-weight: 500;
}

.language-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.3s ease;
    overflow: hidden;
    z-index: 1001;
    min-width: 140px;
}

.language-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-dropdown-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 1px solid #F3F4F6;
}

.language-dropdown-option:last-child {
    border-bottom: none;
}

.language-dropdown-option:hover {
    background-color: #F9FAFB;
    color: #3B82F6;
    text-decoration: none;
}

.option-flag-image {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    object-fit: cover;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.language-name {
    flex: 1;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .header-language-selector {
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .current-language-btn {
        padding: 6px 10px;
        gap: 6px;
    }
    
    .current-flag-image {
        width: 20px;
        height: 15px;
    }
    
    .dropdown-arrow {
        font-size: 8px;
    }
    
    .language-dropdown-option {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .option-flag-image {
        width: 18px;
        height: 13px;
    }
}

/* Animation for smooth entrance */
@keyframes fadeInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-language-selector {
    animation: fadeInFromTop 0.5s ease-out;
}

/* Ensure high z-index for proper layering */
.header-language-selector {
    z-index: 9999 !important;
}

.language-dropdown-menu {
    z-index: 10000 !important;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .language-dropdown-container {
        background: rgba(17, 24, 39, 0.8);
        border-color: rgba(255, 255, 255, 0.3);
    }
    
    .current-language-btn:hover,
    .current-language-btn.active {
        background: rgba(96, 165, 250, 0.2);
    }
    
    .dropdown-arrow {
        color: #E5E7EB;
    }
    
    .language-dropdown-menu {
        background: #374151;
        border-color: #4B5563;
    }
    
    .language-dropdown-option {
        color: #D1D5DB;
        border-color: #4B5563;
    }
    
    .language-dropdown-option:hover {
        background-color: #4B5563;
        color: #60A5FA;
    }
}
