﻿/* ============================
   Netflix ULTRA – Tiles Menu
   Perfect 1:1 Square Images
   ============================ */

body {
    background-color: #000;
    color: #fff;
    margin: 0;
    font-family: 'Karla', 'Segoe UI', sans-serif;
}

/* Grid layout */
.tiles-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

/* Tile wrapper */
.tile {
    text-decoration: none;
    color: #fff;
    position: relative;
    overflow: hidden; /* ⭐ תוספת חשובה */
    transition: 0.25s ease-in-out;
}

    /* Square image */
    .tile img {
        width: 100%;
        aspect-ratio: 1 / 1;
        object-fit: cover;
        border-radius: 12px;
        display: block; /* ⭐ מונע רווחים מוזרים מתחת לתמונה */
    }

    /* Title overlay */
    .tile span {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        padding: 9px 6px;
        background: rgba(0,0,0,0.55);
        color: #fff;
        font-family: 'Fraunces', 'Segoe UI', serif;
        font-size: 1.2rem;
        font-weight: 600;
        letter-spacing: -0.01em;
        text-align: center;
        z-index: 5;
    }

    /* Hover glow */
    .tile:hover {
        transform: scale(1.05);
        box-shadow: 0 0 12px rgba(0,255,255,0.6), 0 0 24px rgba(0,255,255,0.35), 0 0 38px rgba(0,255,255,0.25);
    }

/* RESPONSIVE */
@media (max-width: 1400px) {
    .tiles-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1000px) {
    .tiles-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 700px) {
    .tiles-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 450px) {
    .tiles-container {
        grid-template-columns: repeat(1, 1fr);
    }
}


/* ------------------------------------------------------
   COMPACT GRID VIEW (מובייל בלבד) — טוגל 1 ↔ 4 בשורה
   נוסף 08/09/2026, לבקשת המשתמש: אותו מנגנון בדיוק שכבר קיים
   בעמודי הוידאו (js/compactGrid.js + מחלקת body.compact-grid-view,
   ר' הסבר מלא ב-videopages.css) — הכפתור עצמו (#compact-grid-toggle-btn)
   כבר מוגדר/מוסתר-בדסקטופ שם, וזה נטען גלובלית מ-_Layout.cshtml, אז
   אין צורך להגדיר אותו שוב כאן. מה שכן חסר בדפים האלה זה מקום להציב
   בו את הכפתור (compactGrid.js מחפש .playall-controls/.fav-controls-row/
   .tiles-controls-row) וכללי הגריד עצמם.

   עודכן 08/09/2026: .tiles-controls-row עוטף עכשיו גם את כותרת הדף
   עצמה (h1.page-title) — לא רק כפתור בשורה ריקה משלו — כדי שהכותרת
   (Countries/Genres/וכו') והכפתור יישבו על אותה שורה, כמו התבנית
   הקיימת ב-.playall-header-row בעמודי הווידאו (videopages.css), רק
   בלי קיפול לעמודה במובייל — כאן, דווקא במובייל, אנחנו כן רוצים
   שהם יישארו זה-לצד-זה.
------------------------------------------------------ */

.tiles-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
}

.tiles-controls-row .page-title {
    margin: 0;
    flex: 1;
    min-width: 0;
    /* !important כאן כי videopages.css (נטען גלובלית מ-_Layout.cshtml)
       מגדיר h1 { font-size: 46px !important } בשביל דפי אוסף — בלי זה
       הכותרת כאן לא הייתה מגיבה לרוחב המסך במובייל */
    font-size: clamp(20px, 6vw, 32px) !important;
    line-height: 1.2;
}

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

    /* מכווץ את הכותרת שמעל התמונה כדי שתיכנס בנוחות ב-1/4 מהרוחב,
       ולא תתפרש על רוב גובה האריח בכותרות ארוכות (למשל
       "Central African Republic" או "Alternative/Indie Rock") */
    body.compact-grid-view .tile img {
        border-radius: 6px;
    }

    body.compact-grid-view .tile span {
        font-size: 8px;
        padding: 3px 2px;
        line-height: 1.15;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}


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

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

    body[data-theme="light"] .tile:hover {
        box-shadow: 0 4px 20px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.10);
    }

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


/* ======================================================
   SHOW MORE — sparse collections (≤2 valid videos) are
   tagged data-count by SortAndFilterAll.js and hidden by
   showMoreTiles.js until this button reveals them.
====================================================== */

.tile.js-sparse-hidden {
    display: none;
}

.tiles-show-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.show-more-btn {
    background: transparent;
    border: 1px solid rgba(0,255,255,0.5);
    color: #5af7ff;
    padding: 9px 26px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: bold;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: 0.25s ease-in-out;
}

    .show-more-btn:hover {
        background: rgba(0,255,255,0.12);
        box-shadow: 0 0 14px rgba(0,255,255,0.35);
    }

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

    body[data-theme="light"] .show-more-btn:hover {
        background: rgba(201,168,76,0.12);
        box-shadow: none;
    }


/* ======================================================
   עיגולים בטלפון (30/09/2026): "במובייל בלבד - תהפוך את כל המקומות שיש
   בהם ריבועים - לדפים כמו בארטיסטס - ואז יהיה במניו אפשרות לשנות תצוגה
   מתצוגת עיגולים לתצוגת ריבועים ולהיפך".
   עד 600px, כל עוד לא נבחרו ריבועים (html.bc-squares, אייקון .mnav-shape
   בפס של _Layout.cshtml), הדפים Countries/Genres/Specials/BigTown/
   Recommended נראים בדיוק כמו Artists (Artists.css): כותרת עם מספר
   הפריטים, גריד של תמונות עגולות, שם ומספר שירים מתחת לכל תמונה.
   ה-markup של הדפים לא השתנה (SortAndFilterAll.js מייצר אותו): סקריפט
   ב-_Layout.cshtml עוטף כל תמונה ב-div.tile-photo ומוסיף div.tile-stat
   ו-span.tiles-count. div ולא span — כי ".tile span" הוא הכיתוב שעל
   הריבוע. במצב ריבועים ה-div עם display:contents, ואין שום שינוי.
   ברירת המחדל: עיגולים, בכל כניסה חדשה לאתר (sessionStorage).
   כפתור 1/4 בשורה מוסתר בעיגולים — ב-Artists אין אותו.
====================================================== */

.tile-photo { display: contents; }
.tile-stat, .tiles-count { display: none; }

