/* BitChat APK - Language Switcher Styles */

.language-switcher {
    position: relative;
    display: inline-block;
    margin-left: 1rem;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--border-radius);
    color: var(--c-text);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.language-btn:hover {
    background: var(--c-surface-hover);
    border-color: var(--c-accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.language-btn:focus {
    outline: none;
    border-color: var(--c-accent);
    box-shadow: 0 0 0 3px rgba(0, 224, 184, 0.1);
}

.current-lang {
    font-weight: 600;
    color: var(--c-accent);
}

.language-icon {
    color: var(--c-text-sec);
    transition: var(--transition);
}

.language-btn:hover .language-icon {
    color: var(--c-accent);
    transform: rotate(180deg);
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 160px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    margin-top: 0.5rem;
}

.language-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 1rem;
    width: 12px;
    height: 12px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-bottom: none;
    border-right: none;
    transform: rotate(45deg);
}

.language-option {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--c-text);
    text-decoration: none;
    transition: var(--transition);
    border-bottom: 1px solid var(--c-border-light);
}

.language-option:last-child {
    border-bottom: none;
}

.language-option:hover {
    background: var(--c-bg-dark);
    color: var(--c-accent);
    transform: translateX(5px);
}

.language-option[data-lang="en"]::before {
    content: '🇺🇸 ';
    margin-right: 0.5rem;
}

.language-option[data-lang="es"]::before {
    content: '🇪🇸 ';
    margin-right: 0.5rem;
}

.language-option[data-lang="de"]::before {
    content: '🇩🇪 ';
    margin-right: 0.5rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .language-switcher {
        margin-left: 0.5rem;
    }
    
    .language-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .language-dropdown {
        right: -0.5rem;
        min-width: 140px;
    }
    
    .language-dropdown::before {
        right: 1.5rem;
    }
}

/* Light theme adjustments */
@media (prefers-color-scheme: light) {
    .language-btn {
        background: var(--c-surface);
        border-color: var(--c-border);
        color: var(--c-text);
    }
    
    .language-btn:hover {
        background: var(--c-surface-hover);
        border-color: var(--c-accent);
    }
    
    .language-dropdown {
        background: var(--c-surface);
        border-color: var(--c-border);
        box-shadow: var(--shadow-lg);
    }
    
    .language-dropdown::before {
        background: var(--c-surface);
        border-color: var(--c-border);
    }
    
    .language-option:hover {
        background: var(--c-bg-dark);
    }
}

[data-theme="light"] .language-btn {
    background: var(--c-surface) !important;
    border-color: var(--c-border) !important;
    color: var(--c-text) !important;
}

[data-theme="light"] .language-btn:hover {
    background: var(--c-surface-hover) !important;
    border-color: var(--c-accent) !important;
}

[data-theme="light"] .language-dropdown {
    background: var(--c-surface) !important;
    border-color: var(--c-border) !important;
    box-shadow: var(--shadow-lg) !important;
}

[data-theme="light"] .language-dropdown::before {
    background: var(--c-surface) !important;
    border-color: var(--c-border) !important;
}

[data-theme="light"] .language-option:hover {
    background: var(--c-bg-dark) !important;
}

/* Animation for language switching */
[data-translate] {
    transition: opacity 0.3s ease;
}

[data-translate].translating {
    opacity: 0.7;
}

/* Language indicator for current page */
.language-indicator {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: var(--c-accent);
    color: var(--c-bg-dark);
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 1001;
    opacity: 0.8;
    transition: var(--transition);
}

.language-indicator:hover {
    opacity: 1;
}

/* RTL support for Arabic (future) */
[dir="rtl"] .language-switcher {
    margin-left: 0;
    margin-right: 1rem;
}

[dir="rtl"] .language-dropdown {
    right: auto;
    left: 0;
}

[dir="rtl"] .language-dropdown::before {
    right: auto;
    left: 1rem;
}

[dir="rtl"] .language-option:hover {
    transform: translateX(-5px);
} 