/* ==========================================================================
   CONCURSSAURO PLAY - PREMIUM STREAMING STYLES
   ========================================================================== */

/* --- VARIÁVEIS GLOBAIS --- */
:root {
    /* Paleta Netflix/Premium */
    --play-bg-main: #0b0b0b;
    --play-bg-secondary: #141414;
    --play-bg-modal: #181818;
    --play-bg-hover: #232323;
    
    /* Cores de Destaque */
    --play-accent: #fdbb2d; /* Dourado Concurssauro Premium */
    --play-accent-hover: #e5a910;
    --play-match: #46d369; /* Verde Netflix (Relevância) */
    --play-danger: #e50914; /* Vermelho Alerta */
    --play-info: #1a2a6c; /* Azul Profundo */

    /* Tipografia e Cores de Texto */
    --play-text-primary: #ffffff;
    --play-text-secondary: #b3b3b3;
    --play-text-muted: #808080;
    
    /* Espaçamento e Bordas */
    --play-padding-x: 4%;
    --play-radius: 6px;
    --play-radius-lg: 12px;
    
    /* Transições */
    --play-transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    
    /* Z-Index Hierarchy */
    --z-nav: 1000;
    --z-sidebar: 900;
    --z-overlay: 800;
    --z-modal: 1100;
}

/* --- RESETS E BASE --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    overflow-x: hidden; /* Trava absoluta contra scroll lateral em celulares */
}

body.play-dark-theme {
    background-color: var(--play-bg-secondary);
    color: var(--play-text-primary);
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    overflow-x: hidden;
    width: 100%; /* Impede o body de passar da largura da tela */
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Ocultar barra de rolagem principal mas manter funcionalidade */
body.play-dark-theme::-webkit-scrollbar {
    width: 8px;
}
body.play-dark-theme::-webkit-scrollbar-track {
    background: var(--play-bg-main);
}
body.play-dark-theme::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}
body.play-dark-theme::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* --- CONTROLE DE VIEWS (SPA MOCK) --- */
.play-view {
    display: none;
    opacity: 0;
    animation: fadeInView 0.4s forwards;
    min-height: 100vh;
    padding-bottom: 50px;
}

.active-view {
    display: block;
}

@keyframes fadeInView {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   NAVBAR E HEADER
   ========================================================================== */
.play-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    padding: 0 var(--play-padding-x);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    background-color: rgba(20, 20, 20, 0.95); /* Fundo vidro */
    backdrop-filter: blur(10px);
    z-index: var(--z-nav);
    transition: background-color var(--play-transition);
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.play-logo {
    height: 35px;
    object-fit: contain;
    cursor: pointer;
    transition: transform var(--play-transition);
}

.play-logo:hover {
    transform: scale(1.05);
}

.desktop-nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

.desktop-nav a {
    color: var(--play-text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: color var(--play-transition);
}

.desktop-nav a:hover, .desktop-nav a.active {
    color: var(--play-text-primary);
    font-weight: 600;
}

/* Search Box */
.search-box {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
    padding: 5px 10px;
    border-radius: 20px;
    transition: all var(--play-transition);
}

.search-box:focus-within {
    background: rgba(0, 0, 0, 0.8);
    border-color: var(--play-text-secondary);
    width: 250px;
}

.search-box i {
    color: var(--play-text-secondary);
    font-size: 14px;
}

.search-box input {
    background: transparent;
    border: none;
    color: white;
    padding: 5px 10px;
    outline: none;
    width: 150px;
    transition: width var(--play-transition);
}

/* Quota Display */
.quota-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(253, 187, 45, 0.1);
    color: var(--play-accent);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    border: 1px solid rgba(253, 187, 45, 0.3);
}

/* Profile Dropdown */
.user-profile-dropdown {
    position: relative;
    cursor: pointer;
}

.profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid #333;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 45px;
    background-color: var(--play-bg-modal);
    min-width: 200px;
    border: 1px solid #333;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0,0,0,0.8);
}

.user-profile-dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: var(--play-text-secondary);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    transition: background var(--play-transition);
}

.dropdown-content a:hover {
    background-color: var(--play-bg-hover);
    color: white;
}

/* ==========================================================================
   SIDEBAR (MOBILE)
   ========================================================================== */
#play-sidebar {
    position: fixed;
    top: 0;
    left: -250px;
    width: 250px;
    height: 100vh;
    background-color: var(--play-bg-main);
    z-index: var(--z-sidebar);
    transition: left var(--play-transition);
    padding-top: 80px;
    border-right: 1px solid #222;
}

#play-sidebar.active {
    left: 0;
}

.sidebar-menu {
    list-style: none;
    padding: 0 20px;
}

.menu-label {
    color: var(--play-text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 20px 0 10px 0;
    font-weight: bold;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    color: var(--play-text-secondary);
    border-radius: var(--play-radius);
    transition: all var(--play-transition);
    font-size: 15px;
}

.sidebar-link:hover, .sidebar-link.active {
    background-color: var(--play-bg-hover);
    color: white;
}

.highlight-link {
    color: var(--play-accent);
}

.highlight-link:hover {
    background-color: rgba(253, 187, 45, 0.1);
    color: var(--play-accent);
}

.mobile-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: var(--z-overlay);
    display: none;
    backdrop-filter: blur(3px);
}
.mobile-overlay.active { display: block; }

/* ==========================================================================
   HERO BANNER (Série em Destaque)
   ========================================================================== */
#play-main-content {
    padding-top: 0; /* Hero começa no topo, atrás da navbar */
}

.hero-banner {
    position: relative;
    height: 85vh;
    width: 100%;
    background-image: url('https://images.unsplash.com/photo-1589829085413-56de8ae18c73?auto=format&fit=crop&q=80&w=1920');
    background-size: cover;
    background-position: center top;
    display: flex;
    align-items: center;
    padding: 0 var(--play-padding-x);
}

/* Gradientes para mesclar com o fundo escuro do site */
.hero-vignette {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: 
        linear-gradient(to right, var(--play-bg-secondary) 10%, transparent 60%),
        linear-gradient(to top, var(--play-bg-secondary) 0%, transparent 30%);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background-color: var(--play-danger);
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 15px;
    /* text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    /* Efeito de texto Premium */
    background: linear-gradient(to bottom, #ffffff, #d4d4d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- ORGANIZAÇÃO DE METADADOS (HERO E DETALHES) --- */
.hero-meta {
    display: flex;
    flex-direction: column; /* [A MÁGICA AQUI]: Empilha os grupos um abaixo do outro */
    align-items: flex-start; /* Alinha todos os grupos à esquerda */
    gap: 8px; /* Espaço vertical suave entre as linhas */
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 25px;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.meta-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap; /* Garante que itens da mesma linha quebrem em telas de celular */
    gap: 15px; /* Espaço horizontal entre os itens (ex: entre 2026 e a Categoria) */
}

/* Removemos a divisória em pé (|) que usávamos antes, pois agora estão em linhas separadas */
.meta-group:not(:last-child)::after {
    display: none;
}

/* Estilos individuais das tags */
.match-score { color: var(--play-match); font-weight: bold; font-size: 15px; }
.year { font-weight: bold; text-shadow: 1px 1px 2px rgba(0,0,0,0.8); }
.rating-badge {
    border: 1px solid rgba(255,255,255,0.4);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    color: #ccc;
    background: rgba(0,0,0,0.4);
}
.category-tag {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
}

/* Cores de ícones utilitárias */
.icon-muted { color: #888; margin-right: 4px; }
.icon-accent { color: var(--play-accent); margin-right: 4px; }
.hero-creator { color: var(--play-accent); font-weight: bold; margin-top: 2px; }
.hero-rating { display: flex; align-items: center; gap: 5px; }

.hero-description {
    font-size: 1.2rem;
    line-height: 1.5;
    color: #e5e5e5;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    margin-bottom: 25px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-actions {
    display: flex;
    gap: 15px;
}

/* Botões do Hero */
.btn-play-hero, .btn-info-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 24px;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all var(--play-transition);
    border: none;
}

.btn-play-hero {
    background-color: white;
    color: black;
}

.btn-play-hero:hover {
    background-color: rgba(255,255,255,0.7);
}

.btn-info-hero {
    background-color: rgba(109, 109, 110, 0.7);
    color: white;
}

.btn-info-hero:hover {
    background-color: rgba(109, 109, 110, 0.4);
}

/* ==========================================================================
   CARROSSEIS DE SÉRIES (SWIPER)
   ========================================================================== */
.slider-row {
    margin-top: 50px;
    margin-bottom: 40px;
    position: relative;
    z-index: 20;
    padding: 0 var(--play-padding-x);
}

.slider-row ~ .slider-row {
    margin-top: 0;
}

.row-title {
    font-size: 1.2rem;
    color: #e5e5e5;
    margin-bottom: 10px;
    font-weight: 600;
}

/* Estilo do Card do Curso (Thumbnail) */
.course-card {
    background-color: var(--play-bg-modal);
    border-radius: var(--play-radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--play-transition), box-shadow var(--play-transition);
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
    aspect-ratio: 16 / 9; /* Formato wide para cursos */
    position: relative;
}

.course-card:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.8);
    z-index: 10;
}