@media (max-width: 600px) {
    html:not(.bc-squares) .tiles-controls-row {
        align-items: flex-end;
        flex-wrap: wrap;
        gap: 16px;
        margin-bottom: 30px;
    }
    html:not(.bc-squares) .tiles-controls-row .page-title {
        flex: 0 1 auto;
        font-size: 46px !important;
        line-height: normal;
    }
    html:not(.bc-squares) .tiles-controls-row #compact-grid-toggle-btn {
        display: none !important;
    }
    html:not(.bc-squares) .tiles-count {
        display: block;
        font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; letter-spacing: 0.06em;
        text-transform: uppercase; color: #5af7ff;
        background: rgba(90,247,255,0.14); border: 1px solid rgba(90,247,255,0.3);
        padding: 6px 14px; border-radius: 999px;
    }

    html:not(.bc-squares) .tiles-container {
        grid-template-columns: repeat(auto-fill, minmax(100px,1fr)) !important;
        gap: 22px 12px !important;
    }
    html:not(.bc-squares) .tiles-container .tile {
        display: flex; flex-direction: column; align-items: center; text-align: center;
        overflow: visible;
    }
    html:not(.bc-squares) .tiles-container .tile.js-sparse-hidden { display: none; }
    html:not(.bc-squares) .tiles-container .tile:hover {
        transform: none;
        box-shadow: none;
    }
    html:not(.bc-squares) .tiles-container .tile-photo {
        display: block;
        width: 86px; height: 86px; border-radius: 50%;
        overflow: hidden; position: relative;
        background: #14141a;
        border: 1px solid rgba(255,255,255,0.08);
        transition: 0.25s cubic-bezier(.19,1,.22,1);
    }
    html:not(.bc-squares) .tiles-container .tile:hover .tile-photo {
        transform: translateY(-4px) scale(1.035);
        border-color: rgba(90,247,255,0.55);
        box-shadow: 0 0 0 4px rgba(90,247,255,0.08), 0 14px 26px -10px rgba(0,0,0,0.7), 0 0 20px rgba(0,255,255,0.2);
    }
    html:not(.bc-squares) .tiles-container .tile img {
        width: 100%; height: 100%; aspect-ratio: auto;
        object-fit: cover; display: block; border-radius: 0;
        filter: saturate(1.08) brightness(0.94);
    }
    html:not(.bc-squares) .tiles-container .tile span {
        position: static; width: auto; padding: 0; background: none;
        margin-top: 12px;
        font-family: 'Fraunces','Segoe UI',serif; font-weight: 600; font-size: 14.5px;
        line-height: 1.25; letter-spacing: normal; color: #fff;
        display: block; overflow: visible; -webkit-line-clamp: unset;
    }
    html:not(.bc-squares) .tiles-container .tile-stat {
        margin-top: 4px; display: inline-flex; align-items: center; gap: 4px;
        font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; color: #9199a1;
    }
    html:not(.bc-squares) .tiles-container .tile-stat svg {
        width: 11px; height: 11px; stroke: currentColor; fill: none; stroke-width: 1.8;
    }

    /* תמה בהירה — כמו Artists.css */
    html:not(.bc-squares) body[data-theme="light"] .tiles-count {
        color: #a07830; background: rgba(201,168,76,0.12); border-color: rgba(201,168,76,0.35);
    }
    html:not(.bc-squares) body[data-theme="light"] .tiles-container .tile-photo { background: #ececec; border-color: #e0e0e0; }
    html:not(.bc-squares) body[data-theme="light"] .tiles-container .tile:hover .tile-photo {
        border-color: rgba(201,168,76,0.6);
        box-shadow: 0 0 0 4px rgba(201,168,76,0.1), 0 10px 22px -10px rgba(0,0,0,0.25);
    }
    html:not(.bc-squares) body[data-theme="light"] .tiles-container .tile span { color: #222; }
    html:not(.bc-squares) body[data-theme="light"] .tiles-container .tile-stat { color: #7a7a7a; }
}


/* ======================================================
   01/10/2026: כמה בשורה מחלונית ההגדרות (_Layout.cshtml, bcSettings).
   עיגולים: html[data-circle-cols] — בלי בחירה, לפי רוחב המסך כמו
   Artists; עם בחירה — בדיוק N בשורה, והתמונה גדלה/קטנה בהתאם.
   ריבועים: body[data-grid-cols] (compactGrid.js) — 4 כמו קודם, ועכשיו גם
   2 ו-3, עם כיתוב בגודל שמתאים לרוחב.
====================================================== */
@media (max-width: 600px) {
    html[data-circle-cols="1"]:not(.bc-squares) .tiles-container { grid-template-columns: 1fr !important; }
    html[data-circle-cols="2"]:not(.bc-squares) .tiles-container { grid-template-columns: repeat(2, 1fr) !important; }
    html[data-circle-cols="3"]:not(.bc-squares) .tiles-container { grid-template-columns: repeat(3, 1fr) !important; }
    html[data-circle-cols="4"]:not(.bc-squares) .tiles-container { grid-template-columns: repeat(4, 1fr) !important; gap: 18px 8px !important; }

    html[data-circle-cols="1"]:not(.bc-squares) .tiles-container .tile-photo { width: 150px; height: 150px; }
    html[data-circle-cols="1"]:not(.bc-squares) .tiles-container .tile span { font-size: 18px; }
    html[data-circle-cols="1"]:not(.bc-squares) .tiles-container .tile-stat { font-size: 12px; }
    html[data-circle-cols="2"]:not(.bc-squares) .tiles-container .tile-photo { width: 110px; height: 110px; }
    html[data-circle-cols="2"]:not(.bc-squares) .tiles-container .tile span { font-size: 15.5px; }
    html[data-circle-cols="4"]:not(.bc-squares) .tiles-container .tile-photo { width: 64px; height: 64px; }
    html[data-circle-cols="4"]:not(.bc-squares) .tiles-container .tile span { font-size: 12px; margin-top: 8px; overflow-wrap: anywhere; }
    html[data-circle-cols="4"]:not(.bc-squares) .tiles-container .tile-stat { font-size: 9.5px; }
}

@media (hover: none) and (pointer: coarse) {
    body.compact-grid-view[data-grid-cols="2"] .tiles-container { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
    body.compact-grid-view[data-grid-cols="2"] .tile img { border-radius: 10px; }
    body.compact-grid-view[data-grid-cols="2"] .tile span { font-size: 13px; padding: 6px 4px; line-height: 1.2; }
    body.compact-grid-view[data-grid-cols="3"] .tiles-container { grid-template-columns: repeat(3, 1fr) !important; gap: 8px; }
    body.compact-grid-view[data-grid-cols="3"] .tile img { border-radius: 8px; }
    body.compact-grid-view[data-grid-cols="3"] .tile span { font-size: 10.5px; padding: 4px 3px; line-height: 1.15; }
}
