/* =========================================================
   BHASHINI V3 — PNB THEME
   ========================================================= */

html body > #bhashini-plugin-container.bhashini-plugin-container {
    position: fixed !important;
    top: 16px !important;
    left: 16px !important;
    right: auto !important;
    bottom: auto !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 2147483647 !important;
}

/* Override left and bottom values applied by the vendor script */
html body #bhashini-translation.bhashini-dropdown {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    display: block !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Main language selector */
html body #bhashini-translation .bhashini-dropdown-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    width: auto !important;
    min-width: 150px !important;
    max-width: 220px !important;
    height: 46px !important;
    min-height: 46px !important;
    margin: 0 !important;
    padding: 7px 13px !important;
    overflow: visible !important;
    color: #ffffff !important;
    background: linear-gradient(135deg, #a20c33 0%, #7a001f 100%) !important;
    border: 1px solid #f4c542 !important;
    border-radius: 9px !important;
    box-shadow: 0 4px 14px rgba(122, 0, 31, 0.34) !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 14px !important;
    cursor: pointer !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease !important;
}

html body #bhashini-translation .bhashini-dropdown-btn:hover {
    background: linear-gradient(135deg, #b5123d 0%, #890027 100%) !important;
    box-shadow: 0 6px 18px rgba(122, 0, 31, 0.42) !important;
    transform: translateY(-1px) !important;
}

html body #bhashini-translation .bhashini-dropdown-btn:active {
    background: #7a001f !important;
    box-shadow: 0 3px 8px rgba(122, 0, 31, 0.32) !important;
    transform: translateY(0) !important;
}

html body #bhashini-translation .bhashini-dropdown-btn:focus-visible {
    outline: 3px solid #f4c542 !important;
    outline-offset: 3px !important;
}

/* Translation icon and current language */
html body #bhashini-translation .bhashini-dropdown-btn-icon {
    display: flex !important;
    flex: 1 1 auto !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
}

html body #bhashini-translation .bhashini-dropdown-btn-icon > svg {
    display: block !important;
    visibility: visible !important;
    flex: 0 0 28px !important;
    width: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    height: 28px !important;
}

html body #bhashini-translation .bhashini-dropdown-btn-icon > svg path {
    fill: #ffffff !important;
}

/* Current language added by bhashini-enhancer.js */
html body #bhashini-translation p.bhashini-dropdown-btn-text {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 60px !important;
    max-width: 115px !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    color: #ffffff !important;
    background: transparent !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 14px !important;
    font-style: normal !important;
    font-weight: 600 !important;
    line-height: 20px !important;
    letter-spacing: 0 !important;
    text-align: left !important;
    text-indent: 0 !important;
    text-overflow: ellipsis !important;
    text-transform: none !important;
    white-space: nowrap !important;
    clip: auto !important;
    clip-path: none !important;
    transform: none !important;
}

/* Arrow added by bhashini-enhancer.js */
html body #bhashini-translation .bhashini-custom-arrow {
    display: block !important;
    visibility: visible !important;
    flex: 0 0 18px !important;
    width: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    transition: transform 0.2s ease !important;
}

html body #bhashini-translation .bhashini-custom-arrow path {
    fill: #ffffff !important;
}

html body #bhashini-translation .bhashini-dropdown-btn[aria-expanded="true"] .bhashini-custom-arrow {
    transform: rotate(180deg) !important;
}

/* Language dropdown */
html body #bhashini-translation .bhashini-dropdown-content {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    left: 0 !important;
    right: auto !important;
    bottom: auto !important;
    width: 290px !important;
    max-width: calc(100vw - 32px) !important;
    max-height: calc(100vh - 90px) !important;
    margin: 0 !important;
    padding: 6px 0 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    background: rgba(255, 255, 255, 0.98) !important;
    border: 1px solid #e2c36b !important;
    border-top: 4px solid #8b0026 !important;
    border-radius: 9px !important;
    box-shadow: 0 12px 30px rgba(122, 0, 31, 0.24) !important;
    z-index: 2147483647 !important;
}

/* V3 uses LI elements for language options */
html body #bhashini-translation .bhashini-dropdown-content li.language-option {
    display: flex !important;
    align-items: center !important;
    min-height: 42px !important;
    margin: 0 6px !important;
    padding: 9px 14px !important;
    color: #2c1b1f !important;
    background: #ffffff !important;
    border-radius: 6px !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 14px !important;
    line-height: 1.35 !important;
    list-style: none !important;
    cursor: pointer !important;
    transition: color 0.15s ease, background-color 0.15s ease !important;
}

