/**
 * FILE: assets/css/amum-modal-video.css
 * Complete styling with social features and payments
 */

/* ===== Body Lock ===== */
body.amum-modal-open {
    overflow: hidden !important;
}

/* NOTE: .amum-modal, .amum-modal-close, .amum-modal-container and
   .amum-video-player are intentionally NOT redefined here anymore —
   platform.css already styles all of these with a proper responsive
   layout (mobile bottom-sheet, desktop side-panel, scrollable info
   column). This file previously duplicated those same selectors with
   older, non-responsive rules; since this stylesheet loads after
   platform.css, it was silently winning the cascade and breaking the
   responsive/scrollable behavior on desktop. Everything below this
   point is the additional payment/social/comment styling that's
   unique to this file and still needed. */

.amum-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 1.2rem;
}

/* ===== In-player controls: Previous / Play / Next =====
   Built into #amum-video-player alongside the <video> element itself
   by amum-modal-video.js (that element's innerHTML is fully replaced
   each time a video loads, so these can't be static markup — they're
   inserted fresh with the video every time). Reuses the same
   .amum-prev-video-btn/.amum-next-video-btn classes as the Previous/
   Next buttons already in the info panel, so the existing delegated
   click handlers and disabled-state syncing in amum-modal-video.js
   apply to these automatically — no duplicate logic needed. */
.amum-player-controls {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    background: transparent;
    opacity: 1;
    transition: opacity .35s ease;
    pointer-events: none; /* only the buttons themselves are clickable */
}
/* Playing → the whole cluster (including the play icon) fades away. The
   faded buttons also stop catching taps so the video underneath gets them,
   and visibility:hidden (after the fade) guarantees nothing can linger on
   browsers that keep a composited layer's last paint. */
.amum-player-controls.amum-controls-faded {
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity .35s ease, visibility 0s linear .35s;
}
.amum-player-controls.amum-controls-faded .amum-player-ctrl-btn,
.amum-player-bar.amum-controls-faded .amum-player-ctrl-btn,
.amum-player-bar.amum-controls-faded .amum-seek { pointer-events: none !important; }
.amum-player-bar.amum-controls-faded { opacity: 0 !important; visibility: hidden !important; transition: opacity .35s ease, visibility 0s linear .35s; }
.amum-player-bar:not(.amum-controls-playing) { opacity: 1 !important; visibility: visible !important; }
/* Paused / not started → always visible */
.amum-player-controls:not(.amum-controls-playing) { opacity: 1 !important; visibility: visible !important; }
/* Reappear on hover — ONLY for devices with a real hovering pointer
   (desktop mouse). Touch screens report a sticky :hover after every tap,
   which is exactly what kept the play icon stuck on phones. */
@media (hover: hover) and (pointer: fine) {
    .amum-player-controls.amum-controls-playing.amum-hover-on {
        opacity: 1 !important;
        visibility: visible !important;
        transition: opacity .2s ease;
    }
    .amum-player-controls.amum-controls-playing.amum-hover-on .amum-player-ctrl-btn { pointer-events: auto; }
    .amum-player-bar.amum-controls-playing.amum-hover-on { opacity: 1 !important; visibility: visible !important; transition: opacity .2s ease; }
    .amum-player-bar.amum-controls-playing.amum-hover-on .amum-player-ctrl-btn,
    .amum-player-bar.amum-controls-playing.amum-hover-on .amum-seek { pointer-events: auto; }
}

/* "Tap to unmute" — shown only when the browser blocked autoplay with sound */
.amum-unmute-hint {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 6;
    background: rgba(0,0,0,.72);
    color: #fff;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.amum-player-ctrl-btn {
    pointer-events: auto;
    background: transparent !important;   /* theme button styles (white circles) must not leak in */
    background-image: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0 !important;
    min-width: 0; min-height: 0;
    border: none !important;
    color: #fff !important;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 20px;
    line-height: 1;
    filter: drop-shadow(0 1px 4px rgba(0,0,0,.85)); /* keeps icons visible over bright frames without a background fill */
    transition: background-color .2s ease, transform .15s ease;
}
@media (hover: hover) and (pointer: fine) {
    .amum-player-ctrl-btn:hover { background: rgba(0,0,0,.35) !important; }
}
.amum-player-ctrl-btn svg { width: 55%; height: 55%; fill: #fff; display: block; pointer-events: none; }
.amum-player-ctrl-btn:active { transform: scale(.92); }
.amum-player-ctrl-btn[disabled] { opacity: .35; cursor: not-allowed; pointer-events: none; }
.amum-player-ctrl-btn[disabled]:hover { background: transparent !important; }

.amum-play-pause-btn { width: 64px; height: 64px; font-size: 28px; }

/* Larger, more thumb-friendly on phones — this cluster is the primary
   playback control on touch devices. */
@media (max-width: 480px) {
    .amum-player-controls { gap: 28px; }
    .amum-player-ctrl-btn { width: 52px; height: 52px; font-size: 22px; }
    .amum-play-pause-btn { width: 68px; height: 68px; font-size: 30px; }
}

/* ===== Payment Gate ===== */
#amum-payment-gate {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.amum-payment-info {
    text-align: center;
    padding: 40px;
    color: #fff;
}