.course-card img.thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.3s;
}

.course-card:hover img.thumbnail {
    filter: brightness(0.7);
}

/* Informações que aparecem no Hover do Card */
.card-hover-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);
    opacity: 0;
    transform: translateY(10px);
    transition: all var(--play-transition);
}

.course-card:hover .card-hover-info {
    opacity: 1;
    transform: translateY(0);
}

.card-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-progress {
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    margin-bottom: 5px;
}

.card-progress-fill {
    height: 100%;
    background: var(--play-danger);
    border-radius: 2px;
}

/* Botões do Swiper Nativos */
.swiper-button-next, .swiper-button-prev {
    color: white !important;
    background: rgba(0,0,0,0.5);
    height: 100% !important;
    top: 0 !important;
    margin-top: 0 !important;
    width: 4% !important;
    opacity: 0;
    transition: opacity var(--play-transition);
}

.slider-row:hover .swiper-button-next,
.slider-row:hover .swiper-button-prev {
    opacity: 1;
}

.swiper-button-next:hover, .swiper-button-prev:hover {
    background: rgba(0,0,0,0.8);
}

.swiper-button-prev { left: -4% !important; }
.swiper-button-next { right: -4% !important; }

/* ==========================================================================
   TELA 2: CRIADOR DE SÉRIES (ESTÚDIO)
   ========================================================================== */
.create-container {
    max-width: 800px;
    margin: 120px auto 50px auto;
    background-color: var(--play-bg-modal);
    border-radius: var(--play-radius-lg);
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid #333;
    position: relative;
}

.create-header {
    text-align: center;
    margin-bottom: 30px;
}

.create-header h2 {
    font-size: 24px;
    color: var(--play-accent);
    margin-bottom: 10px;
}

.create-header p {
    color: var(--play-text-secondary);
    font-size: 14px;
}

textarea#edital-input {
    width: 100%;
    height: 250px;
    background-color: #0f0f0f;
    border: 1px solid #444;
    border-radius: var(--play-radius);
    padding: 15px;
    color: white;
    font-size: 15px;
    font-family: monospace;
    resize: none;
    margin-bottom: 20px;
    transition: border-color 0.3s;
}

textarea#edital-input:focus {
    outline: none;
    border-color: var(--play-accent);
    box-shadow: 0 0 10px rgba(253, 187, 45, 0.2);
}

.create-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cost-warning {
    color: var(--play-text-muted);
    font-size: 13px;
}

.btn-primary-large {
    background: linear-gradient(135deg, var(--play-accent) 0%, #d49815 100%);
    color: #000;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(253, 187, 45, 0.3);
}

.btn-primary-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(253, 187, 45, 0.5);
}

/* Overlay de Processamento */
#processing-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(24, 24, 24, 0.95);
    border-radius: var(--play-radius-lg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

#processing-overlay.hidden {
    display: none !important;
}

.loader-spinner {
    border: 4px solid rgba(255,255,255,0.1);
    border-top: 4px solid var(--play-accent);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* ==========================================================================
   TELA 3: DETALHES DO CURSO E LISTA DE EPISÓDIOS
   ========================================================================== */
#section-course-details {
    position: relative;
    padding-top: 0;
}

.details-backdrop {
    width: 100%;
    height: 60vh;
    /* [CORRIGIDO] Trocado via.placeholder por placehold.co */
    background-image: url('https://placehold.co/1920x800/1a2a6c/ffffff?text=Carregando+Capa');
    background-size: cover;
    background-position: center;
    position: absolute;
    top: 0;
    z-index: 1;
}

.details-gradient {
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, var(--play-bg-secondary) 0%, transparent 100%);
}

.details-content-wrapper {
    position: relative;
    z-index: 2;
    max-width: 1000px;
    margin: 0 auto;
    padding: 100px 20px 50px 20px;
}

.btn-close-details {
    position: absolute;
    top: 100px;
    right: 20px;
    background: rgba(0,0,0,0.5);
    border: 2px solid white;
    color: white;
    width: 40px; height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
}

.btn-close-details:hover {
    background: white;
    color: black;
}

.details-main-info h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.category-tag {
    background: #333;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.community-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: var(--play-accent);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.community-stats span {
    color: var(--play-text-secondary);
    font-size: 14px;
}