html body #bhashini-translation .bhashini-dropdown-content li.language-option:hover,
html body #bhashini-translation .bhashini-dropdown-content li.language-option:focus,
html body #bhashini-translation .bhashini-dropdown-content li.language-option:focus-visible {
    color: #ffffff !important;
    background: #8b0026 !important;
    outline: 2px solid #f4c542 !important;
    outline-offset: -2px !important;
}

html body #bhashini-translation .bhashini-dropdown-content li.language-option[aria-selected="true"] {
    color: #ffffff !important;
    background: linear-gradient(135deg, #a20c33 0%, #7a001f 100%) !important;
    font-weight: 700 !important;
}

/* Powered-by footer */
html body #bhashini-translation .bhashini-branding {
    position: sticky !important;
    bottom: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 7px !important;
    min-height: 45px !important;
    margin-top: 6px !important;
    padding: 8px 12px !important;
    color: #6f4b20 !important;
    background: #fff9e8 !important;
    border-top: 1px solid #ecd58c !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 11px !important;
}

html body #bhashini-translation .bhashini-branding a {
    display: inline-flex !important;
    align-items: center !important;
}

html body #bhashini-translation .bhashini-branding a img {
    width: auto !important;
    max-width: 82px !important;
    height: 22px !important;
    object-fit: contain !important;
}

/* Feedback button */
html body #bhashini-translation .bhashini-feedback-button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 30px !important;
    height: 30px !important;
    margin: 0 !important;
    padding: 4px !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 50% !important;
    cursor: pointer !important;
}

html body #bhashini-translation .bhashini-feedback-button:hover {
    background: #f8e8b4 !important;
}

html body #bhashini-translation .bhashini-feedback-button img {
    width: 20px !important;
    height: 20px !important;
}

/* Dropdown scrollbar */
html body #bhashini-translation .bhashini-dropdown-content::-webkit-scrollbar {
    width: 7px !important;
}

html body #bhashini-translation .bhashini-dropdown-content::-webkit-scrollbar-track {
    background: #f4f4f4 !important;
}

html body #bhashini-translation .bhashini-dropdown-content::-webkit-scrollbar-thumb {
    background: #a20c33 !important;
    border-radius: 10px !important;
}

html body #bhashini-translation .bhashini-dropdown-content::-webkit-scrollbar-thumb:hover {
    background: #7a001f !important;
}

/* Keep feedback modal over the application */
html body .bhashini-feedback-modal {
    z-index: 2147483647 !important;
}

/* Mobile */
@media (max-width: 576px) {
    html body > #bhashini-plugin-container.bhashini-plugin-container {
        top: 10px !important;
        left: 10px !important;
    }

    html body #bhashini-translation .bhashini-dropdown-btn {
        min-width: 138px !important;
        max-width: 190px !important;
        height: 42px !important;
        min-height: 42px !important;
        padding: 6px 10px !important;
    }

    html body #bhashini-translation .bhashini-dropdown-btn-icon > svg {
        flex-basis: 25px !important;
        width: 25px !important;
        min-width: 25px !important;
        max-width: 25px !important;
        height: 25px !important;
    }

    html body #bhashini-translation p.bhashini-dropdown-btn-text {
        min-width: 55px !important;
        max-width: 95px !important;
        font-size: 13px !important;
    }

    html body #bhashini-translation .bhashini-dropdown-content {
        width: min(290px, calc(100vw - 20px)) !important;
        max-width: calc(100vw - 20px) !important;
        max-height: calc(100vh - 70px) !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    html body #bhashini-translation .bhashini-dropdown-btn,
    html body #bhashini-translation .bhashini-custom-arrow,
    html body #bhashini-translation .language-option {
        transition: none !important;
    }
}

/* BHASHINI: top-right, immediately before Logout */
html body #bhashini-translation.bhashini-dropdown {
    position: fixed !important;
    top: 9px !important;

    /* Leave space for the Logout button */
    right: 120px !important;

    left: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    z-index: 2147483647 !important;
}

/* Open dropdown toward the left to prevent screen overflow */
html body #bhashini-translation .bhashini-dropdown-content {
    top: calc(100% + 8px) !important;
    right: 0 !important;
    left: auto !important;
    bottom: auto !important;
}

/* Mobile positioning */
@media (max-width: 576px) {
    html body #bhashini-translation.bhashini-dropdown {
        top: 10px !important;
        right: 68px !important;
        left: auto !important;
        bottom: auto !important;
    }

    html body #bhashini-translation .bhashini-dropdown-content {
        right: 0 !important;
        left: auto !important;
    }
}