/*
 * ══════════════════════════════════════════════════════
 *  desktop.css  —  سيماتاكو Desktop Layout
 *  يُحمَّل بعد style.css فقط
 *  breakpoint: 768px+  tablet/desktop
 * ══════════════════════════════════════════════════════
 */

@media (min-width: 768px) {

  /* إلغاء overflow-x:hidden من الموبايل — يمنع السكرول الأفقي في السكشنات */
  body { overflow-x: unset; }
  #main-content { overflow-x: hidden; } /* نحصره في المحتوى فقط */

  /* ══════════════════════════════
     VARIABLES & ROOT
  ══════════════════════════════ */
  :root {
    --nav-w:   220px;   /* عرض الناف بار الجانبي */
    --hh:       60px;   /* ارتفاع الهيدر */
    --content-max: 1200px;
  }

  /* ══════════════════════════════
     SCROLLBAR
  ══════════════════════════════ */
  ::-webkit-scrollbar       { width: 5px; }
  ::-webkit-scrollbar-track { background: var(--bg2); }
  ::-webkit-scrollbar-thumb { background: var(--blue); border-radius: 3px; }

  /* ══════════════════════════════
     HEADER
  ══════════════════════════════ */
  #site-header {
    left: 0;
    right: var(--nav-w);
    width: auto;
    padding-right: 24px;
    padding-left: 24px;
  }

  /* ══════════════════════════════
     NAVBAR — SIDEBAR
  ══════════════════════════════ */
  #site-navbar {
    position: fixed;
    top: 0; bottom: 0;
    right: 0; left: auto;
    width: var(--nav-w);
    height: 100vh;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    border-top: none;
    border-left: 1px solid var(--bord);
    padding-top: calc(var(--hh) + 20px);
    padding-bottom: 24px;
    gap: 3px;
    background: rgba(7,13,22,.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }

  /* شعار صغير فوق الناف بار */
  #site-navbar::before {
    content: 'سيماتاكو';
    display: block;
    font-size: 17px;
    font-weight: 800;
    padding: 0 18px 16px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--bord);
    background: linear-gradient(135deg, var(--blue2), var(--blue3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -.3px;
  }

  .nav-item {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 11px 18px;
    border-radius: 10px;
    margin: 0 10px;
    flex: none;
    font-size: 13px;
    font-weight: 500;
    transition: all .18s;
    border: 1px solid transparent;
  }
  .nav-item i {
    font-size: 16px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    transition: all .2s;
  }
  .nav-item span { font-size: 13px; font-weight: 500; }

  .nav-item.active {
    background: var(--bsub);
    border-color: var(--bord2);
    color: var(--blue2);
  }
  .nav-item.active i {
    transform: none;
    filter: drop-shadow(0 0 5px rgba(59,130,246,.6));
  }
  .nav-item:hover:not(.active) {
    background: rgba(37,99,235,.06);
    color: var(--text2);
    border-color: transparent;
  }

  /* ══════════════════════════════
     MAIN CONTENT
  ══════════════════════════════ */
  #main-content {
    margin-right: var(--nav-w);
    padding-top: calc(var(--hh) + 20px);
    padding-bottom: 32px;
    min-height: 100vh;
  }

  /* صفحات الهوم والفئات والمفضلة */
  .page { max-width: var(--content-max); margin: 0 auto; }

  /* ══════════════════════════════
     TOAST
  ══════════════════════════════ */
  .toast { bottom: 24px; }

  /* ══════════════════════════════
     POPUP
  ══════════════════════════════ */
  .hpopup {
    left: auto;
    right: 8px;
    width: 380px;
    max-width: 380px;
  }

  /* ══════════════════════════════
     CAROUSEL
  ══════════════════════════════ */
  .caro-wrap {
    height: 500px;
    border-radius: 16px;
    margin: 0 24px 28px;
    overflow: hidden;
  }
  .caro-title  { font-size: 28px; }
  .caro-desc   { font-size: 13px; -webkit-line-clamp: 3; }
  .caro-body   { padding: 0 28px 28px; }
  .caro-badge  { font-size: 12px; padding: 5px 12px; }
  .caro-btn-watch { font-size: 14px; padding: 14px 20px; border-radius: 13px; }
  .caro-btn-save  { width: 50px; height: 50px; border-radius: 13px; font-size: 17px; }
  .caro-arrow { opacity: 0; }
  .caro-wrap:hover .caro-arrow { opacity: 1; }
  .arr-prev { right: 20px; }
  .arr-next  { left: 20px; }
  .caro-dots { bottom: 22px; right: 28px; }

  /* ══════════════════════════════
     SECTIONS
  ══════════════════════════════ */
  .section { margin-bottom: 32px; }
  .section-header {
    padding: 0 24px;
    margin-bottom: 14px;
  }
  .section-title { font-size: 15px; }
  .section-logo-wrap { width: 32px; height: 32px; font-size: 15px; }

  /* السكشن */
  .section { position: relative; }

  /* السكرول — بدون شريط تمرير */
  .cards-scroll {
    padding: 0 24px;
    gap: 14px;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }
  .cards-scroll::-webkit-scrollbar { display: none; }

  /* ── أسهم السكشن في الهيدر ── */
  .section-arrows {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }
  .sec-arr {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(2,4,8,.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(59,130,246,.32);
    color: rgba(255,255,255,.8);
    font-size: 11px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all .2s;
    flex-shrink: 0;
  }
  .sec-arr:hover {
    background: rgba(37,99,235,.5);
    border-color: var(--blue2);
    color: #fff;
    transform: scale(1.08);
  }
  .sec-arr:active { transform: scale(.95); }

  /* ══════════════════════════════
     MOVIE CARD
  ══════════════════════════════ */
  .movie-card {
    min-width: 150px;
    width: 150px;
    border-radius: 14px;
  }
  .mc-info     { padding: 8px 10px 10px; }
  .mc-title    { font-size: 12px; }
  .mc-meta     { font-size: 11px; }
  .mc-save     { width: 30px; height: 30px; font-size: 11px; }
  .mc-rating   { font-size: 11px; padding: 3px 7px; }

  /* ══════════════════════════════
     CATEGORIES
  ══════════════════════════════ */
  .cat-tabs    { padding: 0 24px; gap: 10px; }
  .cat-tab     { font-size: 14px; padding: 10px 14px; }
  .genres-scroll { padding: 0 24px; gap: 8px; margin-bottom: 16px; }
  .genre-chip  { font-size: 13px; padding: 7px 18px; }

  #catResults {
    padding: 0 24px;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
  }

  /* ══════════════════════════════
     PAGE HEAD
  ══════════════════════════════ */
  .page-head { padding: 0 24px 0; margin-bottom: 16px; }
  .page-head h2 { font-size: 20px; }
  .page-head p  { font-size: 12px; }

  /* ══════════════════════════════
     FAVORITES GRID
  ══════════════════════════════ */
  #favoritesGrid {
    padding: 0 24px !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 14px !important;
  }

  /* ══════════════════════════════
     ACCOUNT
  ══════════════════════════════ */
  .account-page {
    padding: 24px;
    max-width: 640px;
    margin: 0 auto;
  }
  .profile-section { padding: 24px 24px 20px; }
  .profile-avatar  { width: 100px; height: 100px; }
  .profile-name    { font-size: 20px; }
  .profile-email   { font-size: 13px; }
  .settings-item   { padding: 15px 16px; }
  .si-text         { font-size: 14px; }
  .si-icon         { width: 34px; height: 34px; font-size: 14px; }

  /* ══════════════════════════════
     DETAILS PAGE
  ══════════════════════════════ */
  .details-backdrop-wrap { margin-bottom: -120px; }
  .details-backdrop      { height: 420px; }
  .details-main          { padding: 0 32px 32px; max-width: 900px; margin: 0 auto; }

  .details-poster-row    { gap: 24px; margin-bottom: 20px; align-items: flex-end; }
  .details-poster        { width: 160px; border-radius: 14px; }
  .details-title         { font-size: 26px; }
  .details-meta          { gap: 10px; margin-bottom: 12px; }
  .meta-item             { font-size: 13px; }
  .details-desc          { font-size: 14px; line-height: 1.8; }
  .details-actions       { gap: 12px; margin-bottom: 20px; }

  .btn-watch {
    padding: 14px 20px;
    font-size: 15px;
    border-radius: 13px;
  }
  .btn-save {
    width: 50px; height: 50px;
    border-radius: 13px;
    font-size: 18px;
  }

  /* ══════════════════════════════
     WATCH PAGE
  ══════════════════════════════ */
  .watch-player { border-radius: 12px; overflow: hidden; margin: 0 24px; }
  .watch-info   { padding: 20px 24px; }
  .server-tabs  { gap: 8px; }
  .server-tab   { font-size: 13px; padding: 9px 18px; }

  /* ══════════════════════════════
     AUTH PAGES
  ══════════════════════════════ */
  .auth-card    { max-width: 420px; padding: 32px 28px; border-radius: 22px; }
  .auth-card h2 { font-size: 20px; }
  .form-input   { font-size: 14px; padding: 12px 14px; }
  .btn-primary  { font-size: 15px; padding: 14px; }

  /* ══════════════════════════════
     EMPTY STATE
  ══════════════════════════════ */
  .empty-state      { padding: 80px 32px; }
  .empty-state i    { font-size: 52px; }
  .empty-state h3   { font-size: 18px; }
  .empty-state p    { font-size: 13px; }

} /* end @media 768px */