.synopsis {
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 700px;
    margin-bottom: 30px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.action-row {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.btn-play-main {
    background: white;
    color: black;
    border: none;
    padding: 10px 25px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-play-main:hover { background: #e5e5e5; }

.btn-icon-circle {
    background: rgba(42,42,42,0.6);
    border: 2px solid rgba(255,255,255,0.5);
    color: white;
    width: 45px; height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: border-color 0.2s;
}

.btn-icon-circle:hover { border-color: white; }

/* Lista de Episódios */
.seasons-selector {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    padding-bottom: 15px;
}

.modern-select {
    background: #222;
    color: white;
    border: 1px solid #444;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 16px;
    outline: none;
    cursor: pointer;
}

.episode-item {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #222;
    border-radius: 8px;
    transition: background 0.2s;
    cursor: pointer;
}

.episode-item:hover {
    background: var(--play-bg-hover);
}

.ep-number {
    font-size: 24px;
    color: var(--play-text-muted);
    width: 50px;
    font-weight: bold;
}

.ep-thumb-wrapper {
    position: relative;
    width: 140px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 20px;
    flex-shrink: 0;
}

.ep-thumb-wrapper img {
    width: 100%; height: 100%; object-fit: cover;
}

.ep-play-icon {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.6);
    width: 30px; height: 30px;
    border-radius: 50%;
    border: 1px solid white;
    display: flex; justify-content: center; align-items: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.episode-item:hover .ep-play-icon { opacity: 1; }

.ep-info { flex-grow: 1; }

.ep-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.ep-title { font-size: 16px; font-weight: bold; }
.ep-duration { font-size: 14px; color: var(--play-text-muted); }
.ep-desc { font-size: 13px; color: var(--play-text-secondary); line-height: 1.4; }

/* ==========================================================================
   TELA 4: O PLAYER DE LEITURA (GEMINI CONTENT)
   ========================================================================== */

.player-topbar {
    position: sticky;
    top: 0;
    background: #111;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    border-bottom: 1px solid #333;
    z-index: 100;
}

.btn-back-icon {
    background: none; border: none; color: white;
    font-size: 16px; cursor: pointer;
    display: flex; align-items: center; gap: 10px;
    transition: color 0.2s;
}

.btn-back-icon:hover { color: var(--play-accent); }

.player-titles { text-align: center; }
.player-series-title { display: block; font-size: 12px; color: var(--play-text-muted); text-transform: uppercase; }
.player-episode-title { font-size: 16px; font-weight: bold; }

.player-content-area {
    max-width: 800px;
    margin: 40px auto;
    background: #1a1a1a;
    border-radius: 12px;
    padding: 50px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    border: 1px solid #333;
}

/* ESTILOS PARA O HTML INJETADO PELO GEMINI 2.5 PRO
   (Essas classes devem bater com o Prompt do gerar-apostila.js)
*/
.play-episode-content {
    font-size: 17px;
    line-height: 1.8;
    color: #e5e5e5;
}

.play-episode-content h2.play-title {
    font-size: 32px;
    color: var(--play-accent);
    margin-bottom: 20px;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}

.play-episode-content h3 {
    font-size: 22px;
    color: #fff;
    margin: 35px 0 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.play-episode-content h3 i { color: var(--play-accent); }

.play-episode-content p { margin-bottom: 20px; }
.play-episode-content strong { color: #fff; background: rgba(255,255,255,0.1); padding: 2px 5px; border-radius: 3px; }

/* Box de Alerta/Bizu */
.play-episode-content .play-alert {
    background: rgba(229, 9, 20, 0.1); /* Fundo vermelho Netflix super suave */
    border-left: 4px solid var(--play-danger);
    padding: 20px;
    border-radius: 0 8px 8px 0;
    margin: 25px 0;
}

/* Tabelas Comparativas */
.play-episode-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    background: #222;
    border-radius: 8px;
    overflow: hidden;
}

.play-episode-content th, .play-episode-content td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #333;
}

.play-episode-content th { background: #2a2a2a; color: var(--play-accent); font-weight: bold; }
.play-episode-content tr:last-child td { border-bottom: none; }

/* Controles Base do Player */
.player-controls {
    max-width: 800px;
    margin: 0 auto 50px auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-control {
    background: transparent;
    border: 1px solid #555;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    align-items: center;
}

.btn-control:hover { background: #333; border-color: white; }

.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(253, 187, 45, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(253, 187, 45, 0); }
    100% { box-shadow: 0 0 0 0 rgba(253, 187, 45, 0); }
}

/* ==========================================================================
   MEDIA QUERIES (RESPONSIVIDADE MÁXIMA)
   ========================================================================== */
@media (max-width: 768px) {
    .desktop-nav { display: none; }
    .mobile-menu-toggle { display: block; }
    .search-box input { display: none; } /* Oculta input texto, mostra só lupa */
    
    .hero-title { font-size: 2rem; }
    .hero-banner { height: 60vh; }
    
    .create-container { margin: 80px 15px 20px 15px; padding: 20px; }
    
    .details-content-wrapper { padding-top: 50px; }
    .details-main-info h1 { font-size: 2rem; }
    .action-row { flex-direction: column; }
    
    .ep-thumb-wrapper { display: none; } /* Oculta imagem do ep no celular para poupar espaço */
    
    .player-content-area { margin: 20px 10px; padding: 20px; }
    .player-controls { flex-direction: column; gap: 15px; padding: 0 10px; }
    .btn-control, .btn-primary-large { width: 100%; text-align: center; }
}

/* ==========================================================================
   REVITALIZAÇÃO PREMIUM DO ESTÚDIO DE CRIAÇÃO (FORMULÁRIOS)
   ========================================================================== */

/* Grid e Labels */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.form-group label, .cover-selection-area label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--play-text-primary);
}

/* Inputs, Selects e Textarea Modernos */
.modern-input, .modern-select, .modern-textarea {
    width: 100%;
    background-color: #0f0f0f;
    border: 1px solid #444;
    color: #fff;
    padding: 12px 15px;
    border-radius: var(--play-radius);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
}

.modern-textarea {
    height: 200px;
    resize: vertical;
    line-height: 1.5;
}

.modern-input::placeholder, .modern-textarea::placeholder {
    color: #666;
}

/* Efeito Glow Dourado ao focar (Digitar) */
.modern-input:focus, .modern-select:focus, .modern-textarea:focus {
    border-color: var(--play-accent);
    box-shadow: 0 0 0 2px rgba(253, 187, 45, 0.2);
}

/* Select Customizado (Seta Branca) */
.modern-select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Área da Capa (Cover Selection) */
.cover-selection-area {
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #333;
    margin-bottom: 25px;
}

.cover-buttons {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.status-text {
    font-size: 12px;
    color: #aaa;
    margin-top: 10px;
}

/* Botão Premium Outline */
.btn-premium-outline {
    color: var(--play-accent);
    border-color: var(--play-accent);
    background-color: rgba(253, 187, 45, 0.05);
}

.btn-premium-outline:hover {
    background-color: rgba(253, 187, 45, 0.15);
    border-color: var(--play-accent);
    color: var(--play-accent);
}

/* Caixa do Estúdio de Revisão */
.review-box {
    background: #111;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

/* Responsividade Básica para o Formulário */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .cover-buttons {
        flex-direction: column;
    }
}

/* --- 1. CORREÇÃO DO DROPDOWN E CONFIGURAÇÕES --- */
.user-profile-dropdown {
    position: relative;
    padding-bottom: 10px; /* Ponte invisível para o mouse não perder o hover */
    margin-bottom: -10px;
}
.dropdown-user-info {
    padding: 15px 16px;
    background: rgba(255,255,255,0.05);
}
.dropdown-user-info strong { display: block; color: white; margin-bottom: 3px;}
.dropdown-user-info span { display: block; color: #888; font-size: 12px; }
.dropdown-divider { border: 0; border-top: 1px solid #333; margin: 0; }

/* --- 6. LAYOUT LATERAL DO PLAYER (GRID) --- */
.player-layout-grid {
    display: flex;
    gap: 30px;
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 var(--play-padding-x);
    align-items: flex-start; /* Essencial para o sticky funcionar */
}
.player-main-column {
    flex: 7; /* Ocupa 70% do espaço */
    min-width: 0; /* Previne overflow de grid/flex */
}
.player-sidebar-column {
    flex: 3; /* Ocupa 30% do espaço */
    min-width: 300px;
}
.sticky-forum {
    position: sticky;
    top: 90px; /* Fica fixo ao rolar, respeitando a navbar */
    background: #1a1a1a;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #333;
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
}
.comments-scroll-area {
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 5px;
}

/* --- 7. BARRA DE PROGRESSO DE LEITURA --- */
#reading-progress-container {
    position: fixed; /* Fixado na tela inteira, não no container */
    top: 0; 
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 9999; /* Z-index altíssimo para ficar acima da Navbar */
}
#reading-progress-bar {
    height: 100%;
    background: var(--play-danger);
    width: 0%;
    transition: width 0.1s ease-out;
    box-shadow: 0 0 10px var(--play-danger); /* Efeito neon sutil */
}

/* --- 8 & 9. BUSCA ESTILO NETFLIX --- */
.search-container-wrapper {
    position: relative;
}
.search-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    width: 350px;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    max-height: 500px;
    overflow-y: auto;
    z-index: 2000;
}
.search-dropdown.hidden {
    display: none;
}
/* ==========================================================================
   RESULTADOS DA PESQUISA (ALINHAMENTO E TAMANHOS UNIFORMES)
   ========================================================================== */
.search-result-item {
    display: flex;
    gap: 15px;
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    align-items: center; /* Força o alinhamento vertical exato ao centro */
}

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

.search-result-item img { 
    width: 80px; 
    height: 45px; 
    object-fit: cover; 
    border-radius: 4px; 
    flex-shrink: 0; /* A MÁGICA: Impede a imagem de espremer/encolher se o texto for longo */
    border: 1px solid #333;
}

.search-result-info {
    flex: 1; /* Ocupa todo o espaço restante */
    min-width: 0; /* Previne vazamento do layout com flexbox */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.search-result-info h4 { 
    font-size: 13px; 
    color: white; 
    margin: 0 0 4px 0; 
    line-height: 1.3;
    /* Limita o texto a 2 linhas e adiciona "..." no final se for muito grande */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-result-info span { 
    font-size: 11px; 
    color: var(--play-text-muted); 
}

/* Responsividade do Layout Grid */
@media (max-width: 1024px) {
    .player-layout-grid { flex-direction: column; }
    .player-sidebar-column { width: 100%; }
    .sticky-forum { position: relative; top: 0; max-height: 500px; }
}

/* ==========================================================================
   MODAIS GERAIS (CONFIGURAÇÕES)
   ========================================================================== */
.play-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity var(--play-transition);
}

.play-modal-overlay.hidden {
    display: none !important;
    opacity: 0;
}

.play-modal-content {
    background-color: var(--play-bg-modal);
    border: 1px solid #333;
    border-radius: var(--play-radius-lg);
    width: 100%;
    max-width: 550px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.8);
    transform: translateY(0);
    animation: slideUpModal 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes slideUpModal {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.play-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #222;
}

.play-modal-header h3 { font-size: 18px; color: white; }

.btn-icon-transparent {
    background: transparent; border: none; color: #888;
    font-size: 20px; cursor: pointer; transition: color 0.2s;
}
.btn-icon-transparent:hover { color: white; }

.play-modal-body {
    padding: 25px;
}

.modal-divider {
    border: 0; border-top: 1px solid #222; margin: 25px 0;
}

.play-modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #222;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    background: rgba(0,0,0,0.2);
    border-radius: 0 0 var(--play-radius-lg) var(--play-radius-lg);
}

/* Avatar Section do Modal */
.settings-avatar-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.avatar-preview-wrapper {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 2px solid #444;
    overflow: hidden;
    cursor: pointer;
}

#settings-avatar-preview {
    width: 100%; height: 100%; object-fit: cover;
}

.avatar-overlay-btn {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex; justify-content: center; align-items: center;
    color: white; font-size: 24px;
    opacity: 0; transition: opacity 0.2s;
}

.avatar-preview-wrapper:hover .avatar-overlay-btn { opacity: 1; }

/* ==========================================================================
   FÓRUM 2.0 - ESTILOS AVANÇADOS
   ========================================================================== */
.forum-filters { display: flex; gap: 10px; background: #111; padding: 4px; border-radius: 6px; border: 1px solid #333; }
.forum-filter-btn { background: transparent; border: none; color: #888; padding: 5px 10px; border-radius: 4px; cursor: pointer; font-size: 12px; font-weight: bold; transition: all 0.2s; }
.forum-filter-btn:hover { color: white; }
.forum-filter-btn.active { background: #333; color: var(--play-accent); }

.forum-input-box { background: #222; padding: 15px; border-radius: 8px; margin-bottom: 20px; border: 1px solid #333; }
.checkbox-doubt { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #aaa; cursor: pointer; user-select: none; transition: color 0.2s; }
.checkbox-doubt:hover { color: var(--play-accent); }
.checkbox-doubt input[type="checkbox"] { accent-color: var(--play-accent); width: 16px; height: 16px; cursor: pointer; }

/* Cards de Comentários */
.forum-comment-card { margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid #222; }
.forum-comment-card.pinned { background: rgba(253, 187, 45, 0.05); padding: 10px; border-radius: 8px; border: 1px solid rgba(253, 187, 45, 0.2); }
.forum-reply { margin-left: 35px; margin-top: 15px; border-left: 2px solid #333; padding-left: 15px; border-bottom: none; }

.comment-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.comment-user-info { display: flex; align-items: center; gap: 10px; }
.comment-user-info img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.comment-name { color: white; font-size: 14px; font-weight: bold; }
.comment-date { color: #666; font-size: 11px; }

/* Badges (Tags) */
.badge-creator { background: var(--play-accent); color: black; font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: bold; margin-left: 5px; }
.badge-question { background: rgba(229, 9, 20, 0.2); color: #ff4b4b; border: 1px solid #ff4b4b; font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: bold; margin-left: 5px; }
.badge-resolved { background: rgba(70, 211, 105, 0.2); color: var(--play-match); border: 1px solid var(--play-match); font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: bold; margin-left: 5px; }

.comment-text { color: #ccc; font-size: 14px; line-height: 1.5; margin-bottom: 10px; word-break: break-word; }

/* Ações (Like, Dislike, Responder) */
.comment-actions { display: flex; gap: 15px; align-items: center; }
.action-btn { background: transparent; border: none; color: #888; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 5px; transition: color 0.2s; }
.action-btn:hover { color: white; }
.action-btn.active-like { color: var(--play-match); }
.action-btn.active-dislike { color: var(--play-danger); }

/* Menu Admin do Comentário */
.comment-options { position: relative; display: inline-block; }
.btn-options { background: transparent; border: none; color: #666; cursor: pointer; padding: 5px; }
.btn-options:hover { color: white; }
.options-dropdown { display: none; position: absolute; right: 0; top: 100%; background: #1a1a1a; border: 1px solid #333; border-radius: 4px; z-index: 10; box-shadow: 0 4px 12px rgba(0,0,0,0.5); min-width: 120px; overflow: hidden;}
.options-dropdown.show { display: block; }
.options-dropdown button { display: block; width: 100%; text-align: left; background: none; border: none; color: #ccc; padding: 10px 15px; font-size: 13px; cursor: pointer; transition: background 0.2s; }
.options-dropdown button:hover { background: #333; color: white; }
.options-dropdown button.delete-text { color: #ff4b4b; }

.reply-input-area { margin-top: 10px; display: none; }
.reply-input-area.active { display: block; }

/* --- 1) BARRAS DE SCROLL PERSONALIZADAS --- */
.comments-scroll-area::-webkit-scrollbar,
.player-main-column::-webkit-scrollbar {
    width: 6px;
}
.comments-scroll-area::-webkit-scrollbar-track,
.player-main-column::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}
.comments-scroll-area::-webkit-scrollbar-thumb,
.player-main-column::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}
.comments-scroll-area::-webkit-scrollbar-thumb:hover,
.player-main-column::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* --- 2) ORGANIZAÇÃO DOS BADGES (FLEX WRAP) --- */
.comment-name { 
    display: flex; 
    flex-wrap: wrap; /* Permite a quebra limpa dos badges */
    align-items: center; 
    gap: 6px; 
    color: white; 
    font-size: 14px; 
    font-weight: bold; 
    margin-bottom: 4px;
}
.badge-creator, .badge-question, .badge-resolved { 
    margin-left: 0; /* Removida margem antiga conflitante */
    white-space: nowrap; /* Impede a quebra do texto dentro da badge */
}

/* --- 4 e 5) ROLAGEM INTERNA DO EPISÓDIO E BARRA DE PROGRESSO --- */
#section-player {
    background: #000;
    height: 100vh; /* Trava a rolagem global da tela */
    overflow: hidden;
    /* REMOVIDO: display: flex; (causava o vazamento do layout) */
    flex-direction: column;
    padding-top: 70px; /* <--- CORREÇÃO: Compensa a altura exata da Navbar fixa */
}

/* ADICIONADO: Garante que o player só seja flexível quando estiver ativo */
#section-player.active-view {
    display: flex;
}
.player-topbar {
    position: relative; /* Segura a barra de progresso */
    background: #111;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    border-bottom: 1px solid #333;
    z-index: 100;
}
#reading-progress-container {
    position: absolute;
    bottom: -1px; /* Gruda na base da topbar */
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.05);
    z-index: 101;
}
#reading-progress-bar {
    height: 100%;
    background: var(--play-danger);
    width: 0%;
    transition: width 0.1s ease-out;
    box-shadow: 0 0 10px var(--play-danger);
}
.player-layout-grid {
    display: flex;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px var(--play-padding-x);
    flex: 1; /* Preenche a área do player */
    overflow: hidden; /* Trava as colunas */
    width: 100%;
}
.player-main-column {
    flex: 7;
    min-width: 0;
    height: 100%;
    overflow-y: auto; /* A magia da rolagem interna acontece aqui */
    padding-right: 15px; 
}
.player-sidebar-column {
    flex: 3;
    min-width: 300px;
    height: 100%;
}
.sticky-forum {
    position: relative; /* Deixa de ser sticky global */
    top: 0;
    background: #1a1a1a;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #333;
    height: 100%; /* Ocupa exatamente a altura do sidebar */
    max-height: 100%;
    display: flex;
    flex-direction: column;
}
.comments-scroll-area {
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 5px;
    height: 0; /* Flexbox trick para scroll interno funcionar perfeitamente */
}

/* Responsividade Player Ajustada */
@media (max-width: 1024px) {
    #section-player { height: auto; overflow: visible; }
    #section-player.active-view { display: block; } /* CORREÇÃO 1: Só fica 'block' se estiver ativo! */
    
    .player-layout-grid { flex-direction: column; height: auto; overflow: visible; }
    .player-main-column { overflow-y: visible; height: auto; padding-right: 0; }
    .player-sidebar-column { height: 600px; }
}

/* Localize as classes .hero-banner e .hero-content e adicione a transição: */
.hero-banner {
    /* ... seu código existente ... */
    transition: background-image 0.8s ease-in-out, opacity 0.4s ease-in-out;
}

.hero-content {
    /* ... seu código existente ... */
    transition: opacity 0.4s ease-in-out;
}

/* --- 3) TÍTULOS VÍVIDOS E PERSONALIZADOS --- */
.hero-title.premium-text {
    font-size: 4rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -2px;
    background: linear-gradient(to bottom, #fff 20%, #fdbb2d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0px 4px 10px rgba(0,0,0,0.5));
    margin-bottom: 20px;
}

/* --- 1 & 2) CARDS ESTILO NETFLIX (HOVER EXPANSIVO) --- */
.course-card {
    position: relative;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    background: var(--play-bg-modal);
    border-radius: 4px;
    overflow: hidden;
}

.course-card:hover {
    transform: scale(1.15); /* O zoom clássico */
    z-index: 100;
    box-shadow: 0 15px 30px rgba(0,0,0,0.8);
}

/* Informações rápidas abaixo do card (Antes do Hover) */
.card-quick-info {
    padding: 8px 0;
    transition: opacity 0.3s;
}

.quick-title {
    font-size: 13px;
    font-weight: 600;
    color: #e5e5e5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quick-meta {
    font-size: 11px;
    color: var(--play-match);
    font-weight: bold;
}

/* Conteúdo que "BROTA" no Hover */
.card-hover-details {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #181818;
    padding: 15px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.course-card:hover .card-hover-details {
    opacity: 1;
    transform: translateY(0);
}

.hover-actions-row {
    display: flex;
    gap: 8px;
    margin-bottom: 5px;
}

.btn-circle-small {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid #fff;
    background: rgba(255,255,255,0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* --- 4) DISTRIBUIÇÃO E RESPIRO --- */
.content-rows-container {
    margin-top: -150px; /* Faz as rows subirem sobre o gradiente do hero */
    padding-bottom: 100px;
    position: relative;
    z-index: 5;
}

.slider-row {
    margin-bottom: 50px; /* Espaçamento profissional entre categorias */
}

/* Limita o crescimento vertical do conteúdo do Hero */
.hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px; /* Largura máxima para não achatar o texto */
}

.hero-title-wrapper {
    max-width: 100%;
    margin-bottom: 15px;
}

.hero-title.premium-text {
    font-size: clamp(2rem, 5vw, 3.5rem) !important; /* Fonte responsiva: não quebra o layout em telas menores */
    line-height: 1.1;
    margin: 0;
    /* ... manter gradiente anterior ... */
}

/* CORREÇÃO DO CONFLITO DE SOBREPOSIÇÃO */
.content-rows-container {
    position: relative;
    z-index: 20;
    margin-top: -100px; /* Ajustado para um valor mais seguro */
    padding-top: 20px;
    background: linear-gradient(to bottom, transparent, var(--play-bg-secondary) 150px);
}

.slider-row {
    position: relative;
    margin-bottom: 60px !important; /* Espaço sagrado entre as fileiras */
}

.course-card-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* --- ESTABILIZAÇÃO DO HERO --- */
.hero-banner {
    position: relative;
    height: 80vh; /* Altura fixa para evitar empurrar o resto da página */
    min-height: 600px;
    display: flex;
    align-items: flex-end; /* Alinha o conteúdo na base do banner */
    padding-bottom: 120px; /* Espaço para as rows não encostarem no texto */
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 750px; /* Limita a largura para o título não espalhar */
    margin-left: var(--play-padding-x);
    margin-bottom: -25px;
}

.hero-title-wrapper {
    margin-bottom: 10px;
}

.hero-title.premium-text {
    font-size: clamp(1.8rem, 4vw, 3rem) !important; /* Fonte inteligente: diminui se a tela for pequena */
    line-height: 1.1;
    font-weight: 900;
    text-transform: uppercase;
    margin: 0;
    background: linear-gradient(to bottom, #fff 40%, #fdbb2d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0px 4px 8px rgba(0,0,0,0.8));
}

.hero-description {
    font-size: 1rem;
    max-width: 550px;
    line-height: 1.4;
    color: #d2d2d2;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Corta o texto em 2 linhas para não crescer */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- ORGANIZAÇÃO DAS ROWS (SEM COLISÃO) --- */
.content-rows-container {
    position: relative;
    z-index: 20;
    margin-top: -80px; /* Margin negativa suave apenas para o efeito de sobreposição */
    background: linear-gradient(to bottom, transparent, var(--play-bg-secondary) 100px);
    padding-top: 20px;
}

.slider-row {
    margin-bottom: 40px !important; /* Espaçamento fixo entre fileiras */
    padding: 0 var(--play-padding-x);
}

.row-title {
    font-size: 1.3rem;
    margin-bottom: 15px;
    font-weight: 700;
    color: #fff;
}

/* Proteção contra extrapolação do Swiper */
.swiper {
    padding: 20px 0 0 0 !important; /* Espaço para o zoom do hover não ser cortado */
    overflow: visible !important;
}

/* Card Container */
.course-card-container {
    transition: transform 0.3s ease;
}

.course-card {
    border-radius: 4px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #2f2f2f;
    cursor: pointer;
    position: relative;
}

/* Informações rápidas abaixo do card (Sempre visíveis) */
.card-quick-info {
    margin-top: 10px;
}

.quick-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quick-meta {
    font-size: 12px;
    color: var(--play-match); /* Aquele verde de relevância */
    margin-top: 2px;
}

.meta-tags {
    margin-bottom: 20px;
}

.fa-cog {
    margin-right: 8px;
}

/* ==========================================================================
   SISTEMA DE ABAS DO PLAYER E MÍDIA
   ========================================================================== */
.player-tabs-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.player-tab-btn {
    background: transparent;
    border: none;
    color: #888;
    font-size: 15px;
    font-weight: bold;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-tab-btn:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

.player-tab-btn.active {
    background: rgba(253, 187, 45, 0.1);
    color: var(--play-accent);
    border-bottom: 2px solid var(--play-accent);
    border-radius: 4px 4px 0 0;
}

/* Containers de Mídia do Player */
.media-tab-content {
    display: none;
    width: 100%;
    animation: fadeInView 0.3s forwards;
}

.media-tab-content.active {
    display: block;
}

.responsive-iframe-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* Proporção 16:9 */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    border-radius: 8px;
    border: 1px solid #333;
    background: #000;
}

.responsive-iframe-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.pdf-wrapper {
    width: 100%;
    height: 700px;
    border-radius: 8px;
    border: 1px solid #333;
    overflow: hidden;
}

/* Correção para Imagens e Iframes INLINE (dentro do texto) */
.play-episode-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 15px 0;
}
.play-episode-content iframe {
    max-width: 100%;
    border-radius: 8px;
    margin: 15px 0;
}

/* ==========================================================================
   EDITOR DE AULA (SAURO STUDIO)
   ========================================================================== */
.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    background: #222;
    padding: 10px;
    border-radius: 8px 8px 0 0;
    border: 1px solid #444;
    border-bottom: none;
}

.editor-btn {
    background: #333;
    border: 1px solid #444;
    color: #ccc;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s;
}

.editor-btn:hover { background: var(--play-accent); color: #000; border-color: var(--play-accent); }

.editor-content-area {
    width: 100%;
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    background: #111;
    color: #fff;
    padding: 20px;
    border: 1px solid #444;
    border-radius: 0 0 8px 8px;
    font-size: 16px;
    line-height: 1.6;
    outline: none;
}

.editor-content-area:focus { border-color: var(--play-accent); }

/* ==========================================================================
   ESTILOS DO ESTUDO ATIVO E COMUNIDADE
   ========================================================================== */
.radio-card { cursor: pointer; flex: 1; }
.radio-card input { display: none; }
.radio-content {
    background: #1a1a1a;
    border: 2px solid #333;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
}
.radio-card input:checked + .radio-content {
    background: rgba(255,255,255,0.05);
    border-color: #fff;
}
.premium-radio input:checked + .radio-content {
    border-color: var(--play-accent);
    background: rgba(253, 187, 45, 0.05);
    box-shadow: 0 0 10px rgba(253, 187, 45, 0.2);
}

.study-item-card {
    background: #1a1a1a;
    border: 1px solid #333;
    border-left: 3px solid var(--play-accent);
    padding: 15px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s;
}
.study-item-card:hover { transform: translateX(5px); background: #222; }
.study-info h5 { margin: 0 0 5px 0; color: #fff; font-size: 14px; }
.study-meta { font-size: 11px; color: #888; display: flex; gap: 10px; }
.study-author { color: var(--play-match); }

.fa-pencil-alt {
    margin-right: 8px;
}

/* Correção do fundo branco nas opções do Select (Visibilidade do Material) */
.modern-select option {
    background-color: #1a1a1a;
    color: #ffffff;
    padding: 10px;
}

/* Classes dinâmicas para o Editor Rich Text (Imagens e Vídeos) */
.media-align-center {
    display: block !important;
    margin: 15px auto !important;
    float: none !important;
}

.media-align-left {
    display: inline-block !important;
    float: left !important;
    margin: 15px 20px 15px 0 !important; /* Espaço na direita para o texto respirar */
}

.media-align-right {
    display: inline-block !important;
    float: right !important;
    margin: 15px 0 15px 20px !important; /* Espaço na esquerda para o texto respirar */
}

/* =========================================
   [NOVO] VIEWER DE ESTUDO ATIVO E FLASHCARDS
   ========================================= */
.flip-card {
    background-color: transparent;
    width: 100%;
    max-width: 600px;
    height: 350px;
    perspective: 1000px;
    cursor: pointer;
}
.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
    transform-style: preserve-3d;
}
.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}
.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid #333;
}
.flip-card-front {
    background: linear-gradient(145deg, #1f1f1f, #111);
    color: white;
}
.flip-card-back {
    background: linear-gradient(145deg, rgba(253, 187, 45, 0.1), #111);
    border-color: var(--play-accent);
    color: white;
    transform: rotateY(180deg);
}

/* Quiz Interativo */
.quiz-option {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: #222;
    border: 1px solid #333;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}
.quiz-option:hover { background: #2a2a2a; border-color: #555; }
.quiz-option.correct { background: rgba(70, 211, 105, 0.1); border-color: var(--play-match); }
.quiz-option.wrong { background: rgba(255, 60, 60, 0.1); border-color: var(--play-danger); }
.quiz-option .letter-badge {
    background: #444; color: #fff; width: 30px; height: 30px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-weight: bold; margin-right: 15px;
}
.quiz-explanation {
    margin-top: 15px; padding: 15px; border-radius: 8px; font-size: 14px; line-height: 1.5;
    background: #1a1a1a; border-left: 4px solid var(--play-accent); display: none;
}
.status-badge {
    font-size: 10px; padding: 3px 8px; border-radius: 12px; font-weight: bold; margin-left: auto;
}
.status-done { background: rgba(70, 211, 105, 0.2); color: var(--play-match); }
.status-pending { background: rgba(255, 255, 255, 0.1); color: #aaa; }

/* =========================================
   ESTÚDIO DE EDIÇÃO DE MATERIAIS
   ========================================= */
.study-editor-card {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 15px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.study-editor-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed #444;
    padding-bottom: 10px;
    margin-bottom: 15px;
}
.btn-delete-item {
    background: rgba(255, 60, 60, 0.1);
    color: var(--play-danger);
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 12px;
    transition: 0.2s;
}
.btn-delete-item:hover {
    background: var(--play-danger);
    color: #fff;
}

/* ==========================================================================
   BOTÃO DE FECHAR (SEÇÃO DE CRIAÇÃO)
   ========================================================================== */
.btn-close-section {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: #666;
    font-size: 22px;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
}
.btn-close-section:hover {
    color: white;
}

/* ==========================================================================
   RESPONSIVIDADE MOBILE (FIX DEFINITIVO TELA INICIAL)
   ========================================================================== */
@media (max-width: 768px) {
    /* 1. NAVBAR - Ajuste de Espaços e Lupa Interativa */
    .play-navbar {
        padding: 0 15px;
        height: 60px;
    }
    .nav-left, .nav-right { gap: 10px; }
    .play-logo { height: 22px; }
    
    /* Aperta um pouco as cotas para caber tudo na barra */
    .quota-display {
        padding: 4px 8px;
        font-size: 11px;
        gap: 5px;
    }

    .search-dropdown {
    position: absolute;
    top: 55px;
    right: 0;
    width: calc(100vw - 80px) !important;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    max-height: 500px;
    overflow-y: auto;
    z-index: 2000;
}

.avatar-preview-wrapper {
    position: relative;
    width: 90px;
    height: 100%;
    border: none;
    overflow: hidden;
    cursor: pointer;
}

.fa-cog {
    margin-right: 0px;
}
    
    /* Proteção extra para telas muito estreitas (Ex: iPhone SE) */
    @media (max-width: 380px) {
        #quota-text { max-width: 45px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    }

    /* 2. LUPA INTELIGENTE (Fix de Expansão) */
    .search-box {
        position: relative;
        width: 34px;
        height: 34px;
        padding: 0;
        background: transparent;
        border: 1px solid transparent;
        border-radius: 20px;
        display: flex;
        align-items: center;
        overflow: hidden; 
        transition: all 0.3s ease; 
    }
    .search-box i {
        position: absolute;
        left: 10px; 
        z-index: 2;
        font-size: 14px;
        color: white;
        transition: color 0.3s ease;
        pointer-events: none;
    }
    .search-box input {
        position: absolute;
        top: 0;
        left: 0;
        width: 100% !important; 
        height: 100%;
        background: transparent;
        border: none;
        color: white;
        padding: 0 10px 0 34px; 
        opacity: 0;
        cursor: pointer;
        display: block !important;
        transition: opacity 0.3s ease;
    }
    .search-box:focus-within {
        /* CORREÇÃO: Margem de segurança bem maior e max-width absoluto */
        width: calc(100vw - 190px); 
        max-width: 200px; 
        background: rgba(20, 20, 20, 0.95);
        border-color: var(--play-accent);
    }
    .search-box:focus-within i {
        color: var(--play-accent);
    }
    .search-box:focus-within input {
        opacity: 1;
        cursor: text;
    }

    /* 3. HERO BANNER - Evita sobreposição e organiza os botões */
    .hero-banner {
        height: auto; 
        min-height: 70vh;
        padding-top: 80px; /* Respira em relação à navbar */
        padding-bottom: 60px;
        align-items: flex-end;
    }
    .hero-content {
        margin-left: 0;
        width: 100%;
    }
    .hero-badge {
        font-size: 9px;
        padding: 3px 6px;
        margin-bottom: 10px;
    }
    .hero-title.premium-text {
        font-size: 1.8rem !important; /* Fixa o tamanho para não estourar a tela */
        line-height: 1.1;
        letter-spacing: -0.5px;
        margin-bottom: 15px;
        white-space: normal; 
    }
    .hero-meta {
        gap: 8px;
        margin-bottom: 15px;
    }
    .meta-group {
        gap: 8px;
    }
    .match-score { font-size: 13px; }
    .rating-badge, .category-tag, .hero-meta span { font-size: 11px; }
    
    .hero-description {
        font-size: 0.95rem;
        margin-bottom: 20px;
        -webkit-line-clamp: 3; /* Exibe mais linhas de texto que no desktop */
    }
    
    .hero-actions {
        flex-direction: column; /* Empilha os botões um sobre o outro (MUITO IMPORTANTE) */
        gap: 10px;
        width: 100%;
    }

    /* =========================================================
       MÁGICA DO CONTRASTE (HERO BANNER MOBILE)
       ========================================================= */
    .hero-vignette {
        /* Sobrescreve o gradiente lateral pelo vertical longo e escuro */
        background: linear-gradient(
            to top, 
            var(--play-bg-secondary) 5%, 
            rgba(20,20,20,0.95) 45%, 
            rgba(20,20,20,0.5) 75%, 
            transparent 100%
        ) !important;
    }

    .hero-description {
        /* Adiciona uma sombra extra no texto para garantir a leitura sobre qualquer cor */
        text-shadow: 1px 1px 4px rgba(0, 0, 0, 1), 0 0 12px rgba(0, 0, 0, 0.8) !important;
        font-weight: 500;
        color: #fff !important; /* Força o branco absoluto no mobile */
    }
    
    .hero-meta {
        /* Sombra nos metadados (ano, categoria, etc) */
        text-shadow: 1px 1px 3px rgba(0, 0, 0, 1) !important;
    }

    .btn-play-hero, .btn-info-hero {
        width: 100%;
        padding: 12px;
        font-size: 1rem;
    }

    /* 4. CARROSSEL (SWIPER) - Fix de Overflow e Setas */
    .content-rows-container {
        margin-top: -30px; 
    }
    .slider-row {
        margin-bottom: 30px !important;
    }
    .row-title {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }
    .swiper {
        padding-top: 5px !important; 
        /* A MÁGICA ESTÁ AQUI: Corta os cards que saem da tela no mobile */
        overflow: hidden !important; 
    }
    
    /* Força as setas a sumirem de verdade (Aumentando a especificidade) */
    .swiper-button-next, .swiper-button-prev,
    .slider-row .swiper-button-next, 
    .slider-row .swiper-button-prev {
        display: none !important;
    }
}

/* ==========================================================================
   CONTAINER DE AÇÕES DO USUÁRIO (DESKTOP)
   ========================================================================== */
.user-actions-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* ==========================================================================
   COLE ISTO DENTRO DO SEU @media (max-width: 768px)
   ========================================================================== */
    
    /* LUPA - Como agora ela está sozinha, liberamos ela para crescer pela tela toda! */
    .search-box:focus-within {
        width: calc(100vw - 100px); 
        max-width: 100%; /* Remove a trava anterior */
        background: rgba(20, 20, 20, 0.95);
        border-color: var(--play-accent);
    }

    /* ---------------------------------------------------
       AÇÕES DO USUÁRIO MOVIDAS PARA A SIDEBAR (MOBILE)
       --------------------------------------------------- */
    #play-sidebar .user-actions-container {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 0 0 20px 0;
        gap: 15px;
        border-bottom: 1px solid #333;
        margin-bottom: 15px;
    }

    #play-sidebar .quota-display {
        width: 100%;
        justify-content: center;
        padding: 12px;
        font-size: 14px;
        border-radius: 8px;
    }

    #play-sidebar .user-profile-dropdown {
        width: 100%;
        padding-top: 5px;
        pointer-events: none; /* Desativa o hover nativo do desktop */
    }

    #play-sidebar .profile-avatar {
        width: 55px;
        height: 55px;
        margin-bottom: 15px;
        border-radius: 50%;
    }

    /* Expande as opções permanentemente dentro do menu */
    #play-sidebar .dropdown-content {
        display: block !important;
        position: static;
        width: 100%;
        box-shadow: none;
        border: none;
        background: transparent;
        padding: 0;
        pointer-events: auto; /* Reativa o clique nos botões */
    }

    #play-sidebar .dropdown-user-info {
        padding: 0 0 15px 0;
        background: transparent;
    }

    #play-sidebar .dropdown-user-info strong { 
        font-size: 18px; 
        color: var(--play-accent);
    }

    #play-sidebar .dropdown-content a {
        padding: 12px 0;
        font-size: 15px;
        border-radius: 0;
    }

    #play-sidebar .dropdown-divider {
        display: none;
    }

    /* ==========================================================================
   AJUSTES FINAIS MOBILE E UX (LUPA, MENU SCROLL E QUOTAS)
   ========================================================================== */

/* 1. Força a exibição do texto completo das Cotas (sem reticências) */
#quota-text {
    max-width: none !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
}

@media (max-width: 768px) {
    /* 2. Permite a rolagem interna do Menu Lateral (Hambúrguer) */
    #play-sidebar {
        overflow-y: auto !important;
        padding-bottom: 80px !important; /* Dá um respiro bom no final do menu */
    }

    /* 3. Prepara a âncora para a Lupa não pular */
    .search-container-wrapper {
        min-width: 34px;
        min-height: 34px;
        position: relative;
        display: flex;
        align-items: center;
    }

    /* 3.1. Expansão Inteligente da Lupa (Flutuante para a esquerda) */
    .search-box:focus-within {
        position: absolute !important;
        right: 0 !important; /* Trava a direita, forçando o crescimento para o lado esquerdo */
        top: 0 !important;
        width: calc(100vw - 80px) !important; /* Largura da tela, descontando o botão de hambúrguer */
        max-width: none !important; 
        z-index: 2000 !important;
    }
}

/* ==========================================================================
   SISTEMA DE PESQUISA (DESKTOP E MOBILE) - CORREÇÃO DEFINITIVA
   ========================================================================== */

/* --- 1. COMPORTAMENTO DESKTOP (Padrão) --- */
.search-container-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box {
    position: relative !important;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.5) !important;
    border: 1px solid #333 !important;
    padding: 5px 10px !important;
    border-radius: 20px;
    width: auto !important;
    height: auto !important;
    transform: none !important;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    background: rgba(0, 0, 0, 0.8) !important;
    border-color: var(--play-accent) !important;
    width: 250px !important; /* Expansão controlada e elegante no Desktop */
}

.search-box i {
    color: var(--play-text-secondary);
    font-size: 14px;
    position: static !important;
    transform: none !important;
}

.search-box input {
    background: transparent;
    border: none;
    color: white;
    padding: 5px 10px !important;
    outline: none;
    width: 150px !important;
    opacity: 1 !important;
    position: static !important;
    display: block !important;
    cursor: text !important;
    transition: width 0.3s ease;
}

/* --- 2. COMPORTAMENTO MOBILE (Telas menores que 768px) --- */
@media (max-width: 768px) {
    
    /* A MÁGICA: Oculta a logo quando o usuário clica na lupa */
    .play-navbar:focus-within .play-logo-container {
        display: none !important;
    }

    .search-container-wrapper {
        min-width: 34px;
        min-height: 34px;
        flex-grow: 1; /* Pega o espaço que sobrou da logo */
        justify-content: flex-end;
    }

    .search-box {
        position: absolute !important;
        right: 0 !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: 34px !important;
        height: 34px !important;
        padding: 0 !important;
        background: transparent !important;
        border: 1px solid transparent !important;
        border-radius: 20px;
        overflow: hidden; 
        z-index: 1000;
    }

    .search-box i {
        position: absolute !important;
        left: 10px !important; 
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 2;
        color: white;
    }

    .search-box input {
        position: absolute !important;
        top: 0 !important; 
        left: 0 !important;
        width: 100% !important; 
        height: 100% !important;
        padding: 0 10px 0 34px !important; 
        opacity: 0 !important;
        cursor: pointer !important;
    }

    /* Expansão da Lupa exclusiva para o Mobile */
    .search-box:focus-within {
        width: calc(100vw - 80px) !important; /* Ocupa a tela toda menos o botão hambúrguer */
        max-width: none !important;
        background: rgba(20, 20, 20, 0.95) !important;
        border-color: var(--play-accent) !important;
        z-index: 2000 !important;
        
        /* A MÁGICA QUE FORÇA A CENTRALIZAÇÃO AQUI 👇 */
        top: 50% !important;
        transform: translateY(-50%) !important;
        bottom: auto !important;
        margin: 0 !important;
    }

    .search-box:focus-within input {
        opacity: 1 !important;
        cursor: text !important;
    }

    .search-box:focus-within i {
        color: var(--play-accent) !important;
    }
}

/* ==========================================================================
   RESPONSIVIDADE MOBILE: TELA DE DETALHES DO CURSO (SÉRIE)
   ========================================================================== */
@media (max-width: 768px) {
    /* 1. DISTANCIAMENTO DA NAVBAR E BOTÃO FECHAR */
    .details-content-wrapper {
        padding-top: 80px !important; /* Descola do topo para não sumir atrás da Navbar preta */
        padding-left: 15px;
        padding-right: 15px;
    }

    .btn-close-details {
        top: 70px !important; /* Fica logo abaixo da navbar */
        right: 15px !important;
        width: 35px;
        height: 35px;
        font-size: 16px;
        z-index: 100;
        background: rgba(0,0,0,0.8); /* Fundo mais escuro para não sumir na imagem */
    }

    /* 2. TÍTULO, GRADIENTE E SINOPSE (Mágica da Leitura) */
    .details-gradient {
        /* Mesma lógica da Home: Escurece de baixo para cima para destacar o texto */
        background: linear-gradient(
            to top, 
            var(--play-bg-secondary) 10%, 
            rgba(20,20,20,0.95) 50%, 
            rgba(20,20,20,0.6) 80%, 
            transparent 100%
        ) !important;
    }

    .details-main-info h1 {
        font-size: 1.8rem !important; /* Reduz o título gigante */
        line-height: 1.2;
        margin-bottom: 15px;
        max-width: 85%; /* Deixa um espaço em branco na direita para o botão (X) */
    }

    .synopsis {
        font-size: 0.95rem;
        line-height: 1.5;
        text-shadow: 1px 1px 4px rgba(0, 0, 0, 1), 0 0 12px rgba(0, 0, 0, 0.8) !important;
        color: #fff !important;
        margin-bottom: 25px;
    }

    /* 3. BOTÕES DE AÇÃO ("Continuar Estudando" + "Minha Lista" + "Administrar") */
    .action-row {
        display: flex;
        flex-direction: row !important; 
        flex-wrap: wrap !important; /* Reativado para empurrar o Admin para baixo */
        gap: 12px;
        align-items: center;
    }
    
    .btn-play-main {
        flex: 1; /* Cresce para ocupar o espaço ao lado do botão redondo */
        justify-content: center;
        font-size: 1rem;
        padding: 12px 15px;
    }

    .btn-icon-circle {
        width: 46px; 
        height: 46px;
        flex: 0 0 46px; /* Trava o tamanho exato, impedindo de espremer */
    }

    #btn-edit-course {
        flex: 0 0 100%; /* Força o botão a pular para a linha de baixo e ocupar a tela toda */
        margin-left: 0 !important; /* Remove a margem esquerda que vinha do Desktop */
        justify-content: center;
        padding: 12px 15px;
    }

    /* 4. INFORMAÇÕES TÉCNICAS E CAIXA DE AVALIAÇÃO */
    .course-tech-info {
        flex-direction: column; /* Empilha tempo estimado e data */
        gap: 8px !important;
        margin-bottom: 20px !important;
    }

    .user-rating-area {
        display: block !important;
        width: 100%; /* Ocupa a tela toda */
        text-align: center; /* Centraliza as estrelinhas */
        padding: 20px !important;
    }

    .rating-stars-input {
        justify-content: center;
        display: flex;
        gap: 15px;
        margin-top: 8px;
    }

    /* 5. LISTA SUSPENSA DE TEMPORADAS (Dropdown Seguro) */
    .seasons-selector {
        flex-direction: column; /* Joga o texto pra cima e o input pra baixo */
        align-items: flex-start;
        gap: 10px;
    }
    
    #season-dropdown {
        width: 100% !important; /* Trava na largura da tela */
        max-width: 100%;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
        font-size: 14px;
        padding: 12px;
    }

    /* 6. LISTA DE EPISÓDIOS (O grande vilão dos textos colados) */
    .episode-item {
        padding: 15px 5px !important;
        gap: 15px; /* A MÁGICA DO DISTANCIAMENTO AQUI */
        align-items: flex-start; /* Alinha tudo pelo topo */
    }

    .ep-number {
        font-size: 1.5rem !important; /* Diminui de 24px para um tamanho aceitável */
        width: auto !important;
        min-width: 30px; /* Garante que o "1" e o "10" usem o mesmo espaço */
        text-align: right;
        padding-top: 1px; /* Alinha o número perfeitamente com a primeira linha do texto */
    }

    .ep-info {
        flex: 1;
        min-width: 0; /* Previne que palavras grandes estourem a tela */
    }

    .ep-title {
        font-size: 14px !important;
        line-height: 1.4;
        display: block; 
        word-wrap: break-word;
    }

    /* ==========================================================================
       RESPONSIVIDADE: MINHA LISTA E MEUS CURSOS (GRIDS)
       ========================================================================== */
    
    /* Aproxima os containers do topo da tela */
    #section-my-list .create-container, 
    #section-my-courses .create-container {
        margin-top: 70px !important;
        padding: 15px !important;
    }

    #section-my-list h2, 
    #section-my-courses h2 {
        font-size: 1.5rem !important; /* Reduz o título "Minha Lista" */
        margin-bottom: 15px !important;
    }

    /* A MÁGICA: Transforma a lista em uma grade perfeita de 2 colunas */
    #my-list-grid, 
    #my-courses-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    /* Anula o "width: 250px" engessado que o JavaScript estava injetando */
    #my-list-grid > div, 
    #my-courses-grid > div {
        width: 100% !important;
    }

    /* Anula o "height: 140px" do JavaScript e usa a proporção de vídeo 16:9 */
    #my-list-grid .thumbnail, 
    #my-courses-grid .thumbnail {
        height: auto !important;
        aspect-ratio: 16 / 9 !important;
    }

    /* Fix de UX: Mostra os títulos permanentemente, pois no celular não tem hover */
    #my-list-grid .card-hover-info,
    #my-courses-grid .card-hover-info {
        opacity: 1 !important;
        transform: translateY(0) !important;
        padding: 8px !important;
        background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.6) 60%, transparent 100%) !important;
    }

    /* Ajusta a fonte do título para caber nas 2 colunas e não vazar */
    #my-list-grid .card-title,
    #my-courses-grid .card-title {
        font-size: 11px !important;
        white-space: normal !important; /* Permite 2 linhas de texto */
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        text-overflow: ellipsis !important;
        margin: 0 !important;
    }

    /* Ajusta o Botão vermelho de Excluir para não ser cortado nas bordas da tela */
    #my-courses-grid button[title="Excluir Curso"] {
        top: -6px !important;
        right: -6px !important;
        width: 28px !important;
        height: 28px !important;
        font-size: 12px !important;
    }

    /* ==========================================================================
       FIX: PAINEL DE INFORMAÇÕES DO CARD (AO TOCAR/SEGURAR NO MOBILE)
       ========================================================================== */
    
    .card-hover-details {
        /* Restaura a visibilidade e define o tamanho exato do card pai */
        display: flex !important; 
        background: rgba(12, 12, 12, 0.95) !important;
        backdrop-filter: blur(4px);
        width: 100% !important;
        height: 100% !important; /* Garante que cubra a altura total também */
        box-sizing: border-box !important;
        gap: 0px;
        justify-content: center;
        align-items: center;

        /* A CORREÇÃO: Zera qualquer deslocamento herdado do desktop */
        top: 0 !important;
        left: 0 !important;
        margin: 0 !important;
        transform: none !important; /* Anula efeitos de "crescer" se houver */
    }

    .hover-actions-row {
        gap: 6px !important; /* Aproxima os botões */
        margin-bottom: 4px !important;
    }

    /* Miniaturiza os botões redondos para caberem lado a lado */
    .btn-circle-small {
        width: 26px !important;
        height: 26px !important;
        font-size: 10px !important;
        border: 1px solid rgba(255,255,255,0.4) !important; /* Borda mais fina no celular */
    }

    /* Reduz a fonte de "98% Relevante" */
    .card-hover-details .quick-meta {
        font-size: 11px !important;
        margin-bottom: 2px !important;
    }

    /* Trava o texto de "12 Episódios" para não quebrar a linha */
    .card-hover-details > div:last-child {
        font-size: 9px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* ==========================================================================
       RESPONSIVIDADE: ESTÚDIO DE CRIAÇÃO (PRODUZIR CURSO)
       ========================================================================== */
    
    #section-create .create-container {
        padding: 40px 20px 20px 20px !important; /* Espaço extra no topo para o botão X */
        margin-top: 80px !important; /* Descola bem da Navbar preta */
    }

    /* Reduz o título gigante */
    #section-create .create-header h2 {
        font-size: 1.4rem !important; 
        line-height: 1.3;
        margin-bottom: 10px;
        padding: 0 15px; /* Evita que o texto encoste muito nas bordas */
    }

    #section-create .create-header p {
        font-size: 0.9rem !important;
    }

    /* Empilha o aviso de cota e o botão "Analisar Estrutura" */
    #section-create .create-actions {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    /* Diminui e padroniza o botão principal */
    #btn-generate-structure {
        width: 100% !important; 
        padding: 12px 15px !important;
        font-size: 1rem !important; 
    }
    
    /* Ajusta a posição do X no celular */
    .btn-close-section {
        top: 15px !important;
        right: 15px !important;
        font-size: 20px !important;
    }

    /* ==========================================================================
       UX DEFINITIVA DO PLAYER NO MOBILE (AULA E CONTEÚDO) - MERGE 100%
       ========================================================================== */

    /* 1. Trava a Tela Principal (Impede a rolagem do fundo, protege o layout) */
    #section-player.active-view {
        display: flex !important;
        flex-direction: column !important;
        height: 100vh !important;
        height: 100dvh !important; 
        overflow: hidden !important; 
        padding-top: 0 !important; 
        box-sizing: border-box !important;
        background: #000;
    }

    /* 2. Topbar Fixo (Cabeçalho inamovível) */
    .player-topbar {
        position: relative !important;
        margin-top: 60px !important; /* Desconta a Navbar preta global */
        flex-shrink: 0 !important; 
        width: 100% !important;
        z-index: 100 !important;
        background: var(--play-bg-secondary) !important;
        padding: 15px !important;
        flex-direction: column;
        text-align: center;
        box-sizing: border-box !important;
        border-bottom: 2px solid #222;
        box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    }
    
    .player-topbar > div[style*="width: 80px"] { display: none !important; }
    .player-titles > div { flex-direction: column; gap: 10px; margin-top: 5px; }
    #btn-edit-episode { margin-left: 0 !important; width: 100%; justify-content: center; }

    /* Barra vermelha travada na base do título */
    #reading-progress-container {
        position: absolute !important;
        bottom: -2px !important; 
        left: 0 !important;
        width: 100% !important;
        height: 4px !important;
        z-index: 105 !important;
    }

    /* 3. A MÁGICA: O Layout Grid assume TODO o scroll (Página única que rola até o fim) */
    .player-layout-grid {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 !important; 
        overflow-y: auto !important; /* SCROLL PRINCIPAL AQUI */
        overflow-x: hidden !important; 
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
        padding: 0 !important;
        margin: 0 !important;
        -webkit-overflow-scrolling: touch !important; /* Scroll macio no iOS */
    }

    /* 4. Coluna Principal cresce livremente agora (Sem esmagar) */
    .player-main-column {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        height: auto !important; /* Cresce conforme o conteúdo */
        overflow: visible !important;
        box-sizing: border-box !important;
        padding: 0 15px !important;
        margin: 0 !important;
    }

    /* 5. Menu de Abas (Fica "preso" no topo ao rolar o texto) */
    .player-tabs-container {
        position: sticky !important;
        top: 0 !important; /* Gruda no topo ao rolar para baixo */
        z-index: 90 !important;
        background: #000 !important; /* Fundo sólido para esconder o texto passando por trás */
        flex-shrink: 0 !important; 
        display: flex !important;
        flex-wrap: nowrap !important; 
        overflow-x: auto !important; 
        -webkit-overflow-scrolling: touch;
        padding: 15px 0 10px 0 !important;
        margin: 0 !important;
        gap: 10px !important;
        justify-content: flex-start !important; 
        width: 100% !important;
        box-sizing: border-box !important;
        border-bottom: 1px solid #333 !important;
    }

    .player-tabs-container::-webkit-scrollbar { display: none; }
    .player-tab-btn { flex: 0 0 auto !important; white-space: nowrap !important; }
    #btn-tab-study { margin-left: 0 !important; }

    /* 6. CONTEÚDO (Sem scroll interno, cresce livremente) */
    .player-content-area {
        height: auto !important;
        overflow: visible !important; 
        padding: 20px 5px !important;
        margin: 0 !important;
        border-radius: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .responsive-iframe-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 7. Botões de Navegação (Flutuam logo abaixo do conteúdo) */
    .player-controls {
        flex-shrink: 0 !important; 
        display: flex !important;
        flex-direction: row !important; 
        justify-content: space-between !important;
        align-items: center !important;
        gap: 10px !important;
        margin: 20px 0 !important;
        padding: 15px 0 !important;
        border-top: 1px solid #333 !important;
        background: transparent !important;
    }

    .action-buttons-center {
        display: flex !important;
        flex-direction: row !important;
        flex: 1;
        gap: 10px !important;
    }

    #btn-prev-episode, #btn-mark-completed {
        width: 45px !important;
        height: 45px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        font-size: 0 !important; 
    }
    #btn-prev-episode i, #btn-mark-completed i { font-size: 1.2rem !important; }

    #btn-next-episode {
        flex: 1 !important;
        padding: 12px 15px !important;
        font-size: 1rem !important;
    }

    /* 8. Fórum da Aula - Livre e Espaçoso no fim da página! */
    .player-sidebar-column {
        width: 100% !important;
        height: auto !important; /* Sem limite de altura */
        max-height: none !important; 
        box-sizing: border-box !important;
        padding: 0 15px 40px 15px !important; /* Respiro farto no fim da página */
        display: flex !important;
        flex-direction: column !important;
    }

    .sticky-forum {
        height: auto !important; 
        max-height: none !important;
        position: static !important; /* Anula o sticky chato original do desktop */
        padding: 10px !important;
        margin-top: 0 !important;
        overflow: visible !important;
        border: none !important; 
        border-top: 2px solid #222 !important; /* Separa visualmente dos botões de aula */
        border-radius: 0 !important;
    }

    .forum-input-box {
        padding: 10px !important;
        margin-bottom: 10px !important;
    }
    
    .forum-input-box > div:last-child {
        flex-direction: column; 
        gap: 10px;
        align-items: stretch !important;
    }

    .comments-scroll-area {
        height: auto !important; 
        overflow: visible !important; /* Comentários fluem naturalmente com a página */
    }

    /* ==========================================================================
       MANUTENÇÃO DE OUTROS MODAIS E ESTILOS (Intactos da sua versão)
       ========================================================================== */

    .pdf-wrapper { height: 60vh !important; }

    .study-materials-grid {
        grid-template-columns: 1fr !important; 
        gap: 30px !important;
    }

    .material-filters, .forum-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .material-filters::-webkit-scrollbar, .forum-filters::-webkit-scrollbar { display: none; }
    .forum-filter-btn { flex-shrink: 0; }

    #editor-episode-modal .form-grid { grid-template-columns: 1fr !important; }
    #editor-episode-modal .form-group div[style*="display: flex"] { flex-direction: column; }
    .editor-toolbar { justify-content: center; }
    .editor-btn { flex: 1 1 20%; text-align: center; }

    #material-viewer-modal .play-modal-body {
        padding: 15px !important;
        min-height: auto !important;
    }

    .flip-card { height: 350px !important; }

    #viewer-controls {
        flex-wrap: wrap; 
        justify-content: center !important;
        gap: 15px;
    }

    #viewer-controls button {
        flex: 1; 
        min-width: 120px;
    }
}