/* ==========================================================================
   LeeCinema — Watched page styles (loaded after main.css)
   Controls/filters, movie cards, modals, years table, recommend modal
   ========================================================================== */

    /* ── Controls ── */
    .controls {
      position: sticky;
      top: 0;
      z-index: 20;
      background: rgba(12,12,15,0.95);
      backdrop-filter: blur(12px);
      border-bottom: 1px solid var(--border);
      padding: 14px 40px;
      display: flex;
      align-items: center;
      gap: 16px;
      flex-wrap: wrap;
    }

    .search-wrap {
      position: relative;
      flex: 1;
      min-width: 200px;
      max-width: 340px;
    }

    .search-wrap svg {
      position: absolute;
      left: 12px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--text3);
      pointer-events: none;
    }

    .search-input {
      width: 100%;
      background: var(--bg3);
      border: 1px solid var(--border);
      border-radius: 6px;
      color: var(--text);
      font-family: 'DM Sans', sans-serif;
      font-size: 13px;
      font-weight: 300;
      padding: 8px 12px 8px 36px;
      outline: none;
      transition: border-color 0.2s;
    }

    .search-input:focus { border-color: var(--gold); }
    .search-input::placeholder { color: var(--text3); }

    .filter-btn {
      background: var(--bg3);
      border: 1px solid var(--border);
      border-radius: 6px;
      color: var(--text2);
      font-family: 'DM Sans', sans-serif;
      font-size: 12px;
      font-weight: 400;
      padding: 8px 14px;
      cursor: pointer;
      transition: border-color 0.2s, color 0.2s;
      white-space: nowrap;
    }

    .filter-btn:hover,
    .filter-btn.active {
      border-color: var(--gold);
      color: var(--gold);
    }

    .filter-select {
      background: var(--bg3);
      border: 1px solid var(--border);
      border-radius: 6px;
      color: var(--text2);
      font-family: 'DM Sans', sans-serif;
      font-size: 12px;
      font-weight: 400;
      padding: 8px 14px;
      cursor: pointer;
      outline: none;
      transition: border-color 0.2s;
      appearance: none;
      -webkit-appearance: none;
      padding-right: 28px;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b6860'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 10px center;
    }

    .filter-select:focus { border-color: var(--gold); }

    .controls-right {
      margin-left: auto;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .count-badge {
      font-size: 11px;
      color: var(--text3);
      font-weight: 400;
      letter-spacing: 0.05em;
    }

    /* ── Main layout ── */
    main {
      position: relative;
      z-index: 5;
      padding: 32px 40px 60px;
      max-width: 1100px;
      margin: 0 auto;
    }

    /* ── Year divider ── */
    .year-group { margin-bottom: 40px; }

    .year-header {
      cursor: pointer;
      user-select: none;
    }

    .year-header:hover .year-label { color: rgba(255,255,255,0.4); }

    .year-label {
      font-family: 'Bebas Neue', sans-serif;
      font-size: 72px;
      line-height: 0.85;
      color: rgba(255,255,255,0.25);
      letter-spacing: 0.02em;
      margin-bottom: -8px;
      padding-left: 2px;
      user-select: none;
      transition: color 0.2s;
    }

    .year-divider {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 20px;
    }

    .year-divider-line {
      flex: 1;
      height: 1px;
      background: var(--border);
    }

    .year-count {
      font-size: 10px;
      letter-spacing: 0.2em;
      text-transform: uppercase;
      color: var(--text3);
    }

    .year-expand-hint {
      font-size: 10px;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: var(--text3);
      opacity: 0;
      transition: opacity 0.2s;
      white-space: nowrap;
      flex-shrink: 0;
    }

    .year-group.collapsed .year-expand-hint {
      opacity: 1;
    }

    .year-toggle-icon {
      font-size: 11px;
      color: var(--text3);
      transition: transform 0.25s ease;
      flex-shrink: 0;
    }

    .year-group.collapsed .year-toggle-icon {
      transform: rotate(-90deg);
    }

    .year-group.collapsed .year-label {
      color: rgba(255,255,255,0.15);
    }

    .year-body {
      overflow: hidden;
      transition: max-height 0.3s ease, opacity 0.25s ease;
      max-height: 20000px;
      opacity: 1;
    }

    .year-group.collapsed .year-body {
      max-height: 0;
      opacity: 0;
    }

    /* ── Movie cards ── */
    .movie-list {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .movie-card {
      background: var(--bg2);
      border: 1px solid var(--border);
      border-radius: 4px;
      padding: 18px 24px;
      display: grid;
      grid-template-columns: 76px 1fr 90px 52px 120px;
      align-items: center;
      gap: 20px;
      transition: border-color 0.2s, background 0.2s;
      cursor: default;
      position: relative;
      overflow: hidden;
    }

    .movie-card::before {
      content: '';
      position: absolute;
      left: 0;
      top: 0;
      bottom: 0;
      width: 3px;
      background: var(--gold);
      opacity: 0;
      transition: opacity 0.2s;
    }

    .movie-card:hover {
      background: var(--bg3);
      border-color: var(--border2);
    }

    .movie-card:hover::before {
      opacity: 1;
    }

    .movie-number {
      font-family: 'Bebas Neue', sans-serif;
      font-size: 22px;
      color: var(--text3);
      text-align: right;
      letter-spacing: 0.03em;
    }

    .cover-thumb {
      width: 72px;
      height: 104px;
      object-fit: cover;
      border-radius: 3px;
      border: 1px solid var(--border2);
      flex-shrink: 0;
      display: block;
    }

    .movie-info { min-width: 0; }

    .movie-title-row {
      display: flex;
      align-items: baseline;
      gap: 8px;
      margin-bottom: 6px;
      min-width: 0;
    }

    .movie-title {
      font-family: 'DM Serif Display', serif;
      font-size: 18px;
      font-weight: 400;
      color: var(--text);
      line-height: 1.2;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      min-width: 0;
    }

    .movie-year {
      font-family: 'DM Sans', sans-serif;
      font-size: 11px;
      font-weight: 400;
      color: var(--text3);
      letter-spacing: 0.06em;
      white-space: nowrap;
      flex-shrink: 0;
    }

    .movie-meta {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
    }

    .imdb-link {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      font-size: 10px;
      font-weight: 500;
      color: #f5c518;
      text-decoration: none;
      padding: 2px 7px;
      border-radius: 3px;
      background: rgba(245,197,24,0.08);
      border: 1px solid rgba(245,197,24,0.2);
      letter-spacing: 0.04em;
      transition: background 0.2s;
    }

    .imdb-link:hover { background: rgba(245,197,24,0.15); }

    .meta-duration {
      font-size: 11px;
      color: var(--text3);
      letter-spacing: 0.03em;
      font-variant-numeric: tabular-nums;
    }

    .meta-date {
      font-size: 11px;
      color: var(--text3);
      font-weight: 400;
      letter-spacing: 0.04em;
    }

    .meta-sep {
      width: 3px;
      height: 3px;
      border-radius: 50%;
      background: var(--text3);
      opacity: 0.4;
    }

    .watchers {
      display: flex;
      gap: 4px;
    }

    .watcher-pill {
      font-size: 10px;
      font-weight: 500;
      letter-spacing: 0.05em;
      padding: 2px 7px;
      border-radius: 20px;
      background: rgba(201,168,76,0.1);
      color: var(--gold);
      border: 1px solid rgba(201,168,76,0.2);
    }

    /* Platform badge */
    .platform-badge {
      font-size: 11px;
      font-weight: 500;
      padding: 5px 0;
      border-radius: 4px;
      white-space: nowrap;
      letter-spacing: 0.03em;
      width: 120px;
      text-align: center;
      display: inline-block;
    }

    .platform-netflix  { background: rgba(229,9,20,0.12);   color: #e57c82; border: 1px solid rgba(229,9,20,0.2); }
    .platform-hbo      { background: rgba(138,43,226,0.12); color: #b07be8; border: 1px solid rgba(138,43,226,0.2); }
    .platform-prime    { background: rgba(0,168,225,0.12);  color: #60c8e8; border: 1px solid rgba(0,168,225,0.2); }
    .platform-apple    { background: rgba(162,170,173,0.12);color: #a2aaad; border: 1px solid rgba(162,170,173,0.2); }
    .platform-theater  { background: rgba(201,168,76,0.12); color: var(--gold); border: 1px solid rgba(201,168,76,0.2); }
    .platform-dvd      { background: rgba(100,160,220,0.12); color: #80b8e8; border: 1px solid rgba(100,160,220,0.2); }
    .platform-other    { background: rgba(255,255,255,0.05);color: var(--text2); border: 1px solid var(--border); }

    /* MPAA rating badge */
    .mpaa-badge {
      font-size: 10px;
      font-weight: 600;
      letter-spacing: 0.06em;
      padding: 2px 6px;
      border-radius: 3px;
      border: 1px solid rgba(255,255,255,0.18);
      color: var(--text2);
      background: rgba(255,255,255,0.06);
      white-space: nowrap;
      flex-shrink: 0;
    }

    /* Genre pills in modal */
    .genre-pills {
      display: flex;
      flex-wrap: wrap;
      gap: 5px;
    }

    .genre-pill {
      font-size: 11px;
      font-weight: 300;
      padding: 3px 8px;
      border-radius: 3px;
      background: rgba(255,255,255,0.06);
      border: 1px solid rgba(255,255,255,0.12);
      color: var(--text2);
    }

    /* Star rating */
    .stars {
      display: flex;
      gap: 3px;
      align-items: center;
      justify-content: flex-end;
      width: 90px;
    }

    .star {
      font-size: 15px;
      line-height: 1;
    }
    .star.filled { color: var(--gold); }
    .star.empty  { color: var(--bg4); }

    /* ── Empty state ── */
    .empty-state {
      text-align: center;
      padding: 80px 20px;
      color: var(--text3);
    }

    .empty-state .icon {
      font-size: 48px;
      margin-bottom: 16px;
      opacity: 0.3;
    }

    .empty-state p {
      font-size: 14px;
      letter-spacing: 0.05em;
    }

    /* ── Responsive ── */
    @media (max-width: 700px) {
      header { padding: 28px 20px 24px; }
      .site-nav-bar {
        padding: 0 16px;
        flex-wrap: wrap;
      }
      .btn-recommend {
        margin-left: 0;
        width: 100%;
        justify-content: center;
        border-top: 1px solid var(--border);
        border-radius: 0;
        padding: 11px 16px;
      }
      .controls { padding: 12px 20px; }
      main { padding: 24px 20px 48px; }
      .movie-card {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
      }
      .movie-number { display: none; }
      .platform-badge { display: none; }
    }

    /* ── Years stats table ── */
    .years-table {
      width: 100%;
      border-collapse: collapse;
    }

    .years-table th {
      text-align: left;
      font-size: 10px;
      font-weight: 500;
      letter-spacing: 0.18em;
      text-transform: uppercase;
      color: var(--text3);
      padding: 8px 12px;
      border-bottom: 1px solid var(--border2);
    }

    .years-table td {
      padding: 12px 12px;
      font-size: 13px;
      font-weight: 300;
      border-bottom: 1px solid var(--border);
      color: var(--text);
      vertical-align: middle;
    }

    .years-table tbody tr:last-child td { border-bottom: none; }
    .years-table tbody tr:hover td { background: var(--bg3); }

    .years-table .td-year {
      font-family: 'Bebas Neue', sans-serif;
      font-size: 22px;
      color: var(--gold);
      letter-spacing: 0.03em;
      width: 80px;
    }

    .years-table .td-count { color: var(--text2); }

    .years-table .td-time {
      color: var(--text2);
      font-variant-numeric: tabular-nums;
    }

    .years-table .td-avg { font-variant-numeric: tabular-nums; }

    .years-table .mini-stars {
      display: flex;
      gap: 1px;
    }

    .years-table .mini-stars .star {
      font-size: 12px;
    }

    .td-empty-cell { color: var(--text3); }
    .modal-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.75);
      z-index: 100;
      align-items: center;
      justify-content: center;
      padding: 20px;
    }

    .modal-overlay.open {
      display: flex;
      animation: overlayIn 0.2s ease both;
    }

    @keyframes overlayIn {
      from { opacity: 0; }
      to   { opacity: 1; }
    }

    .modal {
      background: var(--bg2);
      border: 1px solid var(--border2);
      border-radius: 8px;
      width: 100%;
      max-width: 560px;
      max-height: 90vh;
      overflow-y: auto;
      position: relative;
      animation: modalIn 0.25s ease both;
    }

    @keyframes modalIn {
      from { opacity: 0; transform: translateY(16px) scale(0.98); }
      to   { opacity: 1; transform: translateY(0)    scale(1); }
    }

    /* Gold accent bar at top of modal */
    .modal::before {
      content: '';
      display: block;
      height: 3px;
      background: linear-gradient(90deg, var(--gold) 0%, transparent 100%);
      border-radius: 8px 8px 0 0;
    }

    .modal-header {
      padding: 24px 28px 0;
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px;
    }

    .modal-title-block { flex: 1; min-width: 0; }

    .modal-title {
      font-family: 'DM Serif Display', serif;
      font-size: 26px;
      font-weight: 400;
      line-height: 1.2;
      color: var(--text);
      margin-bottom: 6px;
    }

    .modal-title-meta {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
    }

    .modal-year {
      font-size: 12px;
      color: var(--text3);
      letter-spacing: 0.06em;
    }

    .modal-close {
      background: transparent;
      border: 1px solid var(--border2);
      border-radius: 5px;
      color: var(--text3);
      width: 32px;
      height: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      flex-shrink: 0;
      transition: border-color 0.2s, color 0.2s;
    }

    .modal-close:hover { border-color: var(--text2); color: var(--text); }

    .modal-body {
      padding: 20px 28px 28px;
    }

    /* Stars row */
    .modal-stars {
      display: flex;
      gap: 3px;
      margin-bottom: 20px;
    }

    .modal-stars .star { font-size: 20px; }

    /* Details grid */
    .modal-details {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 2px;
      margin-bottom: 20px;
    }

    .detail-item {
      background: var(--bg3);
      border-radius: 4px;
      padding: 12px 14px;
    }

    .detail-item.full-width {
      grid-column: span 2;
    }

    .detail-label {
      font-size: 10px;
      font-weight: 500;
      letter-spacing: 0.15em;
      text-transform: uppercase;
      color: var(--text3);
      margin-bottom: 5px;
    }

    .detail-value {
      font-size: 13px;
      font-weight: 400;
      color: var(--text);
    }

    .detail-watchers {
      display: flex;
      gap: 5px;
      flex-wrap: wrap;
    }

    .detail-duration {
      font-variant-numeric: tabular-nums;
      letter-spacing: 0.03em;
    }

    /* Notes section */
    .modal-notes {
      background: var(--bg3);
      border-radius: 4px;
      padding: 14px 16px;
      margin-bottom: 20px;
      font-size: 13px;
      color: var(--text2);
      line-height: 1.7;
      font-style: italic;
    }

    /* IMDb button */
    .modal-imdb {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      font-size: 12px;
      font-weight: 500;
      color: #f5c518;
      text-decoration: none;
      padding: 9px 16px;
      border-radius: 5px;
      background: rgba(245,197,24,0.08);
      border: 1px solid rgba(245,197,24,0.25);
      letter-spacing: 0.04em;
      transition: background 0.2s, border-color 0.2s;
    }

    .modal-imdb:hover {
      background: rgba(245,197,24,0.14);
      border-color: rgba(245,197,24,0.4);
    }

    /* Filmstrip accent at bottom */
    .modal-filmstrip {
      height: 14px;
      background: var(--bg3);
      border-top: 1px solid var(--border);
      display: flex;
      align-items: center;
      padding: 0 6px;
      gap: 5px;
      overflow: hidden;
      border-radius: 0 0 8px 8px;
    }

    .modal-filmstrip-hole {
      width: 9px;
      height: 7px;
      border-radius: 1px;
      background: var(--bg2);
      flex-shrink: 0;
      border: 1px solid var(--border2);
    }

    /* Make cards clickable */
    .movie-card { cursor: pointer; }

    @media (max-width: 600px) {
      .modal { max-height: 95vh; }
      .modal-header { padding: 18px 20px 0; }
      .modal-body { padding: 16px 20px 20px; }
      .modal-details { grid-template-columns: 1fr; }
      .detail-item.full-width { grid-column: span 1; }
      .modal-title { font-size: 22px; }
    }

    /* ── Animations ── */
    .movie-card {
      animation: fadeUp 0.3s ease both;
    }

    @keyframes fadeUp {
      from { opacity: 0; transform: translateY(10px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    /* ── Recommend button ── */
    .btn-recommend {
      margin-left: auto;
      display: flex;
      align-items: center;
      gap: 7px;
      background: rgba(201,168,76,0.08);
      border: 1px solid rgba(201,168,76,0.3);
      border-radius: 5px;
      color: var(--gold);
      font-family: 'DM Sans', sans-serif;
      font-size: 12px;
      font-weight: 500;
      letter-spacing: 0.06em;
      padding: 7px 16px;
      cursor: pointer;
      transition: background 0.2s, border-color 0.2s;
      white-space: nowrap;
    }

    .btn-recommend:hover {
      background: rgba(201,168,76,0.15);
      border-color: var(--gold);
    }

    /* ── Recommendation modal ── */
    .rec-badge {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      font-size: 10px;
      font-weight: 500;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: var(--gold);
      background: rgba(201,168,76,0.1);
      border: 1px solid rgba(201,168,76,0.25);
      border-radius: 20px;
      padding: 3px 10px;
      margin-bottom: 20px;
    }

    .rec-again-btn {
      display: flex;
      align-items: center;
      gap: 7px;
      background: var(--bg3);
      border: 1px solid var(--border2);
      border-radius: 6px;
      color: var(--text2);
      font-family: 'DM Sans', sans-serif;
      font-size: 12px;
      font-weight: 400;
      padding: 9px 18px;
      cursor: pointer;
      margin-top: 20px;
      transition: border-color 0.2s, color 0.2s;
      width: 100%;
      justify-content: center;
      letter-spacing: 0.04em;
    }

    .rec-again-btn:hover { border-color: var(--gold); color: var(--gold); }
  