/* ============================================
   EI Language Bar – Single compact widget
   Listen + Read in one bar. No clutter.
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,600;0,9..40,700&display=swap');

/* ── Container ──────────────────────────────── */
.eilb {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0 0 24px;
    border-radius: 14px;
    background: #111827;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    overflow: hidden;
}

/* ── Main Row ───────────────────────────────── */
.eilb-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
}

/* ── Play Button ────────────────────────────── */
.eilb-left { flex-shrink: 0; }

.eilb-play-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    box-shadow: 0 3px 12px rgba(99,102,241,0.4);
    transition: all 0.2s;
}
.eilb-play-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 5px 18px rgba(99,102,241,0.55);
}
.eilb-play-btn:active { transform: scale(0.96); }

/* ── Middle: Title + Scrubber ───────────────── */
.eilb-mid {
    flex: 1;
    min-width: 0;
}

.eilb-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #9ca3af;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.eilb-lbl {
    font-weight: 700;
    color: #e5e7eb;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 11px;
}

.eilb-sep { color: #374151; }

.eilb-read-link {
    color: #818cf8 !important;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 13px;
    transition: color 0.15s;
}
.eilb-read-link:hover { color: #a5b4fc !important; }
.eilb-read-link strong { color: #c7d2fe; }

.eilb-meta {
    font-size: 12px;
    color: #6b7280;
}

/* ── Scrubber ───────────────────────────────── */
.eilb-scrub { user-select: none; -webkit-user-select: none; }

.eilb-track {
    position: relative;
    height: 6px;
    background: rgba(255,255,255,0.07);
    border-radius: 6px;
    cursor: pointer;
    transition: height 0.12s;
}
.eilb-track:hover,
.eilb-scrubbing { height: 10px; }

.eilb-fill {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #a78bfa);
    transition: width 0.3s;
    pointer-events: none;
}
.eilb-scrubbing .eilb-fill { transition: none; }

.eilb-handle {
    position: absolute;
    top: 50%;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #8b5cf6;
    transform: translate(-50%, -50%);
    box-shadow: 0 1px 6px rgba(139,92,246,0.4);
    pointer-events: none;
    opacity: 0;
    transition: left 0.3s, opacity 0.15s;
}
.eilb-track:hover .eilb-handle,
.eilb-scrubbing .eilb-handle { opacity: 1; }
.eilb-scrubbing .eilb-handle { transition: left 0s; transform: translate(-50%,-50%) scale(1.15); }

.eilb-scrub-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
    font-size: 11px;
    color: #6b7280;
}

#eilb-plbl {
    font-weight: 700;
    color: #a78bfa;
    font-variant-numeric: tabular-nums;
}

/* ── Speed Buttons ──────────────────────────── */
.eilb-sbtns {
    display: flex;
    gap: 2px;
}

.eilb-sbtn {
    padding: 2px 7px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    color: #6b7280;
    background: transparent;
    cursor: pointer;
    transition: all 0.12s;
    font-family: inherit;
}
.eilb-sbtn:hover {
    color: #d1d5db;
    background: rgba(139,92,246,0.12);
    border-color: rgba(139,92,246,0.25);
}
.eilb-sbtn.eilb-sa {
    color: #fff;
    background: #6366f1;
    border-color: #6366f1;
}

/* ── Language Dropdown ──────────────────────── */
.eilb-right { flex-shrink: 0; }

.eilb-lang {
    padding: 6px 28px 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #d1d5db;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: all 0.15s;
    font-family: inherit;
}
.eilb-lang:hover, .eilb-lang:focus {
    border-color: rgba(139,92,246,0.4);
    background-color: rgba(139,92,246,0.1);
    outline: none;
}
.eilb-lang option { background: #1f2937; color: #e5e7eb; }

/* ── Spinner ────────────────────────────────── */
.eilb-spin {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: eilbS 0.6s linear infinite;
}
@keyframes eilbS { to { transform: rotate(360deg); } }

/* ── Paragraph Highlight ────────────────────── */
.eilb-hl {
    background: rgba(99, 102, 241, 0.08) !important;
    border-left: 3px solid #6366f1 !important;
    padding-left: 12px !important;
    border-radius: 3px;
    transition: all 0.3s;
}


/* ═══════════════════════════════════════════════
   LIGHT THEME
   ═══════════════════════════════════════════════ */
.eilb.eilb-lt {
    background: #fff;
    border-color: rgba(0,0,0,0.06);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.eilb-lt .eilb-title { color: #6b7280; }
.eilb-lt .eilb-lbl { color: #111827; }
.eilb-lt .eilb-sep { color: #d1d5db; }
.eilb-lt .eilb-read-link { color: #6366f1 !important; }
.eilb-lt .eilb-read-link strong { color: #4338ca; }
.eilb-lt .eilb-meta { color: #9ca3af; }
.eilb-lt .eilb-track { background: rgba(0,0,0,0.05); }
.eilb-lt .eilb-handle { border-color: #6366f1; }
.eilb-lt #eilb-plbl { color: #6366f1; }
.eilb-lt .eilb-scrub-info { color: #9ca3af; }
.eilb-lt .eilb-sbtn { color: #9ca3af; border-color: rgba(0,0,0,0.06); }
.eilb-lt .eilb-sbtn:hover { color: #111827; background: rgba(99,102,241,0.06); }
.eilb-lt .eilb-sbtn.eilb-sa { color: #fff; background: #6366f1; border-color: #6366f1; }
.eilb-lt .eilb-lang { color: #374151; background: rgba(0,0,0,0.02); border-color: rgba(0,0,0,0.1); }
.eilb-lt .eilb-lang:hover { border-color: rgba(99,102,241,0.3); background: rgba(99,102,241,0.04); }
.eilb-lt .eilb-lang option { background: #fff; color: #111; }
.eilb-lt .eilb-hl {
    background: rgba(99,102,241,0.04) !important;
    border-left-color: #6366f1 !important;
}


/* ═══════════════════════════════════════════════
   MOBILE
   ═══════════════════════════════════════════════ */
@media (max-width: 640px) {
    .eilb-row {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 14px;
    }
    .eilb-mid {
        order: 3;
        width: 100%;
    }
    .eilb-right {
        margin-left: auto;
    }
    .eilb-title {
        font-size: 12px;
        gap: 6px;
    }
    .eilb-lang {
        font-size: 12px;
        padding: 5px 24px 5px 8px;
    }
    .eilb-play-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    .eilb-sbtn {
        font-size: 9px;
        padding: 2px 5px;
    }
}
