/* =======================================================
   SERIES.CSS — TheuZinho TV
   Catálogo de Séries — alinhado ao padrão de filmes.css
   ======================================================= */

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

/* ── CONTAINER PRINCIPAL ─────────────────────────────── */
.series-page-container {
    padding-top: 60px;
    min-height: 100vh;
    background: #090B13;
    color: white;
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* ── HERO ─────────────────────────────────────────────── */
.series-hero {
    padding: 30px 0 0;
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.12) 0%, transparent 100%);
    text-align: center;
    position: relative;
}

.series-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(139, 92, 246, 0.15), transparent);
    pointer-events: none;
}

.series-hero-content {
    position: relative;
    z-index: 1;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 5% 20px;
}

.series-hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 900;
    margin-bottom: 8px;
    letter-spacing: -1.5px;
    background: linear-gradient(135deg, #ffffff 30%, #8B5CF6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}

.series-hero p {
    color: #94A3B8;
    font-size: 1.05rem;
    max-width: 560px;
    margin: 0 auto 28px;
}

/* ── SEARCH BAR ──────────────────────────────────────── */
.series-search-bar {
    max-width: 580px;
    margin: 0 auto 20px;
    position: relative;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 100px;
    padding: 0 20px;
    height: 52px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.series-search-bar:focus-within {
    background: rgba(139, 92, 246, 0.08);
    border-color: #8B5CF6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15), 0 8px 24px rgba(0, 0, 0, 0.3);
}

.series-search-bar i {
    color: #475569;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.series-search-bar input {
    background: none;
    border: none;
    color: white;
    width: 100%;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    outline: none;
}
.series-search-bar input::placeholder { color: #475569; }

.clear-search-btn {
    background: none;
    border: none;
    color: #475569;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 6px;
    display: none;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, transform 0.2s;
    flex-shrink: 0;
}
.clear-search-btn:hover { color: #fff; transform: scale(1.2); }
.clear-search-btn.visible { display: flex; }

/* ── PLATFORM FILTERS ────────────────────────────────── */
.series-platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    max-width: 1400px;
    margin: 0 auto;
}

.platform-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94A3B8;
    padding: 7px 18px;
    border-radius: 100px;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.platform-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.4);
    color: #fff;
}

.platform-btn.active {
    background: #8B5CF6;
    border-color: #8B5CF6;
    color: #fff;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}

/* ── GRID DE SÉRIES ──────────────────────────────────── */
.series-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    padding: 20px 5%;
    max-width: 1600px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* ── CARD DE SÉRIE ───────────────────────────────────── */
.series-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.3s ease;
    outline: none;
    border-radius: 12px;
}

.series-card:hover { transform: translateY(-6px); }

/* Poster */
.series-card-poster {
    aspect-ratio: 2 / 3;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: #161C2D;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.series-card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.4s ease;
    position: relative;
    z-index: 2;
}
.series-card-poster img.loaded { opacity: 1; }

/* Placeholder */
.series-poster-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #1a1a44 0%, #0f0f29 100%);
    border-radius: 12px;
    z-index: 2;
}
.series-poster-placeholder i { font-size: 2rem; color: rgba(139, 92, 246, 0.4); }
.series-poster-placeholder span { font-size: 1.4rem; font-weight: 800; color: rgba(255, 255, 255, 0.15); letter-spacing: 2px; }

/* Overlay play */
.series-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.1) 50%, transparent 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 3;
}
.series-card:hover .series-card-overlay { opacity: 1; }

.series-play-btn {
    width: 52px;
    height: 52px;
    background: rgba(139, 92, 246, 0.9);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.7);
    transition: transform 0.3s ease;
    padding-left: 4px;
}
.series-card:hover .series-play-btn { transform: scale(1); }

