/* SharkTV - Netflix Dark Theme */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* ── Reset & Base ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-primary: #050505;
    --bg-card: #101010;
    --bg-card-hover: #1a1a1a;
    --bg-header: rgba(5, 5, 5, 0.85);
    --bg-modal: rgba(0, 0, 0, 0.75);
    --accent: #E50914;
    --accent-hover: #f40612;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #666666;
    --border: #222222;
    --rating-gold: #f5c518;
    --success: #46d369;
    --radius: 6px;
    --radius-lg: 10px;
    --header-height: 64px;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }

/* ── Header ────────────────────────────────────────── */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 4%;
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
    background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, transparent 100%);
}

.header.scrolled {
    background: var(--bg-header);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.header-logo {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: 2px;
    margin-right: 2rem;
    text-transform: uppercase;
}

.header-nav {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.header-nav a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 400;
    transition: color 0.2s;
    position: relative;
}

.header-nav a:hover,
.header-nav a.active {
    color: var(--text-primary);
}

.header-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
}

/* ── Page Hero Banner ──────────────────────────────── */
.page-hero {
    padding: calc(var(--header-height) + 3rem) 4% 2rem;
    background: linear-gradient(135deg, rgba(229,9,20,0.15) 0%, var(--bg-primary) 60%);
    border-bottom: 1px solid var(--border);
}

.page-hero-title {
    font-size: 2.2rem;
    font-weight: 700;
}

.page-hero-sub {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.sync-info {
    color: var(--text-muted);
    font-size: 0.8rem;
    background: var(--bg-card);
    padding: 3px 10px;
    border-radius: 20px;
}

/* ── Hero Slider ───────────────────────────────────── */
.hero {
    position: relative;
    height: 85vh;
    min-height: 500px;
    max-height: 900px;
    overflow: hidden;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.8s ease;
    background-size: cover;
    background-position: center top;
}

.hero-slide.active { opacity: 1; }

.hero-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        0deg,
        var(--bg-primary) 0%,
        rgba(5,5,5,0.6) 30%,
        rgba(5,5,5,0.2) 60%,
        rgba(5,5,5,0.4) 100%
    );
}

.hero-content {
    position: absolute;
    bottom: 15%;
    left: 4%;
    max-width: 550px;
    z-index: 2;
}

.hero-badge {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.hero-rating {
    color: var(--rating-gold);
    font-weight: 600;
}

.hero-plot {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-dots {
    position: absolute;
    bottom: 5%;
    left: 4%;
    display: flex;
    gap: 8px;
    z-index: 2;
}

.hero-dot {
    width: 12px;
    height: 3px;
    border-radius: 2px;
    background: rgba(255,255,255,0.3);
    border: none;
    transition: all 0.3s;
    cursor: pointer;
}

.hero-dot.active {
    width: 28px;
    background: var(--accent);
}

/* ── Section Titles ────────────────────────────────── */
.section {
    padding: 2rem 4%;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 600;
}

.section-link {
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: color 0.2s;
}

.section-link:hover { color: var(--accent); }

/* ── Content Grid ──────────────────────────────────── */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
}

/* ── Movie/Series Card ─────────────────────────────── */
.card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
}

.card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(0,0,0,0.6);
    z-index: 5;
}

.card-poster {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
    background: #1a1a1a;
}

.card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s;
}

.card-poster img.lazy { opacity: 0; }
.card-poster img.loaded { opacity: 1; }

.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.25s;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0.75rem;
}

.card:hover .card-overlay { opacity: 1; }

.card-rating {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.75);
    color: var(--rating-gold);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    gap: 3px;
}

.card-rating svg { width: 12px; height: 12px; }

.card-info {
    padding: 0.6rem 0.5rem;
}

.card-title {
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-episodes-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--accent);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    margin-top: 4px;
    transition: background 0.2s;
}

.card-episodes-btn:hover { background: var(--accent-hover); }
.card-episodes-btn svg { width: 12px; height: 12px; }

