/**
 * Pipocacine - Design Profissional de Streaming
 */

:root {
    --bg-dark: #0a0a0c;
    --bg-surface: #111115;
    --bg-card: #131317;
    --bg-card-hover: #1a1a20;
    --primary: #f59e0b;
    --primary-hover: #fbbf24;
    --primary-glow: none;
    --accent-red: #ef4444;
    --accent-cyan: #06b6d4;
    --text-main: #f8fafc;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;
    --border-color: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(255, 255, 255, 0.16);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 14px;
    --radius-full: 9999px;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Plus Jakarta Sans', 'Inter', sans-serif;
    --transition: all 0.2s ease;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    padding-bottom: 70px; /* Espaço para menu mobile */
}

@media (min-width: 769px) {
    body { padding-bottom: 0; }
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.pipoca-container {
    width: 100%;
    max-width: 1380px;
    margin: 0 auto;
    padding: 0 16px;
}

@media (min-width: 1024px) {
    .pipoca-container { padding: 0 24px; }
}

/* ==========================================================
   HEADER
   ========================================================== */
.pipoca-header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(10, 10, 12, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: var(--transition);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
    gap: 16px;
}

.header-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo-img {
    height: 38px;
    width: auto;
}

.header-nav {
    display: none;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
}

@media (min-width: 860px) {
    .header-nav { display: flex; }
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
}

.nav-link:hover, .nav-link.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
    color: var(--primary);
    background: rgba(245, 158, 11, 0.1);
}

/* BUSCA */
.header-search-wrap {
    position: relative;
    flex: 1;
    max-width: 420px;
}

.search-form {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-dim);
    pointer-events: none;
    transition: var(--transition);
}

.search-input {
    width: 100%;
    height: 42px;
    padding: 0 42px 0 42px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: #ffffff;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-input:focus + .search-icon {
    color: var(--primary);
}

.search-submit {
    position: absolute;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-submit svg { width: 16px; height: 16px; }

.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    overflow: hidden;
    display: none;
    z-index: 1010;
}

.search-dropdown.active { display: block; }

.search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.search-item:last-child { border-bottom: none; }

.search-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.search-item-thumb {
    width: 36px;
    height: 52px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.search-item-info {
    min-width: 0;
    flex: 1;
}

.search-item-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-item-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.header-badge-free {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
    color: #34d399;
    flex-shrink: 0;
}

@media (min-width: 640px) {
    .header-badge-free { display: inline-flex; }
}

.badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 8px #34d399;
}

/* ==========================================================
   HERO / DESTAQUE PRINCIPAL
   ========================================================== */
.hero-section {
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 0 60px 0;
    margin-bottom: 30px;
    overflow: hidden;
    background-color: var(--bg-dark);
}

@media (min-width: 768px) {
    .hero-section { min-height: 560px; padding: 100px 0 70px 0; }
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center 20%;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, #0a0a0c 0%, rgba(10,10,12,0.4) 50%, rgba(10,10,12,0.85) 100%),
                linear-gradient(180deg, rgba(10,10,12,0.65) 0%, transparent 40%, rgba(10,10,12,0.95) 100%);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-logo {
    max-height: 110px;
    max-width: 380px;
    object-fit: contain;
    margin: 0 auto 24px auto;
    filter: drop-shadow(0 6px 16px rgba(0,0,0,0.8));
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 900;
    line-height: 1.15;
    color: #ffffff;
    margin-bottom: 20px;
    text-shadow: 0 4px 12px rgba(0,0,0,0.8);
    text-align: center;
}

@media (min-width: 768px) {
    .hero-title { font-size: 3.2rem; }
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #0b0e14;
    font-size: 1.02rem;
    font-weight: 800;
    padding: 13px 30px;
    border-radius: var(--radius-full);
    box-shadow: 0 4px 14px rgba(0,0,0,0.35);
    transition: var(--transition);
}

.btn-primary:hover {
    filter: brightness(1.08);
    color: #000;
}

.btn-primary svg { width: 20px; height: 20px; fill: currentColor; }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 0.98rem;
    font-weight: 700;
    padding: 13px 26px;
    border-radius: var(--radius-full);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: var(--transition);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.25);
}

/* ==========================================================
   SEÇÕES E CARDS DE FILMES E SÉRIES
   ========================================================== */
.section-block {
    margin-bottom: 42px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 12px;
}

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

.section-title-bar {
    width: 4px;
    height: 22px;
    background: linear-gradient(180deg, var(--primary) 0%, #ef4444 100%);
    border-radius: 4px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.3px;
}

.section-more-link {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.section-more-link:hover {
    color: var(--primary-hover);
    transform: translateX(3px);
}

/* GRADE DE CONTEÚDO */
.media-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

@media (min-width: 480px) {
    .media-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

@media (min-width: 768px) {
    .media-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; }
}

@media (min-width: 1024px) {
    .media-grid { grid-template-columns: repeat(6, 1fr); gap: 20px; }
}

/* CARD DE MÍDIA ESTILO POBREFLIX */
.media-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card);
    aspect-ratio: 2 / 3;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s ease;
}