/* ══════════════════════════════
   LARGE DESKTOP 1024px+
══════════════════════════════ */
@media (min-width: 1024px) {
  :root { --nav-w: 240px; }

  /* الكاروسيل أكبر */
  .caro-wrap  { height: 560px; margin: 0 32px 32px; }
  .caro-title { font-size: 32px; }
  .caro-desc  { font-size: 14px; -webkit-line-clamp: 3; }
  .caro-body  { padding: 0 36px 32px; }

  /* البطاقات أكبر */
  .movie-card    { min-width: 170px; width: 170px; }
  .cards-scroll  { padding: 0 32px; gap: 16px; }
  .section-header { padding: 0 32px; }

  /* الفئات */
  #catResults {
    padding: 0 32px;
    grid-template-columns: repeat(6, 1fr);
  }
  #favoritesGrid {
    padding: 0 32px !important;
    grid-template-columns: repeat(6, 1fr) !important;
  }

  /* التفاصيل */
  .details-main   { padding: 0 48px 40px; max-width: 1000px; }
  .details-poster { width: 180px; }
  .details-title  { font-size: 30px; }

  .watch-player { margin: 0 32px; }
  .watch-info   { padding: 24px 32px; }
}

/* ══════════════════════════════
   ULTRA WIDE 1280px+
══════════════════════════════ */
@media (min-width: 1280px) {
  :root { --nav-w: 260px; --content-max: 1400px; }

  .caro-wrap { height: 600px; }
  .movie-card { min-width: 180px; width: 180px; }
  #catResults { grid-template-columns: repeat(7, 1fr); }
  #favoritesGrid { grid-template-columns: repeat(7, 1fr) !important; }
}
