/* Monitoro.NET - i18n language switcher styles */
.i18n-switcher {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(6px);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.i18n-switcher-btn {
    appearance: none;
    border: none;
    background: transparent;
    color: #555;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.i18n-switcher-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #000;
}

.i18n-switcher-btn.active {
    background: #000;
    color: #fff;
}

/* When mounted inside a dark sidebar (app.html) */
.sidebar .i18n-switcher,
.i18n-switcher.dark {
    position: static;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: none;
    margin: 12px 16px;
    align-self: flex-start;
}

.sidebar .i18n-switcher-btn,
.i18n-switcher.dark .i18n-switcher-btn {
    color: rgba(255, 255, 255, 0.7);
}

.sidebar .i18n-switcher-btn:hover,
.i18n-switcher.dark .i18n-switcher-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar .i18n-switcher-btn.active,
.i18n-switcher.dark .i18n-switcher-btn.active {
    background: #fff;
    color: #000;
}

/* =====================================================================
   Dropdown variant — used when there are more than 3 languages.
   Renders as a compact trigger ("🌐 EN ▾") with a popout panel.
   ===================================================================== */
.i18n-switcher-dropdown {
    position: relative;
    /* Override the fixed top-right styling above — when used inline in
       a navbar we want it to flow normally. */
    position: relative !important;
    top: auto !important;
    right: auto !important;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    backdrop-filter: none;
}

.i18n-switcher-trigger {
    appearance: none;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all .15s ease;
}
.i18n-switcher-trigger:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.2);
    color: #0f172a;
}
.i18n-flag { font-size: 14px; opacity: 0.7; }
.i18n-current { letter-spacing: 0.5px; }
.i18n-caret { font-size: 10px; opacity: 0.6; transition: transform .15s; }
.i18n-switcher-dropdown.is-open .i18n-caret { transform: rotate(180deg); }

.i18n-switcher-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 200px;
    max-height: 360px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    box-shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.18);
    padding: 6px;
    display: none;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.i18n-switcher-dropdown.is-open .i18n-switcher-panel { display: block; }

.i18n-switcher-option {
    appearance: none;
    background: transparent;
    border: none;
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: inherit;
    font-size: 14px;
    text-align: left;
    color: #334155;
    transition: background .12s;
}
.i18n-switcher-option:hover { background: rgba(15, 23, 42, 0.05); color: #0f172a; }
.i18n-switcher-option.active { background: #0f172a; color: #fff; }
.i18n-switcher-option.active:hover { background: #1e293b; }
.i18n-option-code {
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.5px;
    min-width: 28px;
    opacity: 0.7;
}
.i18n-switcher-option.active .i18n-option-code { opacity: 1; }
.i18n-option-name { font-weight: 500; }

/* Dark sidebar variant for dropdown */
.sidebar .i18n-switcher-dropdown .i18n-switcher-trigger {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.85);
}
.sidebar .i18n-switcher-dropdown .i18n-switcher-trigger:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}
