/* ============================================================================
   Statistika › VOD page — page-scoped styles
   ----------------------------------------------------------------------------
   File layout:
     1. Page shell
     2. Breadcrumb
     3. Two-column grid (left = TOP 50, right = Popular by views)
     4. Card title + table head
     5. TOP 50 row (rank, poster, title, IMDB, points)
     6. Views row (rank, title, date added, eye + counts)
     7. Responsive — all @media queries consolidated at the end
   ============================================================================ */


/* ============================ 1. Page shell ============================ */
.app-shell[data-page="statistics-vod"] .content-shell {
  overflow: hidden;
}

.svod-page {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  height: 100%;
  min-height: 0;
}


/* ============================ 2. Breadcrumb ============================ */
.svod-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 20px;
  line-height: 26px;
  color: var(--dark4txt);
  font-weight: 500;
}

.svod-breadcrumb a {
  text-decoration: none;
  color: inherit;
}

.svod-breadcrumb-sep {
  color: var(--grey4txt);
}


/* ============================ 3. Two-column grid ============================ */
.svod-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 42px;
  min-height: 0;
  padding: 16px;
  overflow: auto;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.22);
  scrollbar-width: none;
}

.svod-grid::-webkit-scrollbar {
  display: none;
}


/* ============================ 4. Card + table head ============================ */
.svod-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.svod-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  font-family: var(--font-heading);
  font-size: 18px;
  line-height: 22px;
  font-weight: 500;
  color: var(--dark4txt);
}

.svod-card-title-text {
  flex: 1;
  min-width: 0;
}

.svod-card-meta,
.svod-card-title>img,
.svod-card-title>svg {
  display: none;
}

.svod-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
  font-size: 13px;
  line-height: 16px;
  color: var(--dark4txt);
  table-layout: fixed;
}

.svod-table thead th {
  padding: 0 8px 6px;
  font-weight: 600;
  font-size: 13px;
  color: var(--grey4txt);
  text-align: left;
  white-space: nowrap;
}

.svod-table tbody tr {
  height: 48px;
  background: rgba(255, 255, 255, 0.56);
}

.svod-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.34);
}

.svod-table tbody td {
  height: 48px;
  padding: 4px 8px;
  vertical-align: middle;
}

.svod-table tbody tr td:first-child {
  border-radius: 8px 0 0 8px;
}

.svod-table tbody tr td:last-child {
  border-radius: 0 8px 8px 0;
}

.svod-card:nth-child(2) .svod-table {
  border-spacing: 0 5px;
}

.svod-card:nth-child(2) .svod-table tbody tr {
  height: 48px;
}

.svod-card:nth-child(2) .svod-table tbody td {
  height: 27px;
  padding: 3px 8px;
}

.svod-card:nth-child(2) .svod-table tbody td strong {
  font-weight: 400;
}

/* Rank cell — small grey "#N" */
.svod-rank {
  width: 42px;
  color: var(--grey4txt);
  font-size: 13px;
  font-weight: 500;
}

.svod-card:first-child .svod-table th:nth-child(2),
.svod-card:first-child .svod-table td:nth-child(2) {
  width: auto;
}

.svod-card:first-child .svod-table thead th:nth-child(2) {
  padding-left: 44px;
}

.svod-card:first-child .svod-table th:nth-child(3),
.svod-card:first-child .svod-table td:nth-child(3) {
  width: 118px;
}

.svod-card:first-child .svod-table th:nth-child(4),
.svod-card:first-child .svod-table td:nth-child(4) {
  width: 56px;
}

.svod-card:nth-child(2) .svod-table th:nth-child(1),
.svod-card:nth-child(2) .svod-table td:nth-child(1) {
  width: 56px;
}

.svod-card:nth-child(2) .svod-table th:nth-child(3),
.svod-card:nth-child(2) .svod-table td:nth-child(3) {
  width: 140px;
}

.svod-card:nth-child(2) .svod-table th:nth-child(4),
.svod-card:nth-child(2) .svod-table td:nth-child(4) {
  width: 158px;
  text-align: center;
}