/* ── Top 10 Horizontal Scroll ──────────────────────── */
.top10-scroll {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.top10-scroll::-webkit-scrollbar { display: none; }

.top10-item {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    scroll-snap-align: start;
    position: relative;
}

.top10-number {
    font-size: 7rem;
    font-weight: 800;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 2px #444;
    margin-right: -20px;
    z-index: 1;
    position: relative;
    user-select: none;
}

.top10-item .card {
    width: 140px;
    flex-shrink: 0;
}

.top10-item .card-poster { aspect-ratio: 2/3; }

/* ── New Episodes Badge ────────────────────────────── */
.badge-new {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--success);
    color: #000;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

/* ── Page Header (filmler, diziler, bolumler) ──────── */
.page-header {
    padding: calc(var(--header-height) + 2rem) 4% 1rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* ── Filters ───────────────────────────────────────── */
.filters {
    display: flex;
    gap: 0.75rem;
    padding: 0 4% 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-select {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23b3b3b3'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
    min-width: 160px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent);
}

.filter-search {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-family: inherit;
    flex: 1;
    max-width: 300px;
}

.filter-search::placeholder { color: var(--text-muted); }
.filter-search:focus { outline: none; border-color: var(--accent); }

/* ── Pagination ────────────────────────────────────── */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem 4%;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.pagination a {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.pagination a:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--accent);
}

.pagination .current {
    background: var(--accent);
    color: white;
    border: 1px solid var(--accent);
}

.pagination .disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* ── Episode Modal ─────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--bg-modal);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: #181818;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s;
    scrollbar-width: thin;
    scrollbar-color: #444 transparent;
}

.modal-backdrop.open .modal { transform: translateY(0); }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: #181818;
    z-index: 1;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover { color: white; }

.modal-body { padding: 1.25rem 1.5rem; }

.modal-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    flex-wrap: wrap;
}

.modal-tmdb-link {
    color: var(--accent);
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 1rem;
}

.modal-tmdb-link:hover { text-decoration: underline; }

.season-select {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-family: inherit;
    margin-bottom: 1rem;
    cursor: pointer;
}

.episode-list { list-style: none; }

.episode-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.episode-item:last-child { border-bottom: none; }

.episode-number {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 28px;
    text-align: center;
}

.episode-info { flex: 1; }

.episode-title {
    font-size: 0.9rem;
    font-weight: 500;
}

.episode-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.episode-ext {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 2px 8px;
    border-radius: 3px;
}

/* ── Footer ────────────────────────────────────────── */
.footer {
    padding: 3rem 4% 2rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-logo {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 1px;
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ── Loading Spinner ───────────────────────────────── */
.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-center {
    display: flex;
    justify-content: center;
    padding: 3rem 0;
}

/* ── Empty State ───────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state-text {
    font-size: 1rem;
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 768px) {
    .header { padding: 0 3%; }
    .header-logo { font-size: 1.2rem; margin-right: 1rem; }
    .header-nav { gap: 1rem; }
    .header-nav a { font-size: 0.8rem; }

    .hero { height: 65vh; min-height: 400px; }
    .hero-title { font-size: 1.8rem; }
    .hero-content { bottom: 20%; left: 3%; max-width: 85%; }
    .hero-plot { -webkit-line-clamp: 2; font-size: 0.85rem; }

    .section { padding: 1.5rem 3%; }
    .section-title { font-size: 1.1rem; }

    .content-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 0.75rem;
    }

    .card-info { padding: 0.4rem; }
    .card-title { font-size: 0.7rem; }
    .card-meta { font-size: 0.6rem; }

    .top10-number { font-size: 5rem; }
    .top10-item .card { width: 110px; }

    .page-header { padding: calc(var(--header-height) + 1rem) 3% 0.75rem; }
    .page-title { font-size: 1.5rem; }

    .filters { padding: 0 3% 1rem; }
    .filter-search { max-width: 100%; }

    .modal { width: 95%; max-height: 90vh; }
    .modal-header { padding: 1rem; }
    .modal-body { padding: 1rem; }
}

@media (max-width: 480px) {
    .content-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    .hero-title { font-size: 1.5rem; }
    .hero-meta { font-size: 0.8rem; gap: 0.5rem; }
}
