/* NovelaStream — Mobile fixes (φορτώνεται ΤΕΛΕΥΤΑΙΟ, μετά το admin-mobile.css)
   Στόχος: τίποτα να μη ξεχειλίζει / κόβεται στο κινητό (σειρές, κατηγορίες, ηθοποιοί, νέα, ανακοινώσεις, hero, banner, φόρμες).
   Επηρεάζει ΜΟΝΟ οθόνες ≤ 768px (εκτός από τους γενικούς κανόνες ασφαλείας). Δεν αγγίζει το admin panel. */

/* ---------- 0. Γενική ασφάλεια: ποτέ οριζόντιο scroll στη σελίδα ---------- */
html, body { max-width: 100%; }
body { overflow-x: clip; }
img, video, canvas, svg { max-width: 100%; }
.slider-container, .app-actor-row, .rel-row, .actor-series-row { overscroll-behavior-x: contain; }

/* Μακριές λέξεις/τίτλοι δεν σπρώχνουν το layout */
.card-title, .card-meta, .category-title, .actor-name, .ap-name, .lm-title,
.news-carousel-title, .news-carousel-desc, .news-card-sm-title, .site-banner,
.hero-title, .nsb-title, .nsb-desc, .sp-name, .sp-bio, .nx-t, .nx-b {
  overflow-wrap: anywhere; word-break: break-word;
}