/* ============================ 5. TOP 50 row pieces ============================ */
.svod-toptitle {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.svod-thumb {
  flex: 0 0 25px;
  width: 25px;
  height: 40px;
  border-radius: 3px;
  background-color: #695a9d;
  background-size: cover;
  background-position: center;
}

.svod-table tbody tr:nth-child(1) .svod-thumb {
  background-image: url("../../assets/images/vod-posters/poster-01.png");
}

.svod-table tbody tr:nth-child(2) .svod-thumb {
  background-image: url("../../assets/images/vod-posters/poster-02.png");
}

.svod-table tbody tr:nth-child(3) .svod-thumb {
  background-image: url("../../assets/images/vod-posters/poster-03.png");
}

.svod-table tbody tr:nth-child(4) .svod-thumb {
  background-image: url("../../assets/images/vod-posters/poster-04.png");
}

.svod-table tbody tr:nth-child(5) .svod-thumb {
  background-image: url("../../assets/images/vod-posters/poster-05.png");
}

.svod-table tbody tr:nth-child(6) .svod-thumb {
  background-image: url("../../assets/images/vod-posters/poster-06.png");
}

.svod-table tbody tr:nth-child(7) .svod-thumb {
  background-image: url("../../assets/images/vod-posters/poster-07.png");
}

.svod-table tbody tr:nth-child(8) .svod-thumb {
  background-image: url("../../assets/images/vod-posters/poster-08.png");
}

.svod-table tbody tr:nth-child(9) .svod-thumb {
  background-image: url("../../assets/images/vod-posters/poster-09.png");
}

.svod-table tbody tr:nth-child(10) .svod-thumb {
  background-image: url("../../assets/images/vod-posters/poster-10.png");
}

.svod-table tbody tr:nth-child(11) .svod-thumb {
  background-image: url("../../assets/images/vod-posters/poster-11.png");
}

.svod-table tbody tr:nth-child(12) .svod-thumb {
  background-image: url("../../assets/images/vod-posters/poster-12.png");
}

.svod-toptitle-text {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 7px;
  min-width: 0;
  color: var(--dark4txt);
  line-height: 16px;
}

.svod-toptitle-text strong {
  font-weight: 400;
  font-size: 13px;
}

.svod-toptitle-text .svod-year,
.svod-toptitle-text .svod-genre {
  font-weight: 400;
  font-size: 13px;
  color: var(--dark4txt);
}

/* IMDB cell — star + rating + (count) */
.svod-imdb {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.svod-imdb-star {
  display: inline-block;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}

.svod-imdb-rating {
  font-weight: 400;
  color: var(--dark4txt);
}

.svod-imdb-count {
  color: var(--dark4txt);
  font-size: 13px;
}

.svod-points {
  font-weight: 600;
  color: var(--dark4txt);
  text-align: left;
  white-space: nowrap;
}


/* ============================ 6. Views row pieces ============================ */
.svod-added {
  color: var(--dark4txt);
  font-size: 13px;
  white-space: nowrap;
}

.svod-added-mobile {
  display: none;
}

.svod-views {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.svod-views-eye {
  display: inline-block;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  color: #00a88f;
}

.svod-views-total {
  color: #00a88f;
  font-weight: 400;
}

.svod-views-avg {
  color: var(--dark4txt);
  font-weight: 400;
}


/* ============================================================================
   7. Responsive — all @media queries at the end
   Breakpoints:
     1300px → switch to single-column accordion (only one open at a time;
              closed cards still preview the first 5 rows)
      600px → trim card titles to fit, smaller thumbs
   ============================================================================ */

@media (max-width: 1300px) {
  .app-shell[data-page="statistics-vod"] .content-shell {
    overflow: auto;
  }

  .svod-page {
    height: auto;
    grid-template-rows: auto auto;
  }

  .svod-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 0;
    background: transparent;
  }

  /* Each card becomes its own translucent panel */
  .svod-card {
    background: rgba(255, 255, 255, 0.42);
    border-radius: 10px;
    padding: 14px 16px;
  }

  /* Title row becomes the accordion bar */
  .svod-card-title {
    margin: 0;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
  }

  .svod-card-meta {
    display: inline-block;
    margin-left: auto;
    font-family: var(--font-body);
    font-size: 12px;
    line-height: 16px;
    color: var(--grey4txt);
    font-weight: 400;
  }

  .svod-card-title>img,
  .svod-card-title>svg {
    display: inline-block;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    transition: transform 0.2s ease;
  }

  /* When meta is present, chevron sits right of it; when absent, chevron pushes right */
  .svod-card-title:not(:has(.svod-card-meta))>img,
  .svod-card-title:not(:has(.svod-card-meta))>svg {
    margin-left: auto;
  }

  .svod-card.is-open .svod-card-title>img,
  .svod-card.is-open .svod-card-title>svg {
    transform: rotate(180deg);
  }

  /* Spacer between title and rows once expanded */
  .svod-card .svod-table-scroll {
    margin-top: 12px;
    overflow: visible;
  }

  /* Hide the column-header row in accordion mode — title acts as the header */
  .svod-table thead {
    display: none;
  }

  /* Default: preview first 5 rows */
  .svod-card .svod-table tbody tr:nth-child(n+6) {
    display: none;
  }

  /* Open: reveal all rows */
  .svod-card.is-open .svod-table tbody tr:nth-child(n+6) {
    display: table-row;
  }

  /* Right card: collapse the standalone "Pridėtas" column — date is shown
     stacked under the title via .svod-added-mobile instead. */
  .svod-card:nth-child(2) .svod-table td:nth-child(3) {
    display: none;
  }

  .svod-added-mobile {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    line-height: 16px;
    color: var(--grey4txt);
    font-weight: 400;
    white-space: nowrap;
  }
}

@media (max-width: 600px) {
  .svod-card-title {
    font-size: 16px;
  }

  .svod-table {
    font-size: 12px;
  }

  .svod-table thead th {
    font-size: 11px;
    padding: 0 6px 4px;
  }

  .svod-table tbody td {
    padding: 6px;
  }

  .svod-rank {
    width: 36px;
  }

  .svod-thumb {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
  }

  .svod-toptitle-text strong {
    font-size: 13px;
  }

  .svod-toptitle-text .svod-year,
  .svod-toptitle-text .svod-genre {
    font-size: 11px;
  }

  .svod-imdb-count {
    display: none;
  }

  .svod-card:first-child .svod-table td:nth-child(3) {
    width: 60px;
  }

  .svod-card:first-child .svod-table td:nth-child(4) {
    width: 34px;
  }

  .svod-card:nth-child(2) .svod-table td:nth-child(4) {
    width: 116px;
  }

  .svod-card:nth-child(2) .svod-table td:nth-child(1) {
    width: 29px;
  }
}