﻿/* ------------------------------------------------------
   NEO-GLASS NEON GLOW — FULL WOW STYLE
------------------------------------------------------ */

body {
    background: radial-gradient(circle at 20% 20%, #1a1a1f, #0d0d12 60%, #000000 100%) !important;
    font-family: 'Inter','Segoe UI',sans-serif;
    color: #e5faff;
    overflow-x: hidden;
}

/* כותרות */
h1, .country-title, .genre-title {
    font-size: 32px !important;
    font-weight: 800;
    color: #b4e7ff !important;
    letter-spacing: 1px;
    text-shadow: 0 0 12px rgba(0, 255, 255, 0.35), 0 0 22px rgba(0, 150, 255, 0.25);
    margin-bottom: 25px;
}

/* כפתור חזרה */
.back-button {
    color: #5af7ff !important;
    font-weight: 600;
    font-size: 18px;
    text-decoration: none;
    text-shadow: 0 0 10px rgba(0,255,255,0.4);
}

    .back-button:hover {
        color: #9affff !important;
        text-shadow: 0 0 14px rgba(0,255,255,0.6);
    }

/* ------------------------------------------------------
   VIDEO CARD
------------------------------------------------------ */

.video-card {
    position: relative;
    border-radius: 20px !important;
    padding: 10px;
    background: rgba(255, 255, 255, 0.06) !important;
    backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 255, 255, 0.28) !important;
    box-shadow: inset 0 0 18px rgba(0, 255, 255, 0.15), 0 0 22px rgba(0, 255, 255, 0.18), 0 8px 28px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    transition: transform .35s cubic-bezier(.19,1,.22,1);
    scroll-margin-top: 76px; /* keeps the card clear of the fixed 60px header when jumped to */
}

    .video-card:hover {
        transform: translateY(-10px) scale(1.04);
    }

.video-thumb {
    width: 100%;
    border-radius: 14px;
    display: block;
}

/* ------------------------------------------------------
   PLAY ICON — overlay on thumbnail before playback
   Always visible (works on touch/mobile), brightens on hover (desktop)
------------------------------------------------------ */

.play-icon {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    aspect-ratio: 4 / 3;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 5;
    background: rgba(0, 0, 0, 0);
    opacity: 0;
    transition: opacity 0.25s ease, background 0.25s ease;
}

.video-card:hover .play-icon {
    opacity: 1;
    background: rgba(0, 0, 0, 0.35);
}

.play-icon::before {
    content: "";
    position: absolute;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    border: 2px solid rgba(255, 255, 255, 0.65);
    transition: transform 0.25s ease;
}

.video-card:hover .play-icon::before {
    transform: scale(1.1);
}

.play-icon::after {
    content: "";
    position: relative;
    z-index: 1;
    width: 0;
    height: 0;
    margin-left: 6px; /* optical centering of the triangle inside the circle */
    border-style: solid;
    border-width: 12px 0 12px 20px;
    border-color: transparent transparent transparent #ffffff;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.video-title {
    color: #c2f9ff !important;
    font-size: 16px !important;
    font-weight: 600;
    margin-top: 12px;
    margin-bottom: 32px;
}

.favorite-btn {
    position: absolute;
    bottom: 10px;
    right: 12px;
    font-size: 24px;
    cursor: pointer;
}

/* ------------------------------------------------------
   RATING BUTTONS (Like / Dislike / Neutral)
------------------------------------------------------ */

.rating-btns {
    position: absolute;
    bottom: 10px;
    left: 12px;
    display: flex;
    gap: 6px;
}

.rating-btn {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.15s;
}

    .rating-btn:hover {
        opacity: 1;
        transform: scale(1.15);
    }

    .rating-btn.active {
        opacity: 1;
        border-color: rgba(255, 255, 255, 0.5);
        background: rgba(255, 255, 255, 0.15);
    }

/* מסגרות דירוג */
.video-card.rated-like {
    border: 2px solid rgba(0, 220, 80, 0.8) !important;
    box-shadow: inset 0 0 18px rgba(0, 220, 80, 0.15), 0 0 22px rgba(0, 220, 80, 0.25), 0 8px 28px rgba(0, 0, 0, 0.6) !important;
}

.video-card.rated-dislike {
    border: 2px solid rgba(220, 50, 50, 0.8) !important;
    box-shadow: inset 0 0 18px rgba(220, 50, 50, 0.15), 0 0 22px rgba(220, 50, 50, 0.25), 0 8px 28px rgba(0, 0, 0, 0.6) !important;
}

.video-card.rated-neutral {
    border: 2px solid rgba(250, 200, 0, 0.8) !important;
    box-shadow: inset 0 0 18px rgba(250, 200, 0, 0.15), 0 0 22px rgba(250, 200, 0, 0.25), 0 8px 28px rgba(0, 0, 0, 0.6) !important;
}

.video-wrapper {
    position: relative;
    width: 100%;
}

/* ------------------------------------------------------
   GRID
------------------------------------------------------ */

.video-grid {
    position: relative;
    display: grid !important;
    gap: 26px !important;
    padding: 20px 8px;
}

@media (min-width: 768px) {
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
    }
}

/* ------------------------------------------------------
   COMPACT GRID VIEW (מובייל בלבד) — טוגל 1 ↔ 4 סרטונים בשורה
   נוסף 30/08/2026 עבור עמודי קולקשן/Recommended/Search Results/
   Favorites בלבד (לא דף הבית — לדף הבית יש פריסת שורות נפרדת
   ולא נוגעים בו). מופעל ע"י #compact-grid-toggle-btn
   (js/compactGrid.js), שמוסיף/מוריד את המחלקה body.compact-grid-view.

   תוקן 31/08/2026: בהתחלה הותנה כאן לפי רוחב מסך (max-width:600px,
   כמו רוב שאר הדף) — אבל זה נשבר בסיבוב טלפון לרוחב (landscape),
   כי אז הרוחב בפועל קופץ הרבה מעל 600px וכל הבלוק הזה הפסיק לחול.
   הוחלף בבדיקת יכולת-מגע (hover:none + pointer:coarse) — אותה שיטה
   בדיוק שה-JS isMobile() כבר משתמש בה בכל האתר (VideoGrid.js,
   RecommendedVideos.js, favorites.js, SearchResults) — כי היא בודקת
   "האם זה מכשיר מגע" ולא "כמה רחב המסך כרגע", ולכן לא תלויה בכיוון.
------------------------------------------------------ */

@media (hover: none) and (pointer: coarse) {
    body.compact-grid-view .video-grid,
    body.compact-grid-view .sr-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 6px !important;
        padding: 10px 4px !important;
    }

    /* מכווץ כל כרטיסייה כדי ש-4 ייכנסו בנוחות בשורה */
    body.compact-grid-view .video-card {
        padding: 4px;
        border-radius: 8px !important;
    }

    body.compact-grid-view .video-title {
        font-size: 9px !important;
        margin-top: 4px;
        margin-bottom: 18px;
        line-height: 1.15;
        /* קיצוץ לשתי שורות כדי שכותרת ארוכה לא תנפח את גובה הכרטיסייה */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    body.compact-grid-view .sr-label {
        font-size: 7px;
        margin-top: 2px;
        margin-bottom: 4px;
    }

    body.compact-grid-view .favorite-btn {
        font-size: 13px;
        bottom: 3px;
        right: 4px;
    }

    body.compact-grid-view .rating-btns {
        bottom: 3px;
        left: 4px;
        gap: 3px;
    }

    body.compact-grid-view .rating-btn {
        width: 16px;
        height: 16px;
        font-size: 8px;
    }

    body.compact-grid-view .play-icon::before {
        width: 26px;
        height: 26px;
    }

    body.compact-grid-view .play-icon::after {
        border-width: 6px 0 6px 10px;
        margin-left: 3px;
    }

    /* כרטיסייה שמנגנת כרגע (זוהה לפי iframe בפועל בפנים — עובד גם
       ב-Favorites, ששם לחיצה ידנית על סרטון לא תמיד מוסיפה את
       is-playing) חוזרת תמיד לרוחב מלא וגודל רגיל, בלי קשר למצב
       הקומפקטי — נגן ברוחב רבע-שורה היה בלתי שמיש. */
    body.compact-grid-view .video-card:has(iframe) {
        grid-column: 1 / -1;
        padding: 10px 10px 54px 10px;
        border-radius: 20px !important;
    }

    body.compact-grid-view .video-card:has(iframe) .video-title {
        font-size: 16px !important;
        margin-top: 12px;
        margin-bottom: 32px;
        -webkit-line-clamp: unset;
    }

    body.compact-grid-view .video-card:has(iframe) .sr-label {
        font-size: 0.68rem;
        margin-top: -20px;
        margin-bottom: 12px;
    }

    body.compact-grid-view .video-card:has(iframe) .favorite-btn {
        font-size: 24px;
        bottom: 10px;
        right: 12px;
    }

    body.compact-grid-view .video-card:has(iframe) .rating-btns {
        bottom: 10px;
        left: 12px;
        gap: 6px;
    }

    body.compact-grid-view .video-card:has(iframe) .rating-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
}