@media (max-width: 768px) {

  /* ---------- 1. Σειρές / κατηγορίες ---------- */
  .category-row { padding-left: 4%; padding-right: 4%; min-width: 0; }
  html body .category-title {
    font-size: 1.05rem; min-width: 0; flex: 1 1 auto;
    display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  /* γραμμή τίτλου + «Προβολή όλων»: ο τίτλος μικραίνει, το κουμπί μένει ορατό */
  .category-row > div:first-child:has(.category-title),
  .category-row > *:has(> .category-title) { min-width: 0; gap: 8px; }
  html body .view-all-link { flex: 0 0 auto; min-height: 40px; padding: 4px 4px; font-size: .78rem; }

  .slider-container { gap: 10px; scroll-snap-type: x proximity; }
  html body .category-row .slider-container { gap: 10px; padding: 6px 2px 12px; }

  /* Κάρτες: σταθερό πλάτος, τίποτα δεν προεξέχει */
  html body :is(.category-row,.lm-grid) .novela-card { flex: 0 0 150px; width: 150px; min-width: 0; scroll-snap-align: start; }
  html body :is(.category-row,.lm-grid) .novela-card.size-large { flex-basis: 165px; width: 165px; }
  html body .lm-grid .novela-card { width: 100%; flex: none; }          /* «Προβολή όλων»: 2 στήλες γεμάτες */
  html body :is(.category-row,.lm-grid) .novela-card:not(.top10-card) .card-title {
    font-size: .76rem; line-height: 1.25; min-height: 2.5em;
    -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden;
  }
  html body :is(.category-row,.lm-grid) .novela-card:not(.top10-card) .card-meta {
    font-size: .64rem; min-width: 0; flex-wrap: nowrap; overflow: hidden; white-space: nowrap;
  }
  .card-meta > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .card-badge, .card-movie-pill, .card-watched-badge { max-width: calc(100% - 12px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* Hover/tilt δεν έχουν νόημα στο άγγιγμα και προκαλούν «πηδήματα» */
  .novela-card:hover, .novela-card.tilt { transform: none !important; }

  /* Top 10 */
  html body .novela-card.top10-card { flex: 0 0 auto; width: auto; }
  html body :is(.category-row,.lm-grid) .novela-card.top10-card .card-img,
  html body :is(.category-row,.lm-grid) .novela-card.top10-card.size-large .card-img { width: 128px; }
  .top10-rank { font-size: 3.8rem; }

  /* ---------- 2. Ηθοποιοί ---------- */
  html body .actor-card { flex: 0 0 84px; min-width: 0; }
  html body .actor-img { width: 72px; height: 72px; }
  html body .actor-name,
  html body .app-actor-row .actor-name {
    font-size: .72rem; line-height: 1.25; max-width: 100%;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  html body .ap-name { font-size: .85rem; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  #actorListModalGrid .ap-card { min-width: 0; }

  /* ---------- 3. Hero (αρχική) ---------- */
  .hero-container { min-height: 280px; }
  .hero-content { max-width: 92%; box-sizing: border-box; }
  html body .hero-title {
    font-size: 1.45rem; max-width: 100%;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .hero-content .btn, .hero-content button { min-height: 40px; }

  /* ---------- 4. 2ο καρουζέλ (banner) ---------- */
  html body .nsb-title { font-size: 1.7rem; line-height: 1.1;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  html body .nsb-tags { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  html body .nsb-in { box-sizing: border-box; padding-bottom: 110px; }
  .nsb-meta { flex-wrap: wrap; }
  .nsb-btns { flex-wrap: wrap; gap: 8px; }
  .nsb-play, .nsb-add { min-height: 42px; }
  .nsb-thumbs { max-width: 92vw; overflow-x: auto; scrollbar-width: none; }
  .nsb-thumbs::-webkit-scrollbar { display: none; }
  .nsb-th { flex: 0 0 auto; }

  /* ---------- 5. Ανακοινώσεις / Νέα ---------- */
  .site-banner { padding-right: 38px; line-height: 1.35; overflow-wrap: anywhere; }
  .site-banner-close { min-width: 36px; min-height: 36px; }
  .news-carousel-slide { min-height: 260px; }
  html body .news-carousel-title { font-size: 1.1rem;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  html body .news-carousel-desc { font-size: .8rem;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .news-carousel-body { padding: 40px 16px 34px; box-sizing: border-box; }
  .news-cards-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .news-card-sm { min-width: 0; }
  .news-card, .news-card > * { min-width: 0; }

  /* ---------- 6. «Προβολή όλων» (παράθυρο σειρών & ηθοποιών) ---------- */
  .lm-title { font-size: 1.3rem; overflow-wrap: anywhere; }
  .lm-search input { font-size: 16px; }

  /* ---------- 7. Παράθυρα / modals: ποτέ πιο φαρδιά από την οθόνη ---------- */
  .modal-container { max-width: 100%; box-sizing: border-box; }
  .modal-close { min-width: 40px; min-height: 40px; }
  .modal-grid { grid-template-columns: minmax(0, 1fr); }
  .comment-input-field-wrap textarea { font-size: 16px; }

  /* ---------- 8. Φόρμες: 16px ώστε το iOS να ΜΗΝ κάνει zoom στο focus ---------- */
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),
  select, textarea,
  .form-control, .auth-input-wrap input { font-size: 16px; }

  /* ---------- 9. Αγγίγματα: ελάχιστο μέγεθος κουμπιών ---------- */
  .card-btn { width: 40px; height: 40px; }
  .abn-item { min-height: 48px; }
  .abn-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  button, .btn, a.btn { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

  /* ---------- 10. Προφίλ & ειδοποιήσεις ---------- */
  .sp-name { font-size: 1.2rem; min-width: 0; }
  .sp-actions { flex-wrap: wrap; }
  .sp-btn { min-width: 0; }
  .sp-req-t b { max-width: 100%; }
  .nx-tabs, .notif-cat-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .nx-tabs::-webkit-scrollbar, .notif-cat-tabs::-webkit-scrollbar { display: none; }
  .nx-tabs button, .notif-cat-btn { flex: 0 0 auto; white-space: nowrap; }

  /* ---------- 11. Σελίδα σειράς: «Δείτε επίσης» / ηθοποιοί / καρτέλες ---------- */
  .rel-row, .actor-series-row, .app-actor-row { scroll-padding-left: 4%; }
  .poster-slide-card { flex: 0 0 120px; min-width: 0; }
  .detail-tab-btn { white-space: nowrap; flex: 0 0 auto; }
}

/* Πολύ μικρές οθόνες (π.χ. iPhone SE / 320–360px) */
@media (max-width: 360px) {
  html body :is(.category-row,.lm-grid) .novela-card { flex-basis: 138px; width: 138px; }
  html body :is(.category-row,.lm-grid) .novela-card.size-large { flex-basis: 150px; width: 150px; }
  html body .category-title { font-size: .98rem; }
  html body .hero-title { font-size: 1.3rem; }
  html body .nsb-title { font-size: 1.45rem; }
  .news-cards-row { grid-template-columns: minmax(0, 1fr); }
}