.amum-payment-info h3 {
    font-size: 2rem;
    margin-bottom: 20px;
}

.amum-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: #4CAF50;
    margin-bottom: 30px;
}

.amum-payment-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.amum-pay-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.amum-pay-mpesa {
    background: #00A86B;
    color: #fff;
}

.amum-pay-mpesa:hover {
    background: #008C59;
    transform: translateY(-2px);
}

.amum-pay-paypal {
    background: #0070BA;
    color: #fff;
}

.amum-pay-paypal:hover {
    background: #005A95;
    transform: translateY(-2px);
}

.amum-login-prompt {
    margin-top: 20px;
    color: #aaa;
}

.amum-login-prompt a {
    color: #4CAF50;
    text-decoration: underline;
}

/* ===== Video Info Section ===== */
.amum-video-info {
    padding: 25px;
    background: #1a1a1a;
    color: #fff;
}

.amum-info-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 20px;
}

.amum-video-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 10px 0;
}

.amum-video-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.9rem;
    color: #aaa;
}

.amum-video-meta span {
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
}

/* ===== Action Buttons (Back, Home, Download) ===== */
.amum-action-buttons {
    display: flex;
    gap: 10px;
}

.amum-btn-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: all 0.3s;
}

.amum-btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.amum-btn-back:hover {
    background: #2196F3;
}

.amum-btn-home:hover {
    background: #4CAF50;
}

.amum-btn-download:hover {
    background: #FF9800;
}

/* ===== Social Actions ===== */
.amum-social-actions {
    display: flex;
    gap: 15px;
    padding: 20px 0;
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
}

.amum-social-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.amum-social-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.amum-like-btn.liked {
    background: #e74c3c;
    border-color: #e74c3c;
}

.amum-like-btn.liked .amum-icon-heart {
    animation: heartBeat 0.3s;
}

@keyframes heartBeat {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }
}

.amum-subscribe-btn.subscribed {
    background: #4CAF50;
    border-color: #4CAF50;
}

/* ===== Comments Section ===== */
.amum-comments-section {
    margin-top: 25px;
}

.amum-comments-section h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.amum-comment-form {
    margin-bottom: 20px;
}

#amum-comment-input {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 0.95rem;
    resize: vertical;
    margin-bottom: 10px;
}

#amum-comment-input:focus {
    outline: none;
    border-color: #4CAF50;
    background: rgba(255, 255, 255, 0.08);
}

.amum-btn-primary {
    padding: 10px 25px;
    background: #4CAF50;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.amum-btn-primary:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.amum-comments-list {
    max-height: 400px;
    overflow-y: auto;
}

.amum-comment-item {
    display: flex;
    gap: 12px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-bottom: 10px;
}

.amum-comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.amum-comment-content {
    flex: 1;
}

.amum-comment-author {
    font-weight: 600;
    margin-bottom: 5px;
}

.amum-comment-time {
    font-size: 0.8rem;
    color: #888;
    margin-left: 10px;
}

.amum-comment-text {
    color: #ddd;
    line-height: 1.5;
}

/* ===== Play Button on Thumbnails ===== */
.amum-video-thumbnail-wrapper {
    position: relative;
    display: block;
}

.amum-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    pointer-events: none;
    opacity: 0.9;
    transition: all 0.3s;
}

.amum-video-thumbnail-wrapper:hover .amum-play-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.amum-play-overlay svg {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.8));
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .amum-modal-container {
        width: 95%;
        max-height: 95vh;
    }

    .amum-info-header {
        flex-direction: column;
    }

    .amum-video-title {
        font-size: 1.4rem;
    }

    .amum-social-actions {
        flex-wrap: wrap;
        gap: 10px;
    }

    .amum-social-btn {
        flex: 1 1 calc(50% - 5px);
        min-width: 140px;
        justify-content: center;
    }

    .amum-payment-buttons {
        flex-direction: column;
    }

    .amum-pay-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===== Scrollbar Styling ===== */
.amum-modal-container::-webkit-scrollbar,
.amum-comments-list::-webkit-scrollbar {
    width: 8px;
}