/* Badge de nota (rating) */
.series-card-rating {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    padding: 4px 9px;
    border-radius: 8px;
    display: none; /* Injetado pelo JS se houver nota */
    align-items: center;
    gap: 5px;
    z-index: 4;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.series-card-rating i   { color: #FBBF24; font-size: 0.75rem; }
.series-card-rating-val { color: #fff; font-size: 0.8rem; font-weight: 700; }

/* Badge do ano */
.series-card-year {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(139, 92, 246, 0.8);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    z-index: 4;
    backdrop-filter: blur(4px);
    display: none; /* Injetado pelo JS */
}

/* Botão Favoritar no Card */
.series-card-fav-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.series-card-fav-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.series-card-fav-btn.active {
    color: #FBBF24;
}

.series-card-fav-btn i {
    font-size: 0.9rem;
    transition: transform 0.2s;
}

.series-card-fav-btn:active i {
    transform: scale(1.4);
}

/* Badge de episódios */
.series-ep-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(139, 92, 246, 0.85);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    z-index: 4;
    backdrop-filter: blur(4px);
}

/* Info abaixo do poster */
.series-card-info { padding: 0 2px; }

.series-card-info h3 {
    font-size: 0.82rem;
    color: #CBD5E1;
    font-weight: 600;
    margin: 0 0 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}
.series-card:hover .series-card-info h3 { color: #fff; }

.series-card-info .series-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

.series-meta-tag {
    font-size: 0.72rem;
    font-weight: 600;
    color: #A78BFA;
    background: rgba(139, 92, 246, 0.1);
    padding: 2px 8px;
    border-radius: 20px;
}

.series-meta-seasons {
    font-size: 0.72rem;
    color: #475569;
    font-weight: 500;
}

/* ── LOADING / ESTADO VAZIO ──────────────────────────── */
.series-loading, .series-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 80px 20px;
    color: #475569;
    font-size: 0.9rem;
}

.series-loading .spinner {
    width: 40px; height: 40px;
    border: 3px solid rgba(139, 92, 246, 0.15);
    border-top: 3px solid #8B5CF6;
    border-radius: 50%;
    animation: series-spin 0.9s linear infinite;
}
@keyframes series-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.series-empty i { font-size: 3rem; }
.series-empty p { font-size: 1rem; text-align: center; }

/* ── BOTÃO CARREGAR MAIS ─────────────────────────────── */
.load-more-wrapper {
    display: none;
    justify-content: center;
    padding: 8px 24px 60px;
}

.btn-carregar-mais {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #4c1d95, #6d28d9);
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: #fff;
    padding: 14px 32px;
    border-radius: 100px;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 24px rgba(139, 92, 246, 0.2);
}

.btn-carregar-mais i { font-size: 1.1rem; animation: bounce-down 1.8s ease-in-out infinite; }

@keyframes bounce-down {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(4px); }
}

.btn-carregar-mais:hover {
    background: linear-gradient(135deg, #6d28d9, #8b5cf6);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
}

.remaining-badge {
    background: rgba(255,255,255,0.15);
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 700;
}

/* ── BACK TO TOP ─────────────────────────────────────── */
.back-to-top {
    position: fixed;
    bottom: 28px; right: 28px;
    width: 44px; height: 44px;
    background: #8B5CF6;
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
}
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover { background: #7C3AED; transform: translateY(-2px); }

/* ── RESPONSIVIDADE ──────────────────────────────────── */

/* TABLETS RETRATO (portrait ≤ 1024px) - SERIES */
@media (max-width: 1024px) and (orientation: portrait) {
    .series-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 16px;
        padding: 24px 4%;
    }
}

/* SMART TV (960px) E TABLETS DEITADOS - SERIES */
@media (max-width: 1024px) and (orientation: landscape) {
    .series-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 16px;
        padding: 24px 4%;
    }
}

@media (max-width: 768px) {
    .series-hero { padding: 32px 16px 24px; }
    .series-hero h1 { font-size: 2rem; }
    .series-hero p  { font-size: 0.9rem; }

    .series-grid {
        gap: 12px;
        padding: 20px 12px;
    }

    .btn-carregar-mais { padding: 12px 24px; font-size: 0.88rem; }

    .back-to-top { bottom: 16px; right: 16px; width: 40px; height: 40px; }
}

@media (max-width: 480px) {
    .series-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 16px 10px;
    }
    .series-card-info h3 { font-size: 0.75rem; }
}

@media (min-width: 1600px) {
    .series-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        padding: 32px 8%;
    }
}
