/* Language Switcher Styles */

/* Body positioning for absolute children */
body {
    position: relative;
}

/* Header Language Container - positioned absolutely to body */
.header-language {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 9999;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.header-language:hover {
    opacity: 1;
}

.language-switcher {
    position: relative;
    display: inline-block;
    font-family: inherit;
    width: 150px;
}

.language-switcher__current {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    justify-content: space-between;
}

.header-language:hover .language-switcher__current {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.language-switcher__current:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.language-switcher__flag {
    width: 20px;
    height: 14px;
    border-radius: 2px;
    object-fit: cover;
    flex-shrink: 0;
}

.language-switcher__name {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}

.language-switcher__arrow {
    width: 12px;
    height: 8px;
    color: #6b7280;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.language-switcher[data-open="true"] .language-switcher__arrow {
    transform: rotate(180deg);
}

.language-switcher__dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    margin-top: 4px;
}

.language-switcher[data-open="true"] .language-switcher__dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-switcher__option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    text-decoration: none;
    color: #374151;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
}

.language-switcher__option:last-child {
    border-bottom: none;
}

.language-switcher__option:hover {
    background: #f9fafb;
    color: #111827;
}

.language-switcher__option--active {
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 600;
}

.language-switcher__option--active:hover {
    background: #dbeafe;
}

.language-switcher__check {
    width: 16px;
    height: 16px;
    color: #3b82f6;
    margin-left: auto;
    flex-shrink: 0;
}

/* Tablet styles */
@media (max-width: 1200px) {
    .header-language {
        top: 15px;
        right: 15px;
    }
}

/* Mobile styles */
@media (max-width: 768px) {
    
    .language-switcher__current {
        padding: 6px 10px;
        min-width: 100px;
    }
    
    .language-switcher__flag {
        width: 18px;
        height: 12px;
    }
    
    .language-switcher__name {
        font-size: 13px;
    }
    
    .language-switcher__option {
        padding: 8px 10px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .language-switcher__current {
        background: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }
    
    .language-switcher__current:hover {
        background: #374151;
        border-color: #4b5563;
    }
    
    .language-switcher__name {
        color: #f9fafb;
    }
    
    .language-switcher__dropdown {
        background: #1f2937;
        border-color: #374151;
    }
    
    .language-switcher__option {
        color: #f9fafb;
        border-color: #374151;
    }
    
    .language-switcher__option:hover {
        background: #374151;
    }
    
    .language-switcher__option--active {
        background: #1e40af;
        color: #dbeafe;
    }
}

/* Mobile frame positioning */
.mob-frame .language-switcher {
    margin: 10px auto 10px 50px;
}