/* ------------------------------------------------------
   Background glow
------------------------------------------------------ */

body::before {
    content: "";
    position: fixed;
    top: -200px;
    right: -200px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0,255,255,0.25), transparent 70%);
    filter: blur(80px);
    z-index: -1;
}

/* ======================================================
   CINEMATIC SILENCE
====================================================== */

.cinema-overlay {
    position: absolute;
    inset: 0;
    backdrop-filter: blur(14px);
    background: radial-gradient(circle at center, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 60%, rgba(0,0,0,0.9) 100%);
    z-index: 1;
    animation: cinemaFadeIn 1.2s ease forwards;
}

.silence-screen {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    text-align: center;
    position: relative;
    z-index: 2;
}

.coming-soon {
    margin-bottom: 40px;
    font-size: 1rem;
    letter-spacing: 3px;
    opacity: 0;
    animation: fadeInText 1.4s ease forwards;
}

/* ======================================================
   VINYL RECORD — realistic grooves + label + hole
====================================================== */

.vinyl {
    width: 210px;
    height: 210px;
    border-radius: 50%;
    background: radial-gradient(circle at center, #0a0a0a 0%, #000 4.2%, transparent 4.8%), radial-gradient(circle at center, #12082a 4.8%, #1c0d3a 14%, #22104a 24%, rgba(0,255,255,0.12) 26.2%, transparent 27% ), repeating-radial-gradient(circle at center, #050505 27%, #1a1a1a 28%, #0a0a0a 29.5%, #141414 30.5%, #050505 32% );
    border: 1px solid rgba(0,255,255,0.14);
    margin-bottom: 40px;
    animation: vinylSpin 18s linear infinite;
    box-shadow: 0 0 60px rgba(0,255,255,0.25), 0 0 0 3px rgba(0,0,0,0.8), 0 0 0 5px rgba(255,255,255,0.04);
    position: relative;
}

    .vinyl::after {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: 50%;
        background: linear-gradient( 120deg, transparent 35%, rgba(255,255,255,0.18) 50%, transparent 65% );
        animation: glossSweep 7s linear infinite;
        pointer-events: none;
    }

.vinyl-gloss {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(90,247,255,0.22) 0%, transparent 70%);
    border: 1px solid rgba(90,247,255,0.25);
    pointer-events: none;
}

/* ------------------------------------------------------
   SILENCE TEXT + DOT
------------------------------------------------------ */

.silence-text h1 {
    font-size: 3rem;
    margin: 0;
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    animation: fadeInText 2.2s ease forwards;
}

.silence-text h2 {
    font-size: 1.4rem;
    margin-top: 12px;
    opacity: 0;
    animation: fadeInText 3s ease forwards;
}

.silence-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #00ffff;
    box-shadow: 0 0 8px #00ffff, 0 0 16px rgba(0,255,255,0.4);
    flex-shrink: 0;
    animation: silenceDotPulse 1.4s ease-in-out infinite;
}

@keyframes silenceDotPulse {
    0%, 100% {
        opacity: 0.25;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(2);
    }
}