.amum-modal-container::-webkit-scrollbar-track,
.amum-comments-list::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.amum-modal-container::-webkit-scrollbar-thumb,
.amum-comments-list::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.amum-modal-container::-webkit-scrollbar-thumb:hover,
.amum-comments-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}
/* The video card has no Close button (leave via Back / ESC / tap outside). */
#amum-video-modal .amum-modal-close { display: none !important; }

/* Chrome/Android draws its own big white centre play/pause disc on <video controls>;
   our cluster is the single centre control, so hide the native one. */
#amum-video-player video::-webkit-media-controls-overlay-play-button { display: none !important; }

/* Previous: greyed out and inactive on the very first item only. */
.amum-prev-video-btn[disabled], .amum-prev-video-btn.amum-is-disabled { opacity: .35 !important; cursor: not-allowed; pointer-events: none; }

.amum-play-error { position:absolute; left:12px; right:12px; bottom:12px; z-index:7; background:rgba(0,0,0,.82); color:#fff; border-radius:10px; padding:10px 14px; font-size:13px; line-height:1.4; text-align:center; pointer-events:none; }

/* Staff-only notes on the player */
#amum-video-modal .amum-staff-note{position:absolute;left:8px;right:8px;top:8px;z-index:6;background:rgba(245,158,11,.92);color:#111;font-size:12px;line-height:1.4;padding:6px 10px;border-radius:6px;pointer-events:none}
#amum-video-modal .amum-fix-link{display:inline-block;background:#2563eb;color:#fff!important;padding:8px 14px;border-radius:8px;text-decoration:none;font-size:13px;font-weight:600}

/* ===== Own bottom bar: seek, time, mute, fullscreen (no native controls on video) ===== */
#amum-video-player video::-webkit-media-controls,
#amum-video-player video::-webkit-media-controls-enclosure,
#amum-video-player video::-webkit-media-controls-panel { display: none !important; -webkit-appearance: none; }
.amum-player-bar {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
    display: flex; align-items: center; gap: 8px; padding: 18px 10px 8px;
    background: linear-gradient(to top, rgba(0,0,0,.75), rgba(0,0,0,0));
    transition: opacity .35s ease;
}
.amum-player-bar .amum-seek {
    -webkit-appearance: none; appearance: none; flex: 1 1 auto; min-width: 0; height: 4px; border-radius: 4px;
    background: rgba(255,255,255,.3); outline: none; margin: 0; padding: 0; border: 0 !important; box-shadow: none !important; cursor: pointer;
}
.amum-player-bar .amum-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; }
.amum-player-bar .amum-seek::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; }
.amum-player-bar .amum-time { color: #fff; font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; text-shadow: 0 1px 3px #000; }
.amum-player-ctrl-btn.amum-bar-btn, .amum-bar-btn { width: 36px !important; height: 36px !important; flex: 0 0 auto; }
.amum-player-bar .amum-player-ctrl-btn svg { width: 62%; height: 62%; }

/* ===== Info panel: icon-only actions, the word shows on hover ===== */
#amum-video-modal .amum-icon-row { display: flex; flex-wrap: wrap; gap: 10px; padding: 8px 0; border: 0; }
#amum-video-modal .amum-icon-btn {
    position: relative; display: inline-flex !important; align-items: center; justify-content: center; gap: 6px;
    min-width: 46px; height: 42px; padding: 0 12px !important; flex: 0 0 auto !important;
    border-radius: 999px; font-size: 18px; line-height: 1; text-decoration: none; color: #e2e8f0;
}
#amum-video-modal .amum-icon-btn .amum-ico { font-size: 19px; line-height: 1; }
#amum-video-modal .amum-icon-btn .amum-ico-count { font-size: 12px; color: #94a3b8; font-variant-numeric: tabular-nums; }
#amum-video-modal .amum-icon-btn[data-label]::after {
    content: attr(data-label); position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%);
    background: #0b0e14; color: #e2e8f0; border: 1px solid rgba(255,255,255,.15); padding: 2px 8px; border-radius: 6px;
    font-size: 11px; font-weight: 500; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s ease; z-index: 20;
}
#amum-video-modal .amum-icon-btn:hover::after, #amum-video-modal .amum-icon-btn:focus-visible::after { opacity: 1; }

/* Share: only the word until hovered / tapped */
#amum-video-modal #amum-modal-share-row { margin: 4px 0 10px; }
#amum-video-modal .amum-share-wrap { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 4px 0; }
#amum-video-modal .amum-share-label { cursor: pointer; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); color: #e2e8f0; font-size: 13px; }
#amum-video-modal .amum-share-wrap .amum-share-btns,
#amum-video-modal .amum-share-wrap .amum-share-total { display: none; }
#amum-video-modal .amum-share-wrap:hover .amum-share-btns,
#amum-video-modal .amum-share-wrap.amum-open .amum-share-btns,
#amum-video-modal .amum-share-wrap:focus-within .amum-share-btns { display: flex; }
#amum-video-modal .amum-share-wrap:hover .amum-share-total,
#amum-video-modal .amum-share-wrap.amum-open .amum-share-total { display: inline; }
#amum-video-modal .amum-share-btn { font-size: 0 !important; width: 36px; height: 36px; padding: 0 !important; justify-content: center; border-radius: 50%; }
#amum-video-modal .amum-share-btn svg { width: 18px; height: 18px; }
#amum-video-modal .amum-share-copy::before { content: "🔗"; font-size: 15px; }

/* ===== Live comments feed: always visible, new ones arrive at the bottom and push older ones up ===== */
#amum-video-modal .amum-feed-panel { display: block !important; border-top: 1px solid rgba(255,255,255,.08); padding-top: 10px; margin-top: 6px; }
#amum-video-modal .amum-feed-panel .amum-comments-header { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 8px; }
#amum-video-modal .amum-feed-count { color: #94a3b8; font-weight: 600; }
#amum-video-modal .amum-live-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: amumLivePulse 1.8s infinite; }
@keyframes amumLivePulse { 70% { box-shadow: 0 0 0 7px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
#amum-video-modal .amum-feed { display: flex; flex-direction: column; gap: 8px; max-height: 190px; min-height: 48px; overflow-y: auto; padding-right: 4px; scroll-behavior: auto; -webkit-overflow-scrolling: touch; }
#amum-video-modal .amum-feed-row { display: flex; gap: 8px; align-items: flex-start; }
#amum-video-modal .amum-feed-row img { width: 26px; height: 26px; border-radius: 50%; flex: 0 0 26px; object-fit: cover; }
#amum-video-modal .amum-feed-body { min-width: 0; font-size: 12.5px; line-height: 1.35; color: #cbd5e1; }
#amum-video-modal .amum-feed-body strong { color: #e2e8f0; font-size: 12px; }
#amum-video-modal .amum-feed-time { color: #64748b; font-size: 10.5px; }
#amum-video-modal .amum-feed-body p { margin: 1px 0 0; word-wrap: break-word; overflow-wrap: anywhere; }
#amum-video-modal .amum-feed-empty { font-size: 12px; color: #64748b; margin: 6px 0; }
#amum-video-modal .amum-feed-new { animation: amumFeedIn .45s ease-out; }
@keyframes amumFeedIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
#amum-video-modal .amum-feed-form { display: flex; gap: 6px; align-items: flex-end; margin-top: 8px; }
#amum-video-modal .amum-feed-form textarea { flex: 1 1 auto; min-width: 0; resize: none; border-radius: 18px; padding: 8px 12px; font-size: 13px; }
#amum-video-modal .amum-feed-form .amum-btn-post { flex: 0 0 auto; width: 38px; height: 38px; padding: 0 !important; border-radius: 50% !important; font-size: 15px; }

/* The faded state switches clicks off with !important — the hover/tap reveal must beat it
   (otherwise the buttons look visible on hover but do nothing: mute, full screen, seek...). */
@media (hover: hover) and (pointer: fine) {
    .amum-player-controls.amum-controls-playing.amum-hover-on .amum-player-ctrl-btn,
    .amum-player-bar.amum-controls-playing.amum-hover-on .amum-player-ctrl-btn,
    .amum-player-bar.amum-controls-playing.amum-hover-on .amum-seek { pointer-events: auto !important; }
}
.amum-player-bar .amum-seek-wrap { position: relative; flex: 1 1 auto; min-width: 0; display: flex; align-items: center; height: 28px; }
.amum-player-bar .amum-seek { width: 100%; height: 5px; touch-action: none; }
.amum-player-bar .amum-seek::-webkit-slider-thumb { width: 16px; height: 16px; }
.amum-seek-preview {
    position: absolute; bottom: 30px; left: 0; width: 168px; transform: translateX(-50%); display: none;
    background: #000; border: 2px solid #fff; border-radius: 8px; overflow: hidden; pointer-events: none; z-index: 8;
    box-shadow: 0 4px 14px rgba(0,0,0,.6);
}
.amum-seek-preview.show { display: block; }
.amum-seek-preview video { display: block; width: 100%; height: 94px; object-fit: cover; background: #111; }
.amum-seek-preview .amum-seek-time { display: block; text-align: center; color: #fff; font-size: 12px; padding: 2px 0 3px; background: rgba(0,0,0,.85); font-variant-numeric: tabular-nums; }

/* Mouse idle over the player (esp. full screen) -> the pointer hides too */
.amum-video-player.amum-idle { cursor: none; }
