/* =============================================================================
   TokoMJ Lyrics Ticker — floating box embed di POS kasir
   Position fixed always-on-top (z-index tinggi) DALAM tab POS. Draggable via
   header, resizable via CSS native. Transparent by nature — parent WP page
   transparent, box pakai bg rgba(0,0,0, bg_opacity). Text-shadow tebal jamin
   readable di ANY background POS kasir.

   Pattern paten reference:
   - PAGE-WP-HTML-NON-ELEMENTOR/Embed-html-notifoffline-elementor.html
     (body transparent, element BOX pakai rgba)
   - wp-content/plugins/tokomj-price-ticker/assets/css/ticker.css
     (WP plugin CSS scoping)
   ============================================================================= */

.tokomj-lyrics-wrap {
    position: fixed;
    /* 4-corner support (owner request 2026-07-22 default 'bottom-left').
       Shortcode set 2 CSS var yg relevan, 2 lainnya jadi 'auto'. Kalau
       owner drag di runtime, JS override style.top/left inline (bottom/right
       jadi auto otomatis di drag handler). */
    top: var(--tl-top, auto);
    right: var(--tl-right, auto);
    bottom: var(--tl-bottom, auto);
    left: var(--tl-left, auto);
    width: var(--tl-width, 360px);
    height: var(--tl-height, 180px);
    min-width: 200px;
    min-height: 100px;
    max-width: 100vw;
    max-height: 100vh;
    z-index: 999999;
    display: flex; flex-direction: column;
    border-radius: 8px;
    background: rgba(0, 0, 0, var(--tl-bg-opacity, 0.4));
    color: var(--tl-text, #ffffff);
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    resize: both;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    /* Prevent Elementor / theme override */
    box-sizing: border-box;
}

.tokomj-lyrics-wrap.tokomj-lyrics-dragging {
    opacity: 0.85;
    cursor: grabbing !important;
    user-select: none;
}

.tokomj-lyrics-header {
    flex: 0 0 auto;
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.25);
    cursor: grab;
    font-size: 11px;
    user-select: none;
}
.tokomj-lyrics-header:active { cursor: grabbing; }

.tokomj-lyrics-title {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(255,255,255,0.7);
    text-shadow: 0 1px 2px rgba(0,0,0,0.9);
}

.tokomj-lyrics-close {
    background: transparent;
    color: rgba(255,255,255,0.7);
    border: 0;
    font-size: 14px;
    line-height: 1;
    padding: 2px 6px;
    cursor: pointer;
    border-radius: 4px;
}
.tokomj-lyrics-close:hover {
    background: rgba(255,255,255,0.15);
    color: #ffffff;
}

.tokomj-lyrics-body {
    flex: 1 1 auto;
    display: flex; align-items: center; justify-content: center;
    padding: 8px 14px;
    overflow: hidden;
    text-align: center;
}

