/* ==========================================================================
   JBI Digital - Bahasa Isyarat Indonesia (BISINDO) Widget
   Unit Layanan Disabilitas (ULD) Universitas Ma Chung
   Ramah Teman Tuli (Deaf) & Teman Wicara (Mute)
   ========================================================================== */

/* Floating JBI Quick Access Button (Bottom Left) */
.floating-bisindo-btn {
    position: fixed;
    bottom: 25px;
    left: 25px;
    z-index: 1045;
    background: linear-gradient(135deg, #0b2f64 0%, #1e40af 100%);
    color: #ffffff;
    border: 2px solid #38bdf8;
    border-radius: 50px;
    padding: 10px 18px;
    font-size: 0.88rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(11, 47, 100, 0.35);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.floating-bisindo-btn:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 28px rgba(11, 47, 100, 0.45);
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
    color: #ffffff;
    border-color: #facc15;
}

.floating-bisindo-btn .bisindo-pulse-badge {
    width: 10px;
    height: 10px;
    background-color: #22c55e;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 rgba(34, 197, 94, 0.7);
    animation: bisindoPulse 1.8s infinite;
}

@keyframes bisindoPulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* JBI Floating Dock Window */
#bisindo-dock {
    position: fixed;
    bottom: 85px;
    left: 25px;
    width: 380px;
    max-width: calc(100vw - 40px);
    background: #0f172a;
    color: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.1);
    z-index: 1050;
    overflow: hidden;
    display: none;
    flex-direction: column;
    animation: bisindoSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    border: 2px solid #3b82f6;
}

#bisindo-dock.active {
    display: flex;
}

@keyframes bisindoSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Dock Header */
.bisindo-dock-header {
    background: linear-gradient(135deg, #071e42 0%, #0b2f64 100%);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bisindo-dock-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bisindo-dock-title h6 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.bisindo-dock-title small {
    font-size: 0.72rem;
    color: #38bdf8;
    display: block;
    font-weight: 600;
}

.bisindo-dock-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bisindo-control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #ffffff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bisindo-control-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #facc15;
}

/* Dock Stage (Avatar & Gesture Display) */
.bisindo-stage {
    position: relative;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
    height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Avatar Graphic & Animation */
.bisindo-avatar-container {
    position: relative;
    width: 140px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bisindo-avatar-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.3));
}

/* Active Hand Movement Indicator */
.bisindo-gesture-highlight {
    position: absolute;
    bottom: 5px;
    right: 12px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid #38bdf8;
    border-radius: 12px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    z-index: 5;
}

.bisindo-gesture-icon {
    font-size: 1.5rem;
    line-height: 1;
    color: #facc15;
}

.bisindo-gesture-meta {
    line-height: 1.2;
}

.bisindo-gesture-meta .badge-bisindo {
    font-size: 0.65rem;
    font-weight: 700;
    color: #38bdf8;
    text-transform: uppercase;
}

.bisindo-gesture-meta .sign-term {
    font-size: 0.85rem;
    font-weight: 800;
    color: #ffffff;
    display: block;
}

/* Live Caption & Current Word/Letter */
.bisindo-caption-bar {
    background: #090d16;
    padding: 10px 16px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.bisindo-caption-text {
    font-size: 0.95rem;
    font-weight: 700;
    color: #facc15;
    margin-bottom: 2px;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.bisindo-spelling-strip {
    font-size: 0.75rem;
    color: #94a3b8;
    letter-spacing: 0.15em;
    font-family: monospace;
    text-transform: uppercase;
    min-height: 16px;
}

.bisindo-spelling-strip span.active-char {
    color: #38bdf8;
    font-weight: 800;
    text-decoration: underline;
    font-size: 0.85rem;
}

/* Quick Dictionary Pills */
.bisindo-quick-pills {
    padding: 10px 14px;
    background: #111827;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 95px;
    overflow-y: auto;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.bisindo-pill {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.bisindo-pill:hover,
.bisindo-pill.active {
    background: #0b2f64;
    border-color: #38bdf8;
    color: #ffffff;
    transform: translateY(-1px);
}

/* Custom Text Input Bar */
.bisindo-input-bar {
    padding: 10px 14px;
    background: #0f172a;
    display: flex;
    gap: 8px;
}

.bisindo-input-field {
    flex-grow: 1;
    background: #1e293b;
    border: 1px solid #334155;
    color: #ffffff;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.82rem;
}

.bisindo-input-field:focus {
    outline: none;
    border-color: #38bdf8;
    background: #0f172a;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.bisindo-btn-play {
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.bisindo-btn-play:hover {
    background: #1d4ed8;
}

/* Playback & Speed Toolbar */
.bisindo-dock-footer {
    padding: 8px 14px;
    background: #090d16;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
}

.bisindo-speed-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.bisindo-speed-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #94a3b8;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bisindo-speed-btn.active,
.bisindo-speed-btn:hover {
    background: #38bdf8;
    color: #0f172a;
    border-color: #38bdf8;
}

/* In-Page Triggers ("Terjemahkan ke Isyarat") */
.btn-sign-snippet {
    background: rgba(14, 165, 233, 0.1);
    color: #0284c7;
    border: 1px solid rgba(14, 165, 233, 0.3);
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 20px;
    padding: 2px 9px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    vertical-align: middle;
}

.btn-sign-snippet:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
    transform: translateY(-1px);
}

/* Responsive adjustment for mobile */
@media (max-width: 576px) {
    #bisindo-dock {
        left: 10px;
        right: 10px;
        width: auto;
        bottom: 80px;
    }
    .floating-bisindo-btn {
        bottom: 20px;
        left: 15px;
        padding: 8px 14px;
        font-size: 0.8rem;
    }
}
