/* ============================================================
   MUHB Translate — Widget Styles v2
   ============================================================ */

/* ------------------------------------------------------------------
   Hide the default Google Translate bar
------------------------------------------------------------------ */
.goog-te-banner-frame,
.goog-te-balloon-frame,
body > .skiptranslate {
    display: none !important;
}

body {
    top: 0 !important;
}

/* ------------------------------------------------------------------
   Desktop trigger button (inside .top-bar-right)
   Hidden on mobile — the FAB takes over.
------------------------------------------------------------------ */
#muhb-translate-trigger-desktop {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 6px;
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

#muhb-translate-trigger-desktop:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.45);
    transform: translateY(-1px);
}

#muhb-translate-trigger-desktop svg {
    flex-shrink: 0;
}

.muhb-btn-label {
    /* text label inside the desktop button */
}

.muhb-lang-badge {
    display: inline-block;
    background: rgba(212, 175, 55, 0.35);
    border: 1px solid rgba(212, 175, 55, 0.55);
    border-radius: 4px;
    padding: 0 5px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #f5e08a;
    line-height: 1.5;
    transition: all 0.2s ease;
}

@media (max-width: 768px) {
    #muhb-translate-trigger-desktop {
        display: none !important;
    }
}

/* ------------------------------------------------------------------
   DESKTOP dropdown panel
------------------------------------------------------------------ */
.muhb-translate-panel {
    position: fixed;
    z-index: 100001;
    width: 260px;
    background: linear-gradient(160deg, rgba(30, 68, 31, 0.99) 0%, rgba(44, 95, 45, 0.99) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.97);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
    pointer-events: none;
}

.muhb-translate-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

@media (max-width: 768px) {
    .muhb-translate-panel {
        display: none !important;
    }
}

/* Panel header */
.muhb-translate-panel-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0.35rem;
}

.muhb-translate-panel-header svg {
    stroke: rgba(255, 255, 255, 0.55);
    fill: none;
    flex-shrink: 0;
}

.muhb-translate-panel-header span {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
}

/* ------------------------------------------------------------------
   Shared: language option rows
------------------------------------------------------------------ */
.muhb-lang-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 9px;
    cursor: pointer;
    transition: background 0.18s ease;
    position: relative;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
}

.muhb-lang-option:hover,
.muhb-lang-option:active {
    background: rgba(255, 255, 255, 0.1);
}

.muhb-lang-option.muhb-active {
    background: rgba(212, 175, 55, 0.18);
}

.muhb-lang-option.muhb-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 3px;
    background: linear-gradient(180deg, #d4af37, #b8962e);
    border-radius: 0 3px 3px 0;
}

.muhb-lang-flag {
    font-size: 1.15rem;
    line-height: 1;
    flex-shrink: 0;
    width: 22px;
    text-align: center;
}

.muhb-lang-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.muhb-lang-native {
    font-size: 0.88rem;
    font-weight: 600;
    color: white;
    line-height: 1.2;
}

.muhb-lang-english {
    font-size: 0.72rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 1px;
}

.muhb-lang-check {
    stroke: #d4af37;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0;
    flex-shrink: 0;
    transition: opacity 0.15s ease;
}

.muhb-lang-option.muhb-active .muhb-lang-check {
    opacity: 1;
}

/* ------------------------------------------------------------------
   MOBILE: Floating Action Button (FAB)
   Injected by the plugin — visible only on mobile.
   Positioned bottom-right, above any fixed footer bars.
------------------------------------------------------------------ */
.muhb-translate-fab {
    display: none; /* hidden by default; shown only on mobile via media query */
    position: fixed;
    bottom: 24px;
    right: 20px;
    z-index: 99999;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2c5f2d 0%, #97BC62 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(44, 95, 45, 0.5);
    color: white;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    /* relative so the badge can be positioned */
    position: fixed;
}

.muhb-translate-fab:active {
    transform: scale(0.93);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
}

.muhb-translate-fab svg {
    flex-shrink: 0;
}

/* Language badge on the FAB (shown when non-English is active) */
.muhb-fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #d4af37;
    color: #1a1a1a;
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    border-radius: 4px;
    padding: 1px 4px;
    line-height: 1.4;
    border: 1.5px solid white;
}

@media (max-width: 768px) {
    .muhb-translate-fab {
        display: flex;
    }
}

/* ------------------------------------------------------------------
   MOBILE: fullscreen overlay
------------------------------------------------------------------ */
.muhb-translate-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 300000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.muhb-translate-overlay.open {
    display: block;
    opacity: 1;
}

/* ------------------------------------------------------------------
   MOBILE: bottom sheet
   Slides up from off-screen — no positioning math needed.
------------------------------------------------------------------ */
.muhb-translate-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 300001;
    background: linear-gradient(180deg, rgba(44, 95, 45, 0.99) 0%, rgba(30, 68, 31, 0.99) 100%);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.muhb-translate-sheet.open {
    transform: translateY(0);
}

/* Drag handle pill */
.muhb-translate-sheet-handle {
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    margin: 12px auto 0;
}

/* Sheet header row */
.muhb-translate-sheet-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 1.25rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.muhb-translate-sheet-header svg {
    stroke: rgba(255, 255, 255, 0.6);
    fill: none;
    flex-shrink: 0;
}

.muhb-translate-sheet-header span {
    flex: 1;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}

.muhb-translate-sheet-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s ease;
}

.muhb-translate-sheet-close:active {
    background: rgba(255, 255, 255, 0.2);
}

.muhb-translate-sheet-close svg {
    stroke: white;
    fill: none;
}

/* Sheet language list */
.muhb-translate-sheet-body {
    padding: 0.5rem 0.75rem 1rem;
}

/* Bigger tap targets inside the sheet */
.muhb-translate-sheet-body .muhb-lang-option {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    margin-bottom: 2px;
}

.muhb-translate-sheet-body .muhb-lang-flag {
    font-size: 1.4rem;
    width: 28px;
}

.muhb-translate-sheet-body .muhb-lang-native {
    font-size: 1rem;
}

.muhb-translate-sheet-body .muhb-lang-english {
    font-size: 0.78rem;
}

/* Prevent body scroll while sheet is open */
body.muhb-sheet-open {
    overflow: hidden;
}

/* ------------------------------------------------------------------
   RTL page adjustments
------------------------------------------------------------------ */
body.muhb-rtl-active {
    direction: rtl;
}

body.muhb-rtl-active .muhb-translate-panel,
body.muhb-rtl-active .muhb-translate-sheet {
    direction: ltr;
}

/* ------------------------------------------------------------------
   Suppress Google's own UI chrome
------------------------------------------------------------------ */
.goog-tooltip,
.goog-te-balloon-frame,
#goog-gt-tt {
    display: none !important;
}

.goog-text-highlight {
    background: none !important;
    box-shadow: none !important;
}