@keyframes vinylSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes glossSweep {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeInText {
    to {
        opacity: 1;
    }
}

@keyframes cinemaFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ------------------------------------------------------
   VIDEO HOVER CARD
------------------------------------------------------ */

.video-hover-card {
    position: fixed;
    width: 340px;
    max-width: 92%;
    background: rgba(10, 25, 32, 0.92);
    backdrop-filter: blur(18px);
    padding: 18px 22px;
    border-radius: 16px;
    border: 1px solid rgba(0,255,255,0.28);
    box-shadow: 0 0 22px rgba(0,255,255,0.25), inset 0 0 35px rgba(0,255,255,0.18), 0 8px 28px rgba(0,0,0,0.55);
    color: #dffaff;
    font-size: 14px;
    line-height: 1.45;
    z-index: 999999;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity .25s ease, transform .25s ease;
}

    .video-hover-card.visible {
        opacity: 1;
        transform: translateY(0);
        pointer-events: all;
    }

.hover-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #8ffbff;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(0,255,255,0.45);
}

.hover-card-text {
    font-size: 14px;
    white-space: pre-line;
    opacity: 0.9;
    line-height: 1.55;
}

.hover-card-empty {
    font-size: 13px;
    opacity: 0.55;
    font-style: italic;
}

/* ------------------------------------------------------
   INFO BUTTON
------------------------------------------------------ */

.info-btn, .fav-info-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(0, 255, 255, 0.35);
    color: #5af7ff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0.7;
    transition: opacity 0.2s ease, background 0.2s ease;
}

    .info-btn:hover, .fav-info-btn:hover {
        opacity: 1;
        background: rgba(0, 255, 255, 0.18);
    }

/* ------------------------------------------------------
   INFO POPUP — דסקטופ
------------------------------------------------------ */

.video-hover-card.popup-desktop {
    width: 300px;
    max-width: 92vw;
    max-height: 70vh;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,255,255,0.3) transparent;
}

    .video-hover-card.popup-desktop.expanded {
        overflow-y: auto;
    }

    .video-hover-card.popup-desktop::-webkit-scrollbar {
        width: 4px;
    }

    .video-hover-card.popup-desktop::-webkit-scrollbar-track {
        background: transparent;
    }

    .video-hover-card.popup-desktop::-webkit-scrollbar-thumb {
        background: rgba(0,255,255,0.3);
        border-radius: 4px;
    }

/* ------------------------------------------------------
   INFO POPUP — מובייל
------------------------------------------------------ */

.video-hover-card.popup-mobile {
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) translateY(6px);
    width: 88vw;
    max-width: 420px;
    max-height: 75vh;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,255,255,0.3) transparent;
}

    .video-hover-card.popup-mobile.expanded {
        overflow-y: auto;
    }

    .video-hover-card.popup-mobile::-webkit-scrollbar {
        width: 4px;
    }

    .video-hover-card.popup-mobile::-webkit-scrollbar-thumb {
        background: rgba(0,255,255,0.3);
        border-radius: 4px;
    }

    .video-hover-card.popup-mobile.visible {
        transform: translate(-50%, -50%) translateY(0);
    }

/* ------------------------------------------------------
   כפתור סגירה בפופאפ
------------------------------------------------------ */

.info-popup-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    color: #5af7ff;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.7;
    line-height: 1;
    padding: 0;
    z-index: 10;
}

    .info-popup-close:hover {
        opacity: 1;
    }

.info-popup-inner {
    padding-right: 18px;
}

/* ------------------------------------------------------
   SHOW MORE BUTTON
------------------------------------------------------ */

.show-more-btn {
    display: inline-block;
    margin-top: 8px;
    background: none;
    border: none;
    color: #5af7ff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 0;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.4);
}

    .show-more-btn:hover {
        color: #9affff;
    }

/* ------------------------------------------------------
   COMPLETION BAR
------------------------------------------------------ */

.completion-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    width: 50%;
}

