/* ============================================================
   Movies & TV Shows — YouTube Storefront Style
   Portrait poster cards, horizontal scroll rows by genre
   ============================================================ */

:root {
    --bg: #fff;
    --surface: #f9f9f9;
    --border: #e8e8e8;
    --text: #0f0f0f;
    --text-muted: #606060;
    --text-light: #909090;
    --accent: #065fd4;
    --accent-hover: #0356bc;
    --badge-free: #00693e;
    --badge-buy: #b91c1c;
    --radius-card: 8px;
    --radius-sm: 4px;
    --shadow-card: 0 1px 4px rgba(0,0,0,.10), 0 2px 8px rgba(0,0,0,.06);
    --shadow-hover: 0 4px 16px rgba(0,0,0,.15);
    --font: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Wrapper ── */
.mtv-wrap {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 0 40px;
    box-sizing: border-box;
}

/* ── App container ── */
.mtv-app {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    padding: 0 16px 32px;
}

/* ── Breadcrumb ── */
.mtv-breadcrumb { padding: 10px 16px 0; }
.mtv-back-link {
    color: var(--accent);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
}
.mtv-back-link:hover { text-decoration: underline; }

/* ── Top bar ── */
.mtv-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 0 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}
.mtv-title-block { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mtv-h1 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.02em;
}
.mtv-total-count {
    background: #f2f2f2;
    color: #606060;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: .8rem;
    font-weight: 500;
    border: 1px solid var(--border);
}
.mtv-clear { color: var(--accent); font-size: .88rem; text-decoration: none; }
.mtv-clear:hover { text-decoration: underline; }

/* ── Search / sort ── */
.mtv-controls { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.mtv-search, .mtv-sort {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 10px;
    border-radius: 20px;
    font-size: .88rem;
    font-family: var(--font);
}
.mtv-search { width: 200px; max-width: 100%; }
.mtv-search::placeholder { color: var(--text-light); }
.mtv-search:focus, .mtv-sort:focus { outline: none; border-color: var(--accent); background: #fff; }
.mtv-sort { cursor: pointer; padding-right: 28px; }
.mtv-btn {
    background: var(--accent);
    border: 0;
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    transition: background .15s;
}
.mtv-btn:hover { background: var(--accent-hover); }

/* ── Channel chips ── */
.mtv-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.mtv-chip {
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: .84rem;
    font-weight: 500;
    border: 1px solid var(--border);
    transition: all .15s;
    white-space: nowrap;
}
.mtv-chip:hover { background: var(--border); }
.mtv-chip.is-active { background: var(--text); color: #fff; border-color: var(--text); }
.chip-count { opacity: .65; font-weight: 400; }

/* ── HORIZONTAL ROW (home page) ── */
.mtv-row { margin-bottom: 32px; }
.mtv-row-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.mtv-row-title {
    color: var(--text);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -.015em;
    cursor: default;
}
a.mtv-row-title { cursor: pointer; }
a.mtv-row-title:hover { color: var(--accent); }
.mtv-chev { color: var(--text-light); font-weight: 400; margin-left: 2px; }
.mtv-row-title:hover .mtv-chev { color: var(--accent); }
.mtv-row-more {
    color: var(--accent);
    text-decoration: none;
    font-size: .84rem;
    font-weight: 500;
    white-space: nowrap;
}
.mtv-row-more:hover { text-decoration: underline; }

/* Horizontal scroller */
.mtv-scroller {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    padding: 4px 2px 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}
.mtv-scroller::-webkit-scrollbar { height: 4px; }
.mtv-scroller::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

/* ── FLAT GRID (filter / channel view) ── */
.mtv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 16px 10px;
    padding: 4px 0 20px;
}
.mtv-count { font-size: .85rem; color: var(--text-muted); margin-bottom: 12px; }

/* ── MOVIE TILE — PORTRAIT POSTER ── */
.mtv-tile {
    flex: 0 0 130px;
    width: 130px;
    text-decoration: none;
    color: inherit;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    transition: transform .18s ease;
}
.mtv-grid .mtv-tile {
    flex: 1 1 auto;
    width: auto;
}
.mtv-tile:hover { transform: translateY(-2px); }

/* POSTER — portrait 2:3 */
.mtv-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: var(--radius-card);
    background: #e8e8e8;
    box-shadow: var(--shadow-card);
}
.mtv-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .25s ease, filter .2s ease;
}
.mtv-tile:hover .mtv-thumb { box-shadow: var(--shadow-hover); }
.mtv-tile:hover .mtv-thumb img { transform: scale(1.04); filter: brightness(.88); }

