/**
 * BabyTums Premium Language Switcher
 * Beautiful, functional language selection component
 */

/* ===== LANGUAGE SWITCHER BASE ===== */
.bt-language-switcher {
    position: relative;
    z-index: 1040;
}

/* ===== LANGUAGE TOGGLE BUTTON ===== */
.bt-lang-toggle {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding: 0.5rem 1rem !important;
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 12px !important;
    color: var(--bt-text-primary) !important;
    font-weight: 500 !important;
    font-size: 0.9rem !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    min-width: 80px !important;
    justify-content: center !important;
    text-decoration: none !important;
}

.bt-lang-toggle::after {
    display: none !important;
}

.bt-lang-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.bt-lang-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(201, 217, 227, 0.3);
}

.bt-lang-toggle.show {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

/* Language Toggle Elements */
.bt-lang-flag {
    font-size: 1.1rem;
    line-height: 1;
}

.bt-lang-code {
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.bt-lang-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
    opacity: 0.7;
}

.bt-lang-toggle:hover .bt-lang-arrow,
.bt-lang-toggle.show .bt-lang-arrow {
    transform: rotate(180deg);
    opacity: 1;
}

/* ===== DROPDOWN MENU ===== */
.bt-lang-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(201, 217, 227, 0.3);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    padding: 0.5rem;
    min-width: 200px;
    z-index: 2000;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.bt-lang-menu.show {
    display: block !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}

@keyframes bt-dropdown-appear {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Dropdown Header */
.bt-lang-header {
    display: flex !important;
    align-items: center !important;
    padding: 0.75rem 1rem !important;
    color: var(--bt-text-muted) !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border-bottom: 1px solid rgba(201, 217, 227, 0.2) !important;
    margin-bottom: 0.5rem !important;
    list-style: none !important;
}

/* Ensure dropdown shows */
.bt-lang-menu.show {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) scale(1) !important;
}

.bt-lang-divider {
    height: 1px;
    background: rgba(201, 217, 227, 0.2);
    margin: 0.5rem 0;
}

/* Make sure menu displays when shown */
.bt-lang-menu[style*="display: block"] {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Language Options */
.bt-lang-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    color: var(--bt-text-secondary);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    margin-bottom: 0.25rem;
}

.bt-lang-option:hover {
    background: linear-gradient(135deg, var(--bt-soft-blue), var(--bt-soft-pink));
    color: var(--bt-text-primary);
    text-decoration: none;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(201, 217, 227, 0.3);
}

.bt-lang-option.active {
    background: linear-gradient(135deg, var(--bt-accent-coral), var(--bt-accent-peach));
    color: white;
    font-weight: 600;
}

.bt-lang-option.active:hover {
    background: linear-gradient(135deg, var(--bt-accent-coral), var(--bt-accent-peach));
    color: white;
}

/* Language Option Elements */
.bt-lang-option .bt-lang-flag {
    font-size: 1.25rem;
    line-height: 1;
    flex-shrink: 0;
}

.bt-lang-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.bt-lang-name {
    font-weight: 500;
    font-size: 0.95rem;
    line-height: 1.2;
}

.bt-lang-code-small {
    font-size: 0.75rem;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bt-lang-check {
    color: white;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .bt-lang-toggle {
        min-width: 70px;
        padding: 0.4rem 0.8rem;
    }
    
    .bt-lang-code {
        font-size: 0.8rem;
    }
    
    .bt-lang-menu {
        min-width: 180px;
    }
    
    .bt-lang-option {
        padding: 0.6rem 0.8rem;
    }
    
    .bt-lang-name {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .bt-lang-toggle {
        min-width: 60px;
        padding: 0.4rem 0.6rem;
    }
    
    .bt-lang-code {
        display: none;
    }
    
    .bt-lang-flag {
        font-size: 1.3rem;
    }
    
    .bt-lang-menu {
        min-width: 160px;
        right: -20px;
    }
}

/* ===== SPECIAL EFFECTS ===== */
.bt-lang-toggle::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--bt-soft-blue), var(--bt-soft-pink), var(--bt-soft-green));
    border-radius: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    filter: blur(4px);
}

.bt-lang-toggle:hover::before {
    opacity: 0.3;
}

/* Pulse effect for active language */
.bt-lang-option.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    border-radius: inherit;
    animation: bt-lang-pulse 2s ease-in-out infinite;
    z-index: -1;
}

@keyframes bt-lang-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.02);
        opacity: 0.8;
    }
}

/* ===== ACCESSIBILITY ===== */
.bt-lang-toggle:focus-visible {
    outline: 2px solid var(--bt-soft-blue);
    outline-offset: 2px;
}

.bt-lang-option:focus-visible {
    outline: 2px solid var(--bt-soft-blue);
    outline-offset: -2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bt-lang-toggle {
        border-width: 2px;
        border-color: currentColor;
    }
    
    .bt-lang-menu {
        border-width: 2px;
        border-color: currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .bt-lang-toggle,
    .bt-lang-option,
    .bt-lang-arrow,
    .bt-lang-menu {
        transition: none !important;
        animation: none !important;
    }
}

/* ===== DARK MODE SUPPORT (if needed) ===== */
@media (prefers-color-scheme: dark) {
    .bt-lang-toggle {
        background: rgba(0, 0, 0, 0.1);
        border-color: rgba(0, 0, 0, 0.2);
        color: var(--bt-text-primary);
    }
    
    .bt-lang-menu {
        background: rgba(0, 0, 0, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .bt-lang-header {
        color: rgba(255, 255, 255, 0.7);
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
    
    .bt-lang-option {
        color: rgba(255, 255, 255, 0.8);
    }
    
    .bt-lang-option:hover {
        color: white;
    }
}