.completion-bar-bg {
    flex: 1;
    height: 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.completion-bar-fill {
    height: 100%;
    width: 0%;
    background: #5af7ff;
    border-radius: 999px;
    transition: width 0.6s ease, background 0.6s ease;
    box-shadow: 0 0 10px rgba(90, 247, 255, 0.4);
}

.completion-label {
    font-size: 0.8rem;
    color: #e5faff;
    white-space: nowrap;
    transition: color 0.4s ease;
}

/* ------------------------------------------------------
   IS PLAYING
------------------------------------------------------ */

.video-card.is-playing {
    border: 2px solid rgba(90, 247, 255, 0.9) !important;
    box-shadow: inset 0 0 22px rgba(90, 247, 255, 0.2), 0 0 30px rgba(90, 247, 255, 0.4), 0 8px 28px rgba(0, 0, 0, 0.6) !important;
    transform: translateY(-6px) scale(1.02);
    padding-bottom: 54px;
}

.now-playing-badge {
    display: inline-block;
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(90, 247, 255, 0.5);
    color: #5af7ff;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    animation: pulseBadge 2s ease-in-out infinite;
}

@keyframes pulseBadge {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.55;
    }
}

/* ------------------------------------------------------
   FLOATING PLAY ALL WIDGET (visible while scrolled past
   the main Play All controls)
------------------------------------------------------ */

#floating-playall {
    display: none;
    position: fixed;
    top: 95px;
    left: 28px;
    z-index: 1500;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(10, 25, 32, 0.92);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(0, 255, 255, 0.35);
    border-radius: 14px;
    box-shadow: 0 0 22px rgba(0, 255, 255, 0.25), 0 8px 28px rgba(0, 0, 0, 0.55);
    max-width: calc(100vw - 24px);
}

@media (max-width: 600px) {
    #floating-playall {
        /* מתחת ל-header (60px) + לשורת ה-Now Playing של הנייד (22px),
           לא מעליה — אחרת הוא מסתיר את הטקסט של מה שמתנגן עכשיו */
        top: 90px;
        left: 12px;
        gap: 6px;
        padding: 8px 10px;
        border-radius: 12px;
    }

        #floating-playall .pa-btn {
            padding: 8px 10px;
            font-size: 0.85rem;
        }

    .pa-stop-label {
        display: none;
    }
}

/* ------------------------------------------------------
   PLAY ALL CONTROLS
------------------------------------------------------ */

.playall-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    min-height: 42px;
    align-items: center;
    position: relative;
}

/* כל עוד Play All לא פעיל: prev/next/pin לא רק מוסתרים (visibility)
   אלא גם לא תופסים מקום (display), כדי שכפתור ה-Play All וכפתור
   השאפל (שמתווסף אחריהם ע"י VideoGrid.js) יישארו צמודים באותה
   שורה — בכל רוחב מסך, כולל דסקטופ. ברגע שלוחצים Play All ומתווסף
   pa-active ל-body, הם חוזרים להתנהג כרגיל. */
body:not(.pa-active) #pa-prev-btn,
body:not(.pa-active) #pa-next-btn,
body:not(.pa-active) #pa-pin-btn {
    display: none;
}

.pa-btn {
    background: rgba(0, 255, 255, 0.08);
    border: 1px solid rgba(0, 255, 255, 0.35);
    color: #5af7ff;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

    .pa-btn:hover {
        background: rgba(0, 255, 255, 0.18);
    }

/* כפתור טוגל התצוגה הקומפקטית (js/compactGrid.js) — מוצג רק במובייל.
   חשוב: כלל ה"כבוי" חייב לבוא לפני ה-media query שמדליק אותו מחדש —
   לשתי המחלקות אותה ספציפיות, ו-CSS נותן לכלל התואם המאוחר יותר
   לנצח; סדר הפוך היה משאיר את הכפתור מוסתר גם במובייל.
   מזוהה לפי יכולת-מגע (hover:none+pointer:coarse), לא לפי רוחב מסך —
   ר' הסבר מלא בסקשן COMPACT GRID VIEW למעלה (תוקן 31/08/2026 בעקבות
   באג בסיבוב טלפון לרוחב). */
#compact-grid-toggle-btn {
    display: none;
}

@media (hover: none) and (pointer: coarse) {
    #compact-grid-toggle-btn {
        display: inline-flex;
    }
}

.pa-stop {
    background: rgba(192, 57, 43, 0.2);
    border-color: #c0392b;
    color: #e74c3c;
}

/* ------------------------------------------------------
   TOOLTIP מותאם-אישית לכפתור 📍 — מוצג מתחת לכפתור (לא
   בצד, כי בצד ימין יש את כפתור השאפל ובצד שמאל את שאר
   כפתורי ה-Play All) כדי שלא יסתיר ויזואלית אף כפתור שכן
------------------------------------------------------ */
.pa-btn.pa-pin {
    position: relative;
}

