/* Radio Khâm Thiên Tứ Hóa — Styles v1.0 */

/* ── Mini Player (sticky bottom) ────────────────────────────────── */
.ktth-rp {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 9990;
    background: #12192b;
    color: #e8edf3;
    font-family: 'Be Vietnam Pro', -apple-system, sans-serif;
    box-shadow: 0 -4px 24px rgba(0,0,0,.45);
    transform: translateY(100%);
    transition: transform .32s cubic-bezier(.4,0,.2,1);
    border-top: 2px solid #c9a84c;
    /* Always in DOM so transition works; hidden = off-screen */
}
.ktth-rp.visible {
    transform: translateY(0);
}
.ktth-rp.hidden {
    /* Fully off-screen AND invisible for screen readers */
    visibility: hidden;
    transform: translateY(100%);
}

.krp-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 8px 14px 6px;
}

/* Row: title */
.krp-row { display: flex; align-items: center; gap: 8px; }
.krp-row-title { margin-bottom: 5px; }

.krp-label {
    font-size: 15px;
    flex-shrink: 0;
}
.krp-title {
    flex: 1;
    color: #e8edf3;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.krp-title:hover { color: #c9a84c; text-decoration: none; }

/* Row: progress */
.krp-row-prog { gap: 10px; margin-bottom: 6px; }
.krp-prog {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,.15);
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
}
.krp-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #c9a84c, #e8d5a3);
    border-radius: 2px;
    transition: width .6s linear;
}
.krp-time {
    font-size: 11px;
    color: rgba(255,255,255,.5);
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 80px;
    text-align: right;
}

/* Row: controls */
.krp-row-ctrl { gap: 2px; justify-content: center; margin-bottom: 4px; }

