/* ==========================================================================
   KARAMA GLOBAL · Premium Weglot switcher
   Weglot remains the translation engine. This file controls presentation only.
   ========================================================================== */

:root {
    --kg-navy: #172b57;
    --kg-navy-deep: #0a1730;
    --kg-red: #d5232a;
    --kg-red-deep: #951824;
    --kg-white: #ffffff;
    --kg-muted: #7f8aa0;
    --kg-line: rgba(23, 43, 87, .12);
    --kg-shadow: 0 22px 55px rgba(7, 18, 38, .2);
}

aside.weglot-default,
.weglot-container {
    display: none !important;
}

.kg-host {
    position: relative;
    z-index: 90;
    font-family: "IBM Plex Sans Arabic", "Inter", Arial, sans-serif;
}

.kg-host--header {
    display: flex;
    align-items: center;
}

.kg-switcher {
    position: relative;
}

.kg-trigger,
.kg-fallback {
    min-width: 142px;
    height: 44px;
    padding: 0 12px 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 999px;
    color: #fff;
    background:
        linear-gradient(145deg, var(--kg-navy), var(--kg-navy-deep));
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.07),
        0 10px 24px rgba(7,18,38,.16);
    font: inherit;
    cursor: pointer;
    transition:
        transform .2s ease,
        box-shadow .2s ease,
        border-color .2s ease,
        background .2s ease;
}

.kg-trigger:hover,
.kg-trigger:focus-visible,
.kg-switcher.is-open .kg-trigger {
    transform: translateY(-1px);
    border-color: rgba(213,35,42,.58);
    background:
        linear-gradient(145deg, #203b74, var(--kg-navy-deep));
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.08),
        0 14px 30px rgba(7,18,38,.22);
    outline: none;
}

.kg-mark {
    width: 30px;
    height: 30px;
    position: relative;
    flex: 0 0 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background:
        radial-gradient(circle at 35% 25%, #ea4b50, var(--kg-red-deep) 74%);
    box-shadow:
        0 0 0 1px rgba(255,255,255,.12),
        0 7px 14px rgba(149,24,36,.24);
}

.kg-mark::after {
    content: "";
    width: 6px;
    height: 6px;
    position: absolute;
    top: -1px;
    inset-inline-end: -1px;
    border: 2px solid var(--kg-navy);
    border-radius: 50%;
    background: #ff4650;
}

.kg-globe {
    width: 17px;
    height: 17px;
}

.kg-trigger-copy {
    min-width: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px;
    align-items: center;
}

.kg-current-code {
    color: #ff9da4;
    font-family: "Inter", Arial, sans-serif;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .08em;
}

.kg-current-name {
    max-width: 80px;
    overflow: hidden;
    color: #fff;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 850;
}

.kg-chevron {
    width: 11px;
    height: 11px;
    flex: 0 0 11px;
    color: rgba(255,255,255,.62);
    transition: transform .2s ease;
}

.kg-switcher.is-open .kg-chevron {
    transform: rotate(180deg);
}

.kg-menu {
    width: 260px;
    max-height: min(440px, 70vh);
    overflow: auto;
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + 10px);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-7px) scale(.985);
    transform-origin: top right;
    border: 1px solid rgba(23,43,87,.12);
    border-radius: 16px;
    background: rgba(255,255,255,.985);
    box-shadow: var(--kg-shadow);
    transition:
        opacity .18s ease,
        visibility .18s ease,
        transform .18s ease;
}

.kg-switcher.is-open .kg-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.kg-menu-head {
    padding: 11px 10px 10px;
    border-bottom: 1px solid var(--kg-line);
}

.kg-menu-head strong,
.kg-menu-head span {
    display: block;
}

.kg-menu-head strong {
    color: var(--kg-navy);
    font-family: "Inter", sans-serif;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .12em;
}

.kg-menu-head span {
    margin-top: 3px;
    color: var(--kg-muted);
    font-size: 10px;
}

.kg-option {
    width: 100%;
    min-height: 48px;
    margin-top: 4px;
    padding: 7px 9px;
    display: grid;
    grid-template-columns: 38px 1fr 18px;
    gap: 8px;
    align-items: center;
    border: 0;
    border-radius: 11px;
    color: var(--kg-navy);
    background: transparent;
    cursor: pointer;
    font: inherit;
    text-align: start;
    transition: background .16s ease, color .16s ease;
}

.kg-option:hover,
.kg-option:focus-visible {
    background: #f3f6fa;
    outline: none;
}

.kg-option.is-current {
    color: var(--kg-red-deep);
    background: #fff0f1;
}

.kg-option-code {
    width: 34px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    background: var(--kg-navy);
    font-family: "Inter", Arial, sans-serif;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .05em;
}

.kg-option.is-current .kg-option-code {
    background: var(--kg-red-deep);
}

.kg-option-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 800;
}

.kg-option-check {
    width: 16px;
    height: 16px;
    opacity: 0;
}

.kg-option.is-current .kg-option-check {
    opacity: 1;
}

.kg-loading {
    min-width: 116px;
    height: 44px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid rgba(23,43,87,.11);
    border-radius: 999px;
    color: var(--kg-navy);
    background: #fff;
    box-shadow: 0 8px 18px rgba(7,18,38,.06);
    font-size: 10px;
    font-weight: 900;
}

.kg-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--kg-red);
    animation: kgPulse .85s infinite alternate;
}

.kg-fallback {
    min-width: 82px;
    cursor: default;
}

.kg-fallback .kg-current-code {
    color: #ffadb3;
}

.kg-host--standalone {
    position: fixed;
    z-index: 240;
    inset-inline-start: 16px;
    bottom: 18px;
}

.kg-host--standalone .kg-trigger,
.kg-host--standalone .kg-fallback {
    box-shadow: 0 17px 36px rgba(7,18,38,.28);
}

.kg-host--floating {
    display: none;
}

html[dir="ltr"] body {
    direction: ltr;
}

html[dir="rtl"] body {
    direction: rtl;
}

@keyframes kgPulse {
    from { opacity: .35; transform: scale(.78); }
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 900px) {
    .kg-host--header {
        display: none !important;
    }

    .kg-host--floating {
        display: block;
        position: fixed;
        z-index: 240;
        inset-inline-start: 14px;
        bottom: 18px;
    }

    .kg-host--floating .kg-trigger,
    .kg-host--floating .kg-fallback {
        min-width: 0;
        width: 52px;
        height: 52px;
        padding: 0;
        border-color: rgba(255,255,255,.16);
        box-shadow: 0 18px 38px rgba(7,18,38,.3);
    }

    .kg-host--floating .kg-mark {
        width: 35px;
        height: 35px;
        flex-basis: 35px;
    }

    .kg-host--floating .kg-globe {
        width: 19px;
        height: 19px;
    }

    .kg-host--floating .kg-trigger-copy,
    .kg-host--floating .kg-chevron,
    .kg-host--floating .kg-fallback > .kg-current-code {
        display: none;
    }

    .kg-host--floating .kg-menu {
        width: min(280px, calc(100vw - 28px));
        top: auto;
        bottom: calc(100% + 10px);
        inset-inline-start: 0;
        inset-inline-end: auto;
        transform-origin: bottom left;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kg-trigger,
    .kg-chevron,
    .kg-menu,
    .kg-dot {
        transition: none !important;
        animation: none !important;
    }
}


/* KARAMA GLOBAL ICON POLISH */
.kg-trigger,
.kg-fallback {
    min-width: 126px;
    height: 42px;
    border-color: rgba(255,255,255,.16);
    background: linear-gradient(145deg, rgba(255,255,255,.08), rgba(9,24,52,.92));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 22px rgba(0,0,0,.16);
}
.kg-mark {
    width: 31px;
    height: 31px;
    flex-basis: 31px;
    color: #ffffff;
    background: linear-gradient(145deg, #b71925, #7f101a);
    border: 1px solid rgba(255,255,255,.20);
    box-shadow: 0 7px 16px rgba(127,16,26,.28);
}
.kg-mark::after {
    width: 7px;
    height: 7px;
    top: -2px;
    inset-inline-end: -2px;
    border: 2px solid #102449;
    background: #ff3946;
}
.kg-current-code { color: #ffb1b7; }
.kg-current-name { font-size: 12px; }
.kg-trigger:hover,
.kg-trigger:focus-visible,
.kg-switcher.is-open .kg-trigger {
    border-color: rgba(183,25,37,.75);
    background: linear-gradient(145deg, #1d376c, #091834);
}