.pa-tooltip {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 25, 32, 0.95);
    color: #dffaff;
    font-size: 0.75rem;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid rgba(0, 255, 255, 0.35);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 2000;
}

.pa-btn.pa-pin:hover .pa-tooltip {
    opacity: 1;
}

body[data-theme="light"] .pa-tooltip {
    background: #fff;
    border: 1px solid #c9a84c;
    color: #333;
}

/* כפתור סגירה זמנית ל-widget הצף של Play All — ברירת מחדל מוסתר;
   playAll.js (דפי אוסף) ו-favorites.js (Favorites) חושפים ומחברים אותו. */
#floating-playall .fp-close-btn {
    display: none;
    background: none;
    border: none;
    color: #5af7ff;
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 6px;
    opacity: 0.65;
    transition: opacity 0.2s;
}

    #floating-playall .fp-close-btn:hover {
        opacity: 1;
    }

body[data-theme="light"] #floating-playall .fp-close-btn {
    color: #c9a84c;
}

.stop-playing-btn {
    background: none;
    border: none;
    color: #5af7ff;
    font-size: 12px;
    cursor: pointer;
    padding: 0 0 0 6px;
    opacity: 0.7;
    vertical-align: middle;
    line-height: 1;
}

    .stop-playing-btn:hover {
        opacity: 1;
    }

/* ------------------------------------------------------
   MOBILE
------------------------------------------------------ */

@media (max-width: 600px) {
    #now-playing-wrap,
    #now-playing-sep,
    #header-completion-wrap {
        display: none !important;
    }
}

@media (min-width: 601px) {
    #mobile-bar-wrap {
        display: none !important;
    }
}

@media (max-width: 600px) {
    /* בדסקטופ אחוז ההשלמה יושב בהדר הקבוע (#header-completion-wrap) ולכן
       תמיד נגיש. בנייד הוא חי בתוך תוכן הדף (ליד "Back to...") ולכן
       נעלם כשגוללים מטה — נותן אותו טיפול כמו ל-#mobile-now-playing-bar
       ול-#floating-playall: מקבע אותו לפינה כדי שיישאר גלוי תמיד. */
    #mobile-bar-wrap {
        position: fixed;
        top: 90px;
        right: 12px;
        z-index: 1400;
        background: rgba(10, 25, 32, 0.92);
        backdrop-filter: blur(12px);
        border: 1px solid rgba(0, 255, 255, 0.3);
        border-radius: 999px;
        padding: 6px 12px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
        touch-action: none; /* אנחנו שולטים בגרירה בעצמנו, לא הדפדפן */
    }

    /* גם ה-widget הצף של Play All ניתן לגרירה בנייד */
    #floating-playall {
        touch-action: none;
    }

    /* כפתור ✕ קטן שיושב על הפינה של בר ההתקדמות בנייד בלבד —
       ממוקם ביחס ל-#mobile-bar-wrap עצמו, כי position:fixed שם
       כבר מהווה containing block לילדים עם position:absolute */
    .mobile-widget-close {
        position: absolute;
        top: -7px;
        right: -7px;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background: rgba(10, 25, 32, 0.95);
        border: 1px solid rgba(0, 255, 255, 0.4);
        color: #5af7ff;
        font-size: 10px;
        line-height: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        padding: 0;
        z-index: 1;
    }
}

/* ── כותרת + כפתורים באותה שורה ── */
.playall-header-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

@media (max-width: 600px) {
    .playall-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .playall-controls {
        flex-wrap: wrap;
        row-gap: 8px;
    }

    .pa-tooltip {
        display: none;
    }
}

h1.page-inline-title {
    flex: 1;
    min-width: 0;
    margin: 0 !important;
    font-size: clamp(18px, 5vw, 32px) !important;
    line-height: 1.2;
    overflow-wrap: break-word;
    word-break: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 600px) {
    h1.page-inline-title {
        font-size: 20px !important;
    }
}