/* Play overlay on hover */
.mtv-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s;
    background: rgba(0,0,0,.3);
}
.mtv-play::after {
    content: '';
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,.92);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0,0,0,.3);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230f0f0f'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
    background-size: 28px;
    background-repeat: no-repeat;
    background-position: 55% center;
}
.mtv-tile:hover .mtv-play { opacity: 1; }

/* Free badge on poster */
.mtv-badge {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: var(--badge-free);
    color: #fff;
    font-size: .62rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 3px;
    letter-spacing: .03em;
    text-transform: uppercase;
}

/* ── Tile info ── */
.mtv-info { padding: 7px 2px 2px; }
.mtv-tile-title {
    font-size: .84rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 3px;
}
.mtv-tile-meta {
    font-size: .74rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.mtv-meta-row {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.mtv-free-tag {
    color: var(--badge-free);
    font-weight: 600;
    font-size: .72rem;
}
.mtv-views { color: var(--accent); font-weight: 500; }
.mtv-dot { color: #ccc; }

/* ── Empty ── */
.mtv-empty {
    background: var(--surface);
    color: var(--text-muted);
    padding: 32px 24px;
    border-radius: var(--radius-card);
    text-align: center;
    font-size: .95rem;
    border: 1px dashed var(--border);
}

/* ── Pager ── */
.mtv-app .pager, .mtv-app .pagination { margin-top: 20px; }
.mtv-app .pager a, .mtv-app .pagination a { color: var(--accent); }

/* ── Details page ── */
.mtv-details {
    background: var(--bg);
    color: var(--text);
    border-radius: var(--radius-card);
    padding: 16px 24px 40px;
    max-width: 720px;
    margin: 0 auto;
    font-family: var(--font);
}
.mtv-details .article-header { margin-bottom: 16px; }
.mtv-details .article-header h1 {
    margin: 0 0 8px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.25;
}
.mtv-details .article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--text-muted);
    font-size: .88rem;
}
.mtv-details .article-meta .channel { color: var(--accent); font-weight: 500; }
.mtv-details .article-content {
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin-top: 16px;
}
.mtv-details .article-content h2 { margin: 0 0 8px; font-size: 1rem; font-weight: 700; }
.mtv-details .article-content p { margin: 0; color: #333; line-height: 1.6; font-size: .93rem; }
.mtv-details .source-link {
    margin: 20px 0;
    padding: 12px 16px;
    background: #f0f4ff;
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    font-size: .9rem;
}
.mtv-details .source-link a { color: var(--accent); }
.mtv-details .btn-secondary {
    display: inline-block;
    background: var(--surface);
    color: var(--text);
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: .9rem;
    border: 1px solid var(--border);
    transition: all .15s;
}
.mtv-details .btn-secondary:hover { background: var(--border); }

/* ── Mobile ── */
@media (max-width: 600px) {
    .mtv-app { padding: 0 10px 24px; }
    .mtv-h1 { font-size: 1.2rem; }
    .mtv-controls { width: 100%; }
    .mtv-search { flex: 1; width: auto; }
    .mtv-tile { flex: 0 0 120px; width: 120px; }
    .mtv-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px 8px; }
    .mtv-tile-title { font-size: .8rem; }
    .mtv-details { padding: 10px 14px 28px; }
    .mtv-details .article-header h1 { font-size: 1.2rem; }
}
