/* ============================================================
   KCGF - LANGUAGE SWITCHER STYLES
   Krishna Chandra Gandhi Foundation
   A Unit of Purvottar Janajati Shiksha Samiti

   Developer: AV Web Solutions
   Website: https://avwebx.com
============================================================ */

/* ------------------------------------------------------------
   1. LANGUAGE DESIGN VARIABLES
------------------------------------------------------------ */

:root {
    --lang-primary: #075E4D;
    --lang-primary-light: #0B8068;
    --lang-orange: #FF8A24;
    --lang-teal: #27B6B1;

    --lang-text: #263B35;
    --lang-muted: #82918B;

    --lang-white: #FFFFFF;
    --lang-cream: #F7F0DC;

    --lang-border: rgba(7, 94, 77, 0.12);

    --lang-glass: rgba(255, 255, 255, 0.88);

    --lang-shadow:
        0 12px 35px rgba(26, 67, 54, 0.12),
        0 3px 10px rgba(26, 67, 54, 0.06);

    --lang-transition: 250ms cubic-bezier(0.2, 0.8, 0.2, 1);
}


/* ------------------------------------------------------------
   2. MAIN LANGUAGE SWITCHER
------------------------------------------------------------ */

.kcgf-language-switcher {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 1005;
    font-family: inherit;
}


/* ------------------------------------------------------------
   3. LANGUAGE TRIGGER BUTTON
------------------------------------------------------------ */

.kcgf-language-trigger {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    min-height: 44px;
    padding: 9px 15px;

    border: 1px solid var(--lang-border);
    border-radius: 50px;

    background: var(--lang-glass);
    color: var(--lang-primary);

    font-family: inherit;
    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

    box-shadow:
        0 4px 12px rgba(7, 94, 77, 0.06),
        inset 0 1px 0 rgba(255,255,255,0.8);

    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);

    transition:
        color var(--lang-transition),
        background var(--lang-transition),
        border-color var(--lang-transition),
        box-shadow var(--lang-transition),
        transform var(--lang-transition);
}

.kcgf-language-trigger:hover {
    color: var(--lang-white);
    background: var(--lang-primary);

    border-color: var(--lang-primary);

    box-shadow:
        0 8px 22px rgba(7, 94, 77, 0.22),
        0 0 0 4px rgba(39, 182, 177, 0.10);

    transform: translateY(-2px);
}

.kcgf-language-trigger:active {
    transform: scale(0.97);
}


/* ------------------------------------------------------------
   4. GLOBE ICON
------------------------------------------------------------ */

.kcgf-language-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 20px;
    height: 20px;

    font-size: 16px;

    transition:
        transform 400ms ease,
        color var(--lang-transition);
}

.kcgf-language-trigger:hover .kcgf-language-icon {
    color: var(--lang-orange);
    transform: rotate(35deg);
}


/* ------------------------------------------------------------
   5. CURRENT LANGUAGE TEXT
------------------------------------------------------------ */

.kcgf-language-current {
    white-space: nowrap;
    letter-spacing: 0.1px;
}


/* ------------------------------------------------------------
   6. DROPDOWN ARROW
------------------------------------------------------------ */

.kcgf-language-arrow {
    font-size: 10px;

    transition:
        transform 300ms ease,
        color var(--lang-transition);
}

.kcgf-language-switcher.is-open
.kcgf-language-arrow {
    transform: rotate(180deg);
}


/* ------------------------------------------------------------
   7. DROPDOWN MENU
------------------------------------------------------------ */

.kcgf-language-menu {
    position: absolute;

    top: calc(100% + 12px);
    right: 0;

    width: 190px;
    padding: 7px;

    display: flex;
    flex-direction: column;
    gap: 4px;

    background: rgba(255, 255, 255, 0.94);

    border: 1px solid rgba(255,255,255,0.8);
    border-radius: 18px;

    box-shadow: var(--lang-shadow);

    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);

    transform-origin: top right;

    z-index: 1006;
}

/* The JS controls hidden state and animation class. */

.kcgf-language-menu[hidden] {
    display: none !important;
}

.kcgf-language-switcher.is-open
.kcgf-language-menu:not([hidden]) {
    animation: kcgfLanguageOpen 300ms cubic-bezier(
        0.16, 1, 0.3, 1
    ) both;
}


/* ------------------------------------------------------------
   8. DROPDOWN OPEN ANIMATION
------------------------------------------------------------ */

@keyframes kcgfLanguageOpen {

    from {
        opacity: 0;
        transform: translateY(-9px) scale(0.94);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

}


/* ------------------------------------------------------------
   9. LANGUAGE OPTIONS
------------------------------------------------------------ */

.kcgf-language-option {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    width: 100%;
    min-height: 52px;

    padding: 9px 12px;

    border-radius: 12px;

    color: var(--lang-text);
    text-decoration: none;

    transition:
        background var(--lang-transition),
        color var(--lang-transition),
        transform var(--lang-transition),
        box-shadow var(--lang-transition);
}

.kcgf-language-option:hover {
    background: rgba(39, 182, 177, 0.12);

    color: var(--lang-primary);

    transform: translateX(3px);
}

.kcgf-language-option.active {
    background:
        linear-gradient(
            110deg,
            rgba(7, 94, 77, 0.10),
            rgba(39, 182, 177, 0.12)
        );

    color: var(--lang-primary);
}


/* ------------------------------------------------------------
   10. LANGUAGE OPTION TEXT
------------------------------------------------------------ */

.kcgf-language-option-name {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.kcgf-language-native {
    font-size: 14px;
    font-weight: 700;
}

.kcgf-language-english {
    font-size: 10px;
    color: var(--lang-muted);
    font-weight: 500;
}

.kcgf-language-option > i {
    font-size: 12px;
    color: var(--lang-primary-light);
}


/* ------------------------------------------------------------
   11. BUTTON LANGUAGE SWITCHER
------------------------------------------------------------ */

.kcgf-language-buttons {
    display: inline-flex;
    align-items: center;
    gap: 3px;

    padding: 4px;

    background: rgba(7, 94, 77, 0.06);

    border: 1px solid var(--lang-border);
    border-radius: 50px;
}

.kcgf-language-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 39px;
    min-height: 33px;

    padding: 5px 11px;

    border-radius: 50px;

    color: var(--lang-muted);

    font-size: 11px;
    font-weight: 700;

    text-decoration: none;

    transition: all var(--lang-transition);
}

.kcgf-language-btn:hover {
    background: rgba(255, 138, 36, 0.14);
    color: var(--lang-primary);
}

.kcgf-language-btn.active {
    background: var(--lang-primary);
    color: var(--lang-white);

    box-shadow: 0 3px 10px rgba(7, 94, 77, 0.2);
}


/* ------------------------------------------------------------
   12. KEYBOARD ACCESSIBILITY
------------------------------------------------------------ */

.kcgf-language-trigger:focus-visible,
.kcgf-language-option:focus-visible,
.kcgf-language-btn:focus-visible {
    outline: 3px solid var(--lang-orange);
    outline-offset: 3px;
}


/* ------------------------------------------------------------
   13. HINDI FONT SUPPORT
------------------------------------------------------------ */

.lang-hi .kcgf-language-switcher {
    font-family:
        "Noto Sans Devanagari",
        "Nirmala UI",
        sans-serif;
}

.font-hindi .kcgf-language-switcher {
    font-family:
        "Noto Sans Devanagari",
        "Nirmala UI",
        sans-serif;
}


/* ------------------------------------------------------------
   14. DARK MODE SUPPORT
------------------------------------------------------------ */

[data-theme="dark"] .kcgf-language-trigger {
    background: rgba(24, 43, 38, 0.88);

    color: #E6F3ED;

    border-color: rgba(255,255,255,0.12);
}

[data-theme="dark"] .kcgf-language-trigger:hover {
    background: var(--lang-primary-light);
    color: #FFFFFF;
}

[data-theme="dark"] .kcgf-language-menu {
    background: rgba(24, 43, 38, 0.96);

    border-color: rgba(255,255,255,0.10);

    box-shadow:
        0 15px 40px rgba(0,0,0,0.35);
}

[data-theme="dark"] .kcgf-language-option {
    color: #E5F0EB;
}

[data-theme="dark"] .kcgf-language-option:hover {
    background: rgba(39, 182, 177, 0.16);
}

[data-theme="dark"] .kcgf-language-option.active {
    background: rgba(39, 182, 177, 0.20);
}

[data-theme="dark"] .kcgf-language-english {
    color: #A5B9B0;
}

[data-theme="dark"] .kcgf-language-buttons {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.12);
}


/* ------------------------------------------------------------
   15. TABLET RESPONSIVE
------------------------------------------------------------ */

@media (max-width: 991px) {

    .kcgf-language-trigger {
        min-height: 42px;
        padding: 8px 12px;
    }

    .kcgf-language-menu {
        width: 180px;
    }

}


/* ------------------------------------------------------------
   16. MOBILE RESPONSIVE
------------------------------------------------------------ */

@media (max-width: 576px) {

    .kcgf-language-trigger {
        min-height: 40px;
        padding: 8px 11px;

        gap: 7px;

        font-size: 12px;
    }

    .kcgf-language-icon {
        font-size: 14px;
    }

    .kcgf-language-menu {
        top: calc(100% + 9px);
        right: 0;

        width: 170px;

        border-radius: 15px;
    }

    .kcgf-language-option {
        min-height: 48px;
    }

    .kcgf-language-native {
        font-size: 13px;
    }

}


/* ------------------------------------------------------------
   17. REDUCED MOTION ACCESSIBILITY
------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {

    .kcgf-language-switcher *,
    .kcgf-language-switcher *::before,
    .kcgf-language-switcher *::after {

        animation-duration: 0.01ms !important;

        animation-iteration-count: 1 !important;

        transition-duration: 0.01ms !important;

        scroll-behavior: auto !important;
    }

}


/* ============================================================
   END KCGF LANGUAGE CSS
============================================================ */
