/* =====================================================
   App Language Switcher - Sidebar Style
   ===================================================== */

/* Auth page language switcher */
.auth-lang-switcher {
    position: absolute;
    top: 24px;
    right: 24px;
    display: flex;
    gap: 6px;
    background: rgba(15, 15, 35, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 5px;
    z-index: 100;
}

.auth-lang-switcher .lang-option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    background: transparent;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', -apple-system, sans-serif;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.auth-lang-switcher .lang-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.auth-lang-switcher .lang-option.active {
    background: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.auth-lang-switcher .lang-flag {
    font-size: 13px;
    font-weight: 600;
}

/* Auth page — same pill switcher as marketing site */
.auth-lang-switcher-inline {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

/* =====================================================
   Site language switcher (matches marketing LanguageSwitcher)
   ===================================================== */
.site-lang {
    position: relative;
    display: inline-flex;
    font-family: 'Manrope', system-ui, sans-serif;
}

.site-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.4rem;
    padding: 0.35rem 0.7rem;
    border: 1px solid rgba(17, 17, 17, 0.08);
    border-radius: 999px;
    background: transparent;
    color: #111;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
}

.site-lang-code {
    text-transform: uppercase;
    font-size: 0.78rem;
}

.site-lang-name {
    max-width: 8.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
    color: #4a5160;
}

.site-lang-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.4rem);
    z-index: 1200;
    display: grid;
    min-width: 15.5rem;
    max-height: min(70vh, 28rem);
    overflow: auto;
    padding: 0.35rem;
    background: #fff;
    border: 1px solid rgba(17, 17, 17, 0.08);
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(17, 17, 17, 0.1);
}

.site-lang-menu[hidden] {
    display: none !important;
}

.site-lang-option {
    display: flex;
    align-items: baseline;
    gap: 0.65rem;
    width: 100%;
    padding: 0.5rem 0.7rem;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: #111;
    font-size: 0.92rem;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.site-lang-option strong {
    width: 2.1rem;
    flex: none;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    color: #4a5160;
}

.site-lang-option:hover,
.site-lang-option.is-active {
    background: rgba(17, 17, 17, 0.06);
}

.site-lang-option.is-active strong {
    color: #111;
}

.flyout-lang-options.site-lang {
    display: flex;
    width: 100%;
    margin-top: 0.35rem;
}

.flyout-lang-options .site-lang-btn {
    width: 100%;
    justify-content: space-between;
}

.flyout-lang-options .site-lang-menu {
    left: 0;
    right: 0;
    min-width: 0;
}

/* Language switcher in sidebar */
.sidebar-lang-switcher {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    margin: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.sidebar-lang-switcher .lang-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', -apple-system, sans-serif;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    font-weight: 500;
}

.sidebar-lang-switcher .lang-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.sidebar-lang-switcher .lang-option.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
    color: #fff;
}

.sidebar-lang-switcher .lang-flag {
    font-size: 16px;
    line-height: 1;
}

/* Collapsed sidebar - stack vertically */
.sidebar.collapsed .sidebar-lang-switcher {
    flex-direction: column;
    padding: 4px 8px;
    margin: 4px 8px;
}

.sidebar.collapsed .sidebar-lang-switcher .lang-option {
    padding: 6px;
}

.sidebar.collapsed .sidebar-lang-switcher .lang-name {
    display: none;
}

/* =====================================================
   Dropdown Style (for header placement)
   ===================================================== */

.lang-dropdown {
    position: relative;
    z-index: 1000;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', -apple-system, sans-serif;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
}

.lang-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.lang-toggle .globe-icon {
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

.lang-toggle .chevron-icon {
    width: 12px;
    height: 12px;
    opacity: 0.6;
    transition: transform 0.2s ease;
}

.lang-dropdown.open .lang-toggle .chevron-icon {
    transform: rotate(180deg);
}

.lang-current {
    min-width: 20px;
    text-align: center;
}

/* Dropdown Menu */
.lang-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #1e1e2d;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 6px;
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.lang-dropdown.open .lang-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-menu .lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: 'Inter', -apple-system, sans-serif;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
    text-align: left;
}

.lang-menu .lang-option:hover {
    background: rgba(102, 126, 234, 0.15);
    color: #fff;
}

.lang-menu .lang-option.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    color: #fff;
}

.lang-flag {
    font-size: 18px;
    line-height: 1;
}

.lang-name {
    flex: 1;
}

.lang-option .check-icon {
    width: 14px;
    height: 14px;
    opacity: 0;
    color: #667eea;
    transition: opacity 0.15s ease;
}

.lang-option.active .check-icon {
    opacity: 1;
}

/* =====================================================
   Mobile responsive
   ===================================================== */

@media (max-width: 768px) {
    .sidebar-lang-switcher {
        padding: 6px 8px;
        margin: 6px 8px;
    }

    .sidebar-lang-switcher .lang-option {
        padding: 6px 8px;
        font-size: 12px;
    }

    .lang-toggle {
        padding: 6px 10px;
        font-size: 12px;
    }
}
