:root {
    --hog-red: #8a1b2d;
    --hog-red-dark: #6e1523;
    --hog-gold: #c9a45c;
    --hog-cream: #f6f1ea;
    --hog-ink: #17171c;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; }
body { font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif; color: #fff; }
button { font: inherit; }
[hidden] { display: none !important; }

.hog-player { position: relative; width: 100%; height: 100%; background: #000; user-select: none; overflow: hidden; }
.hog-video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; cursor: pointer; }

/* big play + spinner ------------------------------------------------- */
.hog-bigplay {
    position: absolute; inset: 0; margin: auto; width: 84px; height: 84px; z-index: 3;
    border-radius: 50%; border: 0; background: rgba(138, 27, 45, .92); cursor: pointer;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .45); transition: transform .15s ease, background .15s ease;
    display: flex; align-items: center; justify-content: center; padding: 0;
}
.hog-bigplay:hover { transform: scale(1.06); background: var(--hog-red); }
.hog-bigplay-ico {
    display: block; width: 0; height: 0; margin-left: 7px;
    border-top: 17px solid transparent; border-bottom: 17px solid transparent; border-left: 28px solid #fff;
}
.hog-spinner {
    position: absolute; inset: 0; margin: auto; width: 54px; height: 54px; z-index: 3;
    border: 4px solid rgba(255, 255, 255, .25); border-top-color: #fff; border-radius: 50%;
    animation: hogspin .9s linear infinite;
}
@keyframes hogspin { to { transform: rotate(360deg); } }

/* top bar -------------------------------------------------------------- */
.hog-topbar {
    position: absolute; inset-inline: 0; top: 0; z-index: 4;
    display: flex; align-items: center; gap: 10px; padding: 10px 14px 28px;
    background: linear-gradient(to bottom, rgba(0,0,0,.72), rgba(0,0,0,0));
    transition: opacity .35s ease; pointer-events: none;
}
.hog-topbar > * { pointer-events: auto; }
.hog-title {
    flex: 1; min-width: 0; font-size: 14px; font-weight: 600; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
.hog-actions { display: flex; align-items: center; gap: 8px; }
.hog-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: 1px solid rgba(255,255,255,.28); background: rgba(20,20,20,.55); color: #fff;
    border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer; text-decoration: none;
    backdrop-filter: blur(6px); transition: background .2s, border-color .2s;
}
.hog-btn:hover, .hog-btn:focus-visible { background: var(--hog-red); border-color: var(--hog-red); outline: none; color: #fff; }
.hog-primary { background: var(--hog-red); border-color: var(--hog-red); }
.hog-primary:hover { background: var(--hog-red-dark); }
.hog-btn-lg { padding: 10px 20px; font-size: 15px; font-weight: 600; border-radius: 10px; }
.hog-btn-dark { background: rgba(0,0,0,.55); }
.hog-link { background: none; border: 0; color: var(--hog-gold); cursor: pointer; text-decoration: underline; padding: 0; }
.hog-ico { font-size: 14px; line-height: 1; }
.hog-badge {
    font-size: 12px; padding: 5px 11px; border-radius: 999px; background: rgba(20,20,20,.55);
    border: 1px solid rgba(201,164,92,.7); color: #f3e2bd; white-space: nowrap;
}
.hog-badge b { color: #fff; }
.hog-badge-done { color: #b9f0c8; }
.hog-badge-preview { background: var(--hog-gold); color: var(--hog-ink); border-color: var(--hog-gold); font-weight: 700; }

/* controls ------------------------------------------------------------ */
.hog-controls {
    position: absolute; inset-inline: 0; bottom: 0; z-index: 4; padding: 26px 14px 10px;
    background: linear-gradient(to top, rgba(0,0,0,.82), rgba(0,0,0,0)); transition: opacity .35s ease;
}
.hog-player.hog-idle .hog-topbar, .hog-player.hog-idle .hog-controls { opacity: 0; }
.hog-player.hog-idle { cursor: none; }
.hog-seek { position: relative; height: 18px; cursor: pointer; outline: none; direction: ltr; }
[dir="rtl"] .hog-seek { transform: scaleX(-1); }
.hog-seek::before, .hog-seek-buffer, .hog-seek-fill {
    content: ""; position: absolute; left: 0; top: 7px; height: 4px; border-radius: 4px;
}
.hog-seek::before { right: 0; background: rgba(255,255,255,.25); }
.hog-seek-buffer { background: rgba(255,255,255,.45); width: 0; }
.hog-seek-fill { background: var(--hog-red); width: 0; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.hog-seek-fill::after {
    content: ""; position: absolute; right: -7px; top: -5px; width: 14px; height: 14px;
    border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--hog-red);
}
.hog-seek:hover::before, .hog-seek:hover .hog-seek-buffer, .hog-seek:hover .hog-seek-fill { top: 6px; height: 6px; }
.hog-seek-marks { position: absolute; inset: 0; pointer-events: none; }
.hog-seek-mark { position: absolute; top: 5px; width: 3px; height: 8px; background: var(--hog-gold); border-radius: 2px; left: auto; }
.hog-seek-tip {
    position: absolute; bottom: 22px; left: 0; padding: 4px 8px; border-radius: 6px; font-size: 12px;
    background: rgba(14,14,16,.92); white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis;
}
[dir="rtl"] .hog-seek-tip { transform: scaleX(-1); }
.hog-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.hog-ctl {
    display: inline-flex; align-items: center; justify-content: center; gap: 1px; min-width: 36px; height: 36px;
    border: 0; background: transparent; color: #fff; font-size: 18px; cursor: pointer; border-radius: 8px; padding: 0 6px;
}
.hog-ctl small { font-size: 10px; }
.hog-ctl:hover, .hog-ctl:focus-visible { background: rgba(255,255,255,.14); outline: none; }
.hog-ctl-text { font-size: 14px; font-weight: 600; }
.hog-i-play { display: block; width: 0; height: 0; border-top: 8px solid transparent; border-bottom: 8px solid transparent; border-left: 13px solid #fff; }
.hog-playing .hog-i-play { width: 12px; height: 16px; border: 0; border-left: 4px solid #fff; border-right: 4px solid #fff; }
.hog-time { font-size: 13px; font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; padding: 0 6px; white-space: nowrap; }
.hog-chapter-now { font-size: 13px; color: #e8d6ae; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.hog-spacer { flex: 1; }
.hog-volume { width: 80px; accent-color: var(--hog-red); }

/* chapters drawer ---------------------------------------------------- */
.hog-chapters {
    position: absolute; top: 0; bottom: 0; inset-inline-start: 0; z-index: 6;
    width: min(360px, 86%); background: rgba(14,14,16,.95); backdrop-filter: blur(8px);
    border-inline-end: 3px solid var(--hog-red); display: flex; flex-direction: column;
    box-shadow: 0 0 30px rgba(0,0,0,.5);
}
.hog-chapters-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 16px; font-weight: 700; color: var(--hog-gold); border-bottom: 1px solid rgba(255,255,255,.1);
}
.hog-close { padding: 3px 9px; }
.hog-chapters ol { list-style: none; margin: 0; padding: 6px 0; overflow-y: auto; flex: 1; }
.hog-chapter {
    display: flex; gap: 12px; width: 100%; text-align: start; padding: 9px 16px; border: 0;
    background: transparent; color: #e9e9e9; cursor: pointer; font-size: 13.5px; line-height: 1.45;
    border-inline-start: 3px solid transparent;
}
.hog-chapter:hover { background: rgba(255,255,255,.07); }
.hog-chapter.hog-current { background: rgba(138,27,45,.35); border-inline-start-color: var(--hog-gold); color: #fff; }
.hog-chapter-time { flex: none; min-width: 52px; font-variant-numeric: tabular-nums; color: var(--hog-gold); direction: ltr; unicode-bidi: isolate; }

/* toasts --------------------------------------------------------------- */
.hog-toast {
    position: absolute; inset-inline: 0; margin-inline: auto; bottom: 86px; z-index: 5; width: max-content;
    max-width: 92%; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px;
    padding: 10px 14px; border-radius: 12px; background: rgba(14,14,16,.92); border: 1px solid rgba(201,164,92,.55);
    font-size: 13.5px; box-shadow: 0 6px 24px rgba(0,0,0,.45);
}
.hog-toast-ok { border-color: #3fae63; color: #d7f7e1; }
.hog-toast-err { border-color: #c0392b; }

/* end screen ------------------------------------------------------------ */
.hog-end {
    position: absolute; inset: 0; z-index: 7; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 50% 40%, rgba(138,27,45,.55), rgba(0,0,0,.9)); padding: 18px;
}
.hog-end-box { max-width: 560px; text-align: center; }
.hog-end-kicker { color: var(--hog-gold); font-weight: 700; font-size: 13px; letter-spacing: .04em; }
.hog-end h2 { font-size: clamp(18px, 3.4vw, 26px); margin: 8px 0 10px; line-height: 1.45; }
.hog-end p { color: #e6e1dc; margin: 0 0 16px; line-height: 1.8; font-size: 14.5px; }
.hog-end-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.hog-end-auto { margin-top: 14px; font-size: 13px; color: #ddd; }

/* watermark ------------------------------------------------------------ */
.hog-watermark {
    position: absolute; z-index: 2; pointer-events: none; font-size: 13px; color: rgba(255,255,255,.22);
    text-shadow: 0 0 2px rgba(0,0,0,.35); white-space: nowrap; top: 18%; inset-inline-start: 8%;
    transition: top 1.2s ease, inset-inline-start 1.2s ease; direction: ltr; unicode-bidi: isolate;
}

/* denied --------------------------------------------------------------- */
.hog-denied {
    display: flex; align-items: center; justify-content: center; color: #fff;
    background-color: var(--hog-red-dark); background-size: cover; background-position: center;
}
.hog-denied::before { content: ""; position: absolute; inset: 0; background: rgba(20, 6, 9, .78); }
.hog-denied-box { position: relative; text-align: center; padding: 24px; max-width: 520px; }
.hog-lock { font-size: 38px; }
.hog-denied h1 { font-size: clamp(18px, 3.2vw, 24px); margin: 10px 0 8px; }
.hog-denied p { margin: 0 0 18px; color: #eee; line-height: 1.8; }

@media (max-width: 560px) {
    .hog-title, .hog-chapter-now, .hog-volume, #hog_back, #hog_fwd { display: none; }
    .hog-btn { padding: 4px 9px; font-size: 12px; }
    .hog-topbar { padding: 8px 8px 20px; }
    .hog-controls { padding: 18px 8px 6px; }
    .hog-bigplay { width: 64px; height: 64px; }
}

/* small embeds (phones, narrow lesson columns) ----------------------- */
@media (max-height: 360px) {
    .hog-end { padding: 10px; align-items: center; }
    .hog-end h2 { font-size: 16px; margin: 4px 0 8px; }
    .hog-end p, .hog-end-auto { display: none; }
    .hog-end-kicker { font-size: 11px; }
    .hog-btn-lg { padding: 7px 12px; font-size: 13px; }
    .hog-denied-box { padding: 10px; }
    .hog-denied h1 { font-size: 16px; margin: 4px 0; }
    .hog-denied p, .hog-lock { display: none; }
    .hog-toast { bottom: 58px; font-size: 12px; padding: 7px 10px; }
    .hog-topbar { padding-bottom: 14px; }
}