.krp-ico-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,.8);
    font-size: 16px;
    width: 38px; height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s;
    flex-shrink: 0;
}
.krp-ico-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.krp-ico-btn.active { color: #c9a84c; }

.krp-play {
    width: 44px; height: 44px;
    background: #c9a84c;
    color: #12192b;
    font-size: 18px;
    font-weight: 700;
    margin: 0 6px;
}
.krp-play:hover { background: #e8d5a3; color: #12192b; }


/* Speed button */
.krp-speed-btn {
    font-size: 12px !important;
    font-weight: 700;
    letter-spacing: -0.03em;
    min-width: 34px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 6px !important;
    color: rgba(255,255,255,.7) !important;
}
.krp-speed-btn.active {
    border-color: #c9a84c;
    color: #c9a84c !important;
}
.krp-voice-btn {
    font-size: 11px !important;
    font-weight: 700;
    letter-spacing: -0.02em;
    min-width: 40px;
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 6px !important;
    color: rgba(255,255,255,.7) !important;
}
.krp-voice-btn.active {
    border-color: #4caf8c;
    color: #4caf8c !important;
}
/* Speed dropdown menu */
.krp-speed-menu {
    position: fixed;
    z-index: 10010;
    background: #1a2440;
    border: 1px solid rgba(201,168,76,.4);
    border-radius: 10px;
    padding: 6px 0;
    box-shadow: 0 8px 32px rgba(0,0,0,.6);
    min-width: 160px;
}
.krp-speed-opt {
    display: block;
    width: 100%;
    padding: 10px 18px;
    background: none;
    border: none;
    color: rgba(232,237,243,.8);
    font-size: 13px;
    font-family: 'Be Vietnam Pro', -apple-system, sans-serif;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background .15s;
}
.krp-speed-opt:hover { background: rgba(255,255,255,.07); }
.krp-speed-opt.selected {
    color: #c9a84c;
    font-weight: 700;
}
.krp-speed-opt.selected::after {
    content: ' ✓';
}
/* Playlist panel */
.krp-playlist {
    border-top: 1px solid rgba(255,255,255,.1);
    margin-top: 6px;
    max-height: 240px;
    overflow: hidden;
    transition: max-height .28s ease;
}
.krp-playlist.krp-pl-closed { max-height: 0; border-top: none; }

.krp-pl-hdr {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 0 6px;
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,.55);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.krp-sm-btn {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.15);
    color: rgba(255,255,255,.7);
    border-radius: 99px;
    padding: 3px 10px;
    font-size: 11px;
    cursor: pointer;
    transition: background .15s;
    font-family: inherit;
}
.krp-sm-btn:hover { background: rgba(255,255,255,.16); }

.krp-pl-items {
    overflow-y: auto;
    max-height: 180px;
    scrollbar-width: thin;
    scrollbar-color: rgba(201,168,76,.4) transparent;
}

.krp-pl-item {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 4px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    cursor: pointer;
    border-radius: 4px;
    transition: background .12s;
}
.krp-pl-item:hover { background: rgba(255,255,255,.07); }
.krp-pl-item.active { background: rgba(201,168,76,.15); }
.krp-pl-item.active .krp-pl-t { color: #c9a84c; font-weight: 700; }

.krp-pl-num {
    font-size: 11px;
    color: rgba(255,255,255,.35);
    width: 20px;
    flex-shrink: 0;
    text-align: right;
}
.krp-pl-t {
    flex: 1;
    font-size: 12.5px;
    color: rgba(255,255,255,.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.krp-pl-cat {
    font-size: 10px;
    color: rgba(255,255,255,.35);
    white-space: nowrap;
    flex-shrink: 0;
}
.krp-pl-empty {
    padding: 16px 0;
    text-align: center;
    color: rgba(255,255,255,.35);
    font-size: 12px;
}

/* ── Modal ───────────────────────────────────────────────────────── */
.ktth-rm {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}
.ktth-rm.open { display: flex; }

.krm-bd {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(3px);
}

.krm-box {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px 22px;
    width: 90%;
    max-width: 380px;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
    font-family: 'Be Vietnam Pro', -apple-system, sans-serif;
    animation: krm-in .22s cubic-bezier(.34,1.56,.64,1);
}
@keyframes krm-in {
    from { transform: scale(.88) translateY(20px); opacity: 0; }
    to   { transform: scale(1)   translateY(0);    opacity: 1; }
}

.krm-h {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 800;
    color: #12192b;
}
.krm-sub {
    margin: 0 0 14px;
    font-size: 13px;
    color: #6b7a8d;
}

.krm-opts {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.krm-opt {
    flex: 1;
    min-width: 100px;
    padding: 10px 8px;
    border: 2px solid #e0e6f0;
    border-radius: 10px;
    background: #f6f8fb;
    color: #2a4861;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    text-align: center;
    font-family: inherit;
}
.krm-opt:hover { border-color: #c9a84c; background: #fffbf0; }
.krm-opt.selected {
    border-color: #c9a84c;
    background: #fffbf0;
    color: #8a6a00;
}

.krm-cat {
    width: 100%;
    padding: 9px 12px;
    border: 2px solid #e0e6f0;
    border-radius: 8px;
    font-size: 13px;
    color: #2a4861;
    background: #fff;
    margin-bottom: 14px;
    font-family: inherit;
    cursor: pointer;
    appearance: auto;
}
.krm-cat:focus { outline: none; border-color: #c9a84c; }
.krm-hidden { display: none !important; }

.krm-start {
    display: block;
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #12192b, #2a4861);
    color: #c9a84c;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 8px;
    transition: opacity .15s;
    font-family: inherit;
    letter-spacing: .02em;
}
.krm-start:hover:not(:disabled) { opacity: .88; }
.krm-start:disabled { opacity: .55; cursor: not-allowed; }

.krm-cancel {
    display: block;
    width: 100%;
    padding: 9px;
    background: none;
    border: 1px solid #dde3ef;
    border-radius: 8px;
    color: #6b7a8d;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: background .12s;
}
.krm-cancel:hover { background: #f6f8fb; }

/* ── Homepage Banner ─────────────────────────────────────────────── */
.ktth-radio-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #12192b 0%, #1e2d4a 100%);
    border-left: 4px solid #c9a84c;
    border-radius: 10px;
    padding: 14px 18px;
    margin: 0 0 24px;
    flex-wrap: wrap;
}
.ktth-radio-banner-icon { font-size: 28px; flex-shrink: 0; }
.ktth-radio-banner-text {
    flex: 1;
    min-width: 160px;
    color: rgba(255,255,255,.88);
    font-family: 'Be Vietnam Pro', -apple-system, sans-serif;
    font-size: 13.5px;
    line-height: 1.5;
}
.ktth-radio-banner-text strong { color: #c9a84c; }
.ktth-radio-banner-btn {
    background: #c9a84c;
    color: #12192b;
    border: none;
    border-radius: 99px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    font-family: 'Be Vietnam Pro', -apple-system, sans-serif;
    transition: background .15s, transform .12s;
}
.ktth-radio-banner-btn:hover { background: #e8d5a3; transform: translateY(-1px); }

/* ── "Nghe liên tục từ đây" button on single posts ──────────────── */
.ktth-radio-here-btn {
    background: linear-gradient(135deg, #1a3a24, #2d6a4f) !important;
    font-size: 0.82rem !important;
}
.ktth-radio-here-btn:hover {
    background: linear-gradient(135deg, #12291a, #1a4735) !important;
    transform: translateY(-1px);
}

/* ── Toast notification ──────────────────────────────────────────── */
.ktth-radio-toast {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    background: rgba(18,25,43,.92);
    color: #e8edf3;
    padding: 10px 18px;
    border-radius: 99px;
    font-size: 13px;
    font-family: 'Be Vietnam Pro', -apple-system, sans-serif;
    white-space: nowrap;
    max-width: 90vw;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 10100;
    opacity: 0;
    transition: opacity .3s, transform .3s;
    pointer-events: none;
    box-shadow: 0 4px 20px rgba(0,0,0,.3);
    border: 1px solid rgba(201,168,76,.3);
}
.ktth-radio-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Resume banner ───────────────────────────────────────────────── */
.ktth-resume-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9980;
    background: #12192b;
    color: rgba(255,255,255,.85);
    font-family: 'Be Vietnam Pro', -apple-system, sans-serif;
    font-size: 13px;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    border-bottom: 2px solid #c9a84c;
    box-shadow: 0 2px 10px rgba(0,0,0,.3);
}
.ktth-resume-bar strong { color: #c9a84c; }
.krr-btn {
    padding: 5px 14px;
    border-radius: 99px;
    border: 1px solid rgba(201,168,76,.5);
    background: rgba(201,168,76,.15);
    color: #c9a84c;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background .12s;
}
.krr-btn:hover { background: rgba(201,168,76,.3); }
.krr-no {
    background: none;
    border-color: rgba(255,255,255,.2);
    color: rgba(255,255,255,.5);
}
.krr-no:hover { background: rgba(255,255,255,.08); color: rgba(255,255,255,.8); }

/* ── Mobile responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
    .krp-wrap { padding: 7px 10px 5px; }
    .krp-title { font-size: 12px; }
    .krp-ico-btn { width: 34px; height: 34px; font-size: 15px; }
    .krp-play { width: 40px; height: 40px; font-size: 17px; }
    .krp-time { font-size: 10px; min-width: 65px; }
    .ktth-radio-banner { padding: 12px 14px; gap: 10px; }
    .ktth-radio-banner-icon { font-size: 22px; }
    .ktth-radio-banner-text { font-size: 12.5px; }
    .ktth-radio-banner-btn { padding: 8px 16px; font-size: 13px; }
    .ktth-radio-toast { bottom: 100px; font-size: 12px; }
    .krm-box { padding: 22px 16px 18px; }
    .krm-h { font-size: 16px; }
    .krm-opt { font-size: 12px; padding: 8px 6px; }
}

/* ── Floating action button (FAB) khi radio đang phát ─────────── */
.krp-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9985;
    background: #12192b;
    color: #c9a84c;
    border: 2px solid #c9a84c;
    border-radius: 99px;
    padding: 10px 16px;
    font-size: 18px;
    font-family: 'Be Vietnam Pro', -apple-system, sans-serif;
    cursor: pointer;
    display: none;               /* hidden until radio starts */
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,.4);
    transition: transform .15s, box-shadow .15s;
    white-space: nowrap;
}
.krp-fab.krp-fab-on { display: flex; }
.krp-fab:hover { transform: scale(1.05); box-shadow: 0 6px 24px rgba(0,0,0,.5); }
.krp-fab-label {
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,.85);
    letter-spacing: .02em;
}

@media (max-width: 600px) {
    .krp-fab { bottom: 80px; right: 14px; padding: 9px 14px; font-size: 16px; }
    .krp-fab-label { font-size: 11px; }
}

/* Playlist footer */
.krp-pl-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 4px 4px;
    font-size: 11px;
    color: rgba(255,255,255,.35);
    border-top: 1px solid rgba(255,255,255,.07);
    margin-top: 4px;
}