.tokomj-lyrics-loading,
.tokomj-lyrics-idle {
    color: rgba(255,255,255,0.55);
    font-style: italic;
    font-size: 13px;
    text-shadow:
        -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

/* Scroll mode — 3 baris (prev + current + next) */
.tokomj-lyrics-scroll {
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    gap: 4px;
    width: 100%;
}
.tokomj-lyrics-scroll .tl-line {
    color: var(--tl-text, #ffffff);
    opacity: 0.4;
    font-size: 14px;
    line-height: 1.3;
    padding: 2px 6px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    /* Text-shadow tebal outline hitam — text kebaca over ANY bg POS kasir */
    text-shadow:
        -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000,
        0 0 6px rgba(0,0,0,0.85);
}
.tokomj-lyrics-scroll .tl-current {
    color: var(--tl-hl, #fbbf24);
    opacity: 1;
    font-weight: 700;
    font-size: 20px;
    white-space: normal;   /* current wrap ke bawah kalau panjang */
    text-shadow:
        -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000,
        0 0 10px rgba(0,0,0,0.9);
}
.tokomj-lyrics-scroll .tl-line.rtl {
    direction: rtl;
    font-family: system-ui, "Noto Naskh Arabic", "Amiri", serif;
}

/* Karaoke mode — 1 baris besar tengah */
.tokomj-lyrics-karaoke {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%;
}
.tokomj-lyrics-karaoke .tl-line {
    color: var(--tl-hl, #fbbf24);
    font-weight: 700;
    font-size: 26px;
    line-height: 1.3;
    text-align: center;
    max-width: 100%;
    text-shadow:
        -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000,
        0 0 12px rgba(0,0,0,0.9);
}
.tokomj-lyrics-karaoke .tl-line.rtl {
    direction: rtl;
    font-family: system-ui, "Noto Naskh Arabic", "Amiri", serif;
}

/* Diagnostic — owner belum config endpoint (di shortcode.php).
   Muncul di dalam page flow (bukan fixed) supaya owner sadar. */
.tokomj-lyrics-empty-config {
    background: #fef2f2;
    color: #7f1d1d;
    border: 1px solid #fecaca;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    margin: 12px 0;
}

/* =============================================================================
   Banner MUSIK MATI (Commit 11 2026-07-22 h)
   Trigger: ticker deteksi player idle/mati > threshold. wrap dapat class
   .tokomj-lyrics-banner-mode → box jadi merah blink besar dgn tombol tap.
   Prioritas visual: harus mencolok even di POS kasir yg full aktifitas —
   pakai animasi blink border + shake sedikit + font besar.
   ============================================================================= */
/* Commit 22 (2026-07-23 d) — owner report karyawan tak kebaca tulisan banner
   krn warna cream/putih di background merah = kontras kurang di lighting toko.
   Owner: "tulisan banner notif itu putih diganti saja warna merah".
   Redesign: CREAM background + BOLD RED text = warning-sign pattern (max
   readability) + red border blink to yellow (masih attention-grabbing). */
.tokomj-lyrics-wrap.tokomj-lyrics-banner-mode {
    background: #fef3c7;                    /* cream — kontras utk teks merah */
    border: 4px solid #dc2626;              /* red-600 solid, blink ke yellow */
    box-shadow: 0 0 28px rgba(220, 38, 38, 0.75);
    animation: tokomj-lyrics-banner-blink 1.2s infinite;
    /* Auto-expand size — banner butuh space buat tombol tap yg cukup gede
       biar karyawan gampang tap di POS kasir touchscreen. Override width/height
       walau owner sudah drag/save posisi kecil sebelumnya. */
    min-width: 320px;
    min-height: 180px;
    z-index: 9999999;                        /* di atas ticker biasa (999999) */
}
.tokomj-lyrics-wrap.tokomj-lyrics-banner-mode .tokomj-lyrics-header {
    background: rgba(220, 38, 38, 0.95);    /* red header on cream body = kontras */
}
.tokomj-lyrics-wrap.tokomj-lyrics-banner-mode .tokomj-lyrics-title {
    color: #ffffff;                          /* white on red header — max kontras */
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.9);
}
@keyframes tokomj-lyrics-banner-blink {
    0%, 100% {
        border-color: #dc2626;              /* red */
        box-shadow: 0 0 28px rgba(220, 38, 38, 0.75);
    }
    50% {
        border-color: #fbbf24;              /* yellow — attention flash */
        box-shadow: 0 0 36px rgba(251, 191, 36, 0.9);
    }
}

.tokomj-lyrics-banner {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 10px;
    text-align: center;
    padding: 10px 8px;
    width: 100%;
}
.tokomj-lyrics-banner-msg {
    color: #b91c1c;                          /* red-700 bold on cream */
    font-size: 18px;                          /* naik dari 15px — lebih ke-baca */
    font-weight: 800;                         /* naik dari 700 */
    line-height: 1.3;
    /* Hapus text-shadow hitam — ga perlu di light background, malah bikin blur */
}
/* Commit 29 (2026-07-25) — .tokomj-lyrics-banner-info menggantikan
   .tokomj-lyrics-banner-btn. Text info (bukan tombol) instruksi buka player
   di laptop yg ditentukan. TIDAK clickable — cegah karyawan tap = double-tab
   ke device kasir. Style tetap prominent (besar, tebal, warna kontras) supaya
   ke-baca dari jarak jauh, tapi zero cursor:pointer / zero hover feedback
   biar visual ga mislead sebagai tombol. */
.tokomj-lyrics-banner-info {
    display: block;
    background: #fef3c7;                     /* amber-100 background — informational, bukan CTA */
    color: #7f1d1d;                          /* red-900 — kontras kuat di cream */
    font-weight: 800;
    font-size: 16px;
    line-height: 1.4;
    letter-spacing: 0.2px;
    padding: 12px 16px;
    border-radius: 8px;
    border: 2px dashed #b91c1c;              /* dashed border — visual "info card" bukan button */
    max-width: 90%;
    user-select: none;                        /* cegah accidental long-press select di touch */
    cursor: default;                          /* explicit ga clickable */
}
.tokomj-lyrics-banner-reason {
    color: #7f1d1d;                          /* red-900 dark, italic on cream */
    font-size: 12px;
    font-style: italic;
    font-weight: 600;
    /* Hapus text-shadow — ga perlu di light bg */
}
.tokomj-lyrics-banner-snooze {
    background: transparent;
    color: rgba(127, 29, 29, 0.75);          /* dark red muted on cream bg */
    border: 1px solid rgba(127, 29, 29, 0.35);
    border-radius: 4px;
    font-size: 11px;
    padding: 4px 10px;
    cursor: pointer;
    margin-top: 4px;
}
.tokomj-lyrics-banner-snooze:hover {
    background: rgba(127, 29, 29, 0.08);
    color: #7f1d1d;
}