/* בדסקטופ בלבד: מיישר את שורת Play All/Shuffled עם ה-padding הפנימי
   של video-grid (20px 8px — ר' section GRID למעלה), כך שהכפתורים
   יתחילו באותו קו אנכי כמו הכרטיסייה הראשונה בגריד. וניסיון ראשון
   לצמצם רושם אופטי של הכותרת כ"נמוכה מדי" ביחס לכפתורים — אם עדיין
   נראה נמוך, אפשר להגדיל את הערך. */
@media (min-width: 601px) {
    .playall-header-row {
        padding-left: 8px;
    }

    h1.page-inline-title {
        margin-top: -3px !important;
    }
}

/* ======================================================
   LIGHT THEME OVERRIDES
====================================================== */

body[data-theme="light"] {
    background: #f5f5f5 !important;
    color: #222;
}

    body[data-theme="light"] h1,
    body[data-theme="light"] .country-title,
    body[data-theme="light"] .genre-title {
        color: #222 !important;
        text-shadow: none;
    }

    body[data-theme="light"] .back-button {
        color: #c9a84c !important;
        text-shadow: none;
    }

        body[data-theme="light"] .back-button:hover {
            color: #a07830 !important;
            text-shadow: none;
        }

    body[data-theme="light"] .video-card {
        background: #ffffff !important;
        border: 1px solid #e4e4e4 !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.07) !important;
        backdrop-filter: none;
    }

    body[data-theme="light"] .video-title {
        color: #222 !important;
    }

    body[data-theme="light"] .rating-btn {
        background: #f5f5f5;
        border: 1px solid #e0e0e0;
    }

        body[data-theme="light"] .rating-btn.active {
            border-color: #c9a84c;
            background: #fdf6e3;
        }

    body[data-theme="light"] body::before {
        display: none;
    }

    body[data-theme="light"] .video-hover-card {
        background: #ffffff;
        border: 1px solid #e0e0e0;
        box-shadow: 0 8px 32px rgba(0,0,0,0.12);
        color: #222;
        backdrop-filter: none;
    }

    body[data-theme="light"] .hover-card-title {
        color: #c9a84c;
        text-shadow: none;
    }

    body[data-theme="light"] .info-popup-close {
        color: #999;
    }

    body[data-theme="light"] .show-more-btn {
        color: #c9a84c;
        text-shadow: none;
    }

        body[data-theme="light"] .show-more-btn:hover {
            color: #a07830;
        }

    body[data-theme="light"] .completion-bar-bg {
        background: #e8e8e8;
        border: 1px solid #ddd;
    }

    body[data-theme="light"] .completion-bar-fill {
        background: #c9a84c;
        box-shadow: none;
    }

    body[data-theme="light"] .completion-label {
        color: #555;
    }

    body[data-theme="light"] .video-card.is-playing {
        border: 2px solid #c9a84c !important;
        box-shadow: 0 0 16px rgba(201,168,76,0.25), 0 4px 16px rgba(0,0,0,0.1) !important;
    }

    body[data-theme="light"] .now-playing-badge {
        background: #c9a84c;
        border: 1px solid #a07830;
        color: #fff;
    }

    body[data-theme="light"] .pa-btn {
        background: #fff;
        border: 1px solid #c9a84c;
        color: #c9a84c;
    }

        body[data-theme="light"] .pa-btn:hover {
            background: #fdf6e3;
        }

    body[data-theme="light"] .stop-playing-btn {
        color: #c9a84c;
    }

    body[data-theme="light"] .silence-dot {
        background: #c9a84c;
        box-shadow: 0 0 8px rgba(201,168,76,0.6);
    }

    body[data-theme="light"] .info-btn, body[data-theme="light"] .fav-info-btn {
        background: rgba(255,255,255,0.85);
        border: 1px solid #ddd;
        color: #c9a84c;
    }

        body[data-theme="light"] .info-btn:hover, body[data-theme="light"] .fav-info-btn:hover {
            background: #fff;
        }

    body[data-theme="light"] .video-hover-card.popup-desktop {
        scrollbar-color: rgba(0,0,0,0.2) transparent;
    }

        body[data-theme="light"] .video-hover-card.popup-desktop::-webkit-scrollbar-thumb,
        body[data-theme="light"] .video-hover-card.popup-mobile::-webkit-scrollbar-thumb {
            background: rgba(0,0,0,0.2);
        }
