/**
 * GID Bot - Language Switcher Styles
 * Includes RTL support
 */

/* Language Switcher Container */
#language-switcher {
    position: relative;
    display: inline-flex;
    z-index: 50;
}

/* Main Button */
.lang-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color, #2a2a2a);
    border-radius: 8px;
    color: var(--text-secondary, #a0a0a0);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent, #33D37F);
    color: var(--text-primary, #ffffff);
}

.lang-flag {
    font-size: 1.1rem;
    line-height: 1;
}

.lang-code {
    font-weight: 500;
}

.lang-arrow {
    transition: transform 0.2s;
}

/* Dropdown */
.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--bg-secondary, #141414);
    border: 1px solid var(--border-color, #2a2a2a);
    border-radius: 12px;
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.lang-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown.open ~ .lang-btn .lang-arrow {
    transform: rotate(180deg);
}

/* Language Option */
.lang-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary, #a0a0a0);
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s;
}

.lang-option:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary, #ffffff);
}

.lang-option.active {
    background: rgba(51, 211, 127, 0.1);
    color: var(--accent, #33D37F);
}

.lang-option .lang-flag {
    font-size: 1.25rem;
}

.lang-option .lang-name {
    font-weight: 500;
}

/* RTL Support */
html[dir="rtl"] .lang-dropdown {
    right: auto;
    left: 0;
}

html[dir="rtl"] .lang-option {
    text-align: right;
}

/* RTL Body Styles */
body.rtl {
    direction: rtl;
    text-align: right;
}

body.rtl .nav-links {
    flex-direction: row-reverse;
}

body.rtl .hero-cta {
    flex-direction: row-reverse;
}

body.rtl .feature-card {
    text-align: right;
}

body.rtl .footer-grid {
    direction: rtl;
}

body.rtl .stat-card {
    text-align: center;
}

body.rtl .timeline-item::before {
    left: auto;
    right: 50%;
    transform: translateX(50%);
}

body.rtl .timeline-item {
    padding-right: calc(50% + 40px);
    padding-left: 0;
}

body.rtl .timeline-item:nth-child(even) {
    padding-left: calc(50% + 40px);
    padding-right: 0;
}

/* Mobile Styles */
@media (max-width: 768px) {
    #language-switcher {
        position: fixed;
        bottom: 20px;
        right: 20px;
    }

    html[dir="rtl"] #language-switcher {
        right: auto;
        left: 20px;
    }

    .lang-dropdown {
        bottom: calc(100% + 8px);
        top: auto;
        transform: translateY(10px);
    }

    .lang-dropdown.open {
        transform: translateY(0);
    }

    .lang-code {
        display: none;
    }

    .lang-btn {
        padding: 0.75rem;
        border-radius: 50%;
    }

    .lang-arrow {
        display: none;
    }
}

/* Smooth language transition */
[data-i18n],
[data-i18n-placeholder],
[data-i18n-title] {
    transition: opacity 0.15s;
}

.i18n-loading [data-i18n],
.i18n-loading [data-i18n-placeholder],
.i18n-loading [data-i18n-title] {
    opacity: 0.5;
}