.media-card:hover {
    border-color: var(--border-hover);
}

.media-card-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.media-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Badges sobrepostas no poster (topo esquerdo) */
.media-badges-top {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.badge-tag {
    font-size: 0.66rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-tag.tag-quality {
    background: rgba(0, 0, 0, 0.78);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.badge-tag.tag-audio {
    background: var(--primary);
    color: #0b0e14;
    font-weight: 900;
}

/* Título e ano subindo no hover do card */
.media-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 38px 10px 10px 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 65%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.22s ease-out, opacity 0.22s ease-out;
    pointer-events: none;
    z-index: 3;
}

.media-card:hover .media-card-overlay {
    transform: translateY(0);
    opacity: 1;
}

.media-card-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-card-year {
    font-size: 0.74rem;
    font-weight: 500;
    color: #9ca3af;
    margin-top: 2px;
}

/* Telas touch: overlay visível discretamente */
@media (hover: none) {
    .media-card-overlay {
        transform: translateY(0);
        opacity: 1;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.3) 60%, transparent 100%);
        padding: 24px 8px 8px 8px;
    }
}

/* ==========================================================
   PÁGINAS INTERNAS E DETALHES (FILME & SÉRIE)
   ========================================================== */
.content-detail-hero {
    position: relative;
    padding: 40px 0 30px 0;
    margin-bottom: 24px;
}

.detail-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
}

@media (min-width: 900px) {
    .detail-layout {
        grid-template-columns: 280px 1fr;
        align-items: start;
        gap: 36px;
    }
}

.detail-poster-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.detail-poster-img {
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    border-radius: var(--radius-md);
    box-shadow: 0 16px 36px rgba(0,0,0,0.6);
    border: 1px solid var(--border-color);
}

.detail-info-column {
    min-width: 0;
}

.detail-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 900;
    color: #ffffff;
    line-height: 1.2;
    margin-bottom: 12px;
}

@media (min-width: 768px) {
    .detail-title { font-size: 2.6rem; }
}

.detail-meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.genres-pills {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.genre-pill {
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    color: #e2e8f0;
}

.detail-synopsis {
    color: #cbd5e1;
    font-size: 0.96rem;
    line-height: 1.7;
    margin-bottom: 24px;
}

/* ÁREA DO PLAYER */
.player-container-wrap {
    margin-bottom: 36px;
}

.player-aspect-box {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #020617;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.7);
    border: 1px solid var(--border-color);
}

.player-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.player-audio-tabs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.audio-btn {
    padding: 8px 18px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.audio-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.audio-btn.active {
    background: var(--primary);
    color: #0b0e14;
    border-color: var(--primary);
    font-weight: 900;
}

/* TEMPORADAS E EPISÓDIOS DA SÉRIE */
.seasons-block {
    margin-top: 32px;
}

.season-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 18px;
    scrollbar-width: thin;
}

.season-tab-btn {
    padding: 9px 20px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.season-tab-btn:hover {
    color: #fff;
    background: var(--bg-card-hover);
}

.season-tab-btn.active {
    background: var(--primary);
    color: #0b0e14;
    border-color: var(--primary);
    font-weight: 900;
}

.episodes-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 12px;
}

@media (min-width: 600px) {
    .episodes-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}

@media (min-width: 990px) {
    .episodes-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

.episode-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.episode-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.episode-card.active {
    border-color: var(--primary);
    background: rgba(245, 158, 11, 0.08);
}

.episode-thumb-wrap {
    position: relative;
    width: 90px;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: #111827;
}

.episode-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.episode-info {
    min-width: 0;
    flex: 1;
}

.episode-number {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
}

.episode-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

/* ==========================================================
   FOOTER
   ========================================================== */
.pipoca-footer {
    background: #060910;
    border-top: 1px solid var(--border-color);
    padding: 48px 0 24px 0;
    margin-top: 60px;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    margin-bottom: 40px;
}

@media (min-width: 768px) {
    .footer-inner { grid-template-columns: 2fr 1fr 1fr; gap: 48px; }
}

.footer-brand { max-width: 380px; }
.footer-logo { margin-bottom: 14px; }
.footer-desc { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }

.footer-group-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-links { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: var(--text-muted); font-size: 0.88rem; }
.footer-links a:hover { color: var(--primary); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 24px;
}

.footer-bottom-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 0.82rem;
    color: var(--text-dim);
}

.footer-tags {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-tags span {
    padding: 3px 8px;
    background: rgba(255,255,255,0.04);
    border-radius: 4px;
    color: var(--text-muted);
}

/* ==========================================================
   BOTTOM NAVIGATION BAR MOBILE
   ========================================================== */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: rgba(8, 12, 20, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1000;
}

@media (min-width: 769px) {
    .mobile-bottom-nav { display: none; }
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 6px 12px;
}

.mobile-nav-item svg { width: 20px; height: 20px; stroke-width: 2.2; }
.mobile-nav-item.active { color: var(--primary); }
.mobile-nav-item.active svg { stroke: var(--primary); }
