/**
 * Language Toggle Styles
 * CSS for the i18n language switcher widget.
 * Includes standard, dark-theme, glassmorphism, and fixed variants.
 *
 * @version 2.0
 * @see js/core/i18n-manager.js
 */

/* ── Language Toggle Button (Base) ─────────────── */

.i18n-lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px solid var(--color-border, #ddd);
    border-radius: var(--radius-md, 8px);
    background: var(--color-surface, #fff);
    color: var(--color-text, #2c3e50);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
    white-space: nowrap;
    line-height: 1;
}

.i18n-lang-toggle:hover,
.i18n-lang-toggle:focus-visible {
    background: var(--color-bg-light, #f8f9fa);
    border-color: var(--color-primary, #3498db);
    outline: none;
}

/* ── Landing Page variant (dark background) ────── */

.landing-page .i18n-lang-toggle,
.starfield-bg .i18n-lang-toggle {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    color: var(--color-text-inverse, #fff);
}

.landing-page .i18n-lang-toggle:hover,
.starfield-bg .i18n-lang-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* ── Fixed position variant (top-right corner) ─── */

.i18n-lang-toggle--fixed {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1000;
}

/* ── Inline Navigation variant ─────────────────── */

.page-nav .i18n-lang-toggle,
.landing-footer .i18n-lang-toggle {
    font-size: 0.8rem;
    padding: 4px 10px;
}

/* ═══════════════════════════════════════════════════
   GLASSMORPHISM VARIANT  (.i18n-lang-toggle--glass)
   Compact, translucent toggle for dark-themed pages
   (Universe Map, AIverse-theme pages).
   ═══════════════════════════════════════════════════ */

.i18n-lang-toggle--glass {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 9999;
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    background: rgba(20, 18, 40, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.06);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
    font-family: 'Inter', 'SF Pro', system-ui, sans-serif;
    overflow: hidden;
}

.i18n-lang-toggle--glass:hover {
    border-color: rgba(0, 229, 255, 0.35);
    box-shadow: 0 2px 16px rgba(0, 229, 255, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    background: rgba(20, 18, 40, 0.75);
}

.i18n-lang-toggle--glass:focus-visible {
    outline: 2px solid rgba(0, 229, 255, 0.5);
    outline-offset: 2px;
}

/* ── Glass toggle segments ─────────────────────── */

.i18n-lang-toggle--glass .lang-seg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.2s, background 0.2s;
    min-width: 28px;
    text-align: center;
}

.i18n-lang-toggle--glass .lang-seg--active {
    color: #00e5ff;
    background: rgba(0, 229, 255, 0.1);
}

.i18n-lang-toggle--glass .lang-divider {
    width: 1px;
    height: 16px;
    background: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

/* ── Globe icon for glass variant ──────────────── */

.i18n-lang-toggle--glass .lang-globe {
    display: inline-flex;
    align-items: center;
    padding: 7px 6px 7px 10px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.85rem;
    transition: color 0.2s;
}

.i18n-lang-toggle--glass:hover .lang-globe {
    color: rgba(255, 255, 255, 0.6);
}

/* ── Responsive: hide on very small screens ────── */

@media (max-width: 480px) {
    .i18n-lang-toggle--glass {
        top: 8px;
        right: 8px;
        font-size: 0.7rem;
    }
    .i18n-lang-toggle--glass .lang-seg {
        padding: 6px 8px;
        min-width: 24px;
    }
    .i18n-lang-toggle--glass .lang-globe {
        padding: 6px 4px 6px 8px;
    }
}
