/* drama.css — estilos específicos da página de detalhe do título */

/* Hero section */
.hero {
    position: relative;
    min-height: 25vh;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background: var(--bg-soft);
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: .3;
    filter: blur(40px);
    transform: scale(1.15);
}

.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(11, 7, 16, 0) 0%, rgba(11, 7, 16, .6) 60%, var(--bg) 97%);
}

.movie-container {
    margin: 0 auto;
    padding: 0 4% 4rem;
    position: relative;
    z-index: 10;
}

/* ============================================================
   DRAMA HERO HEADER — Novo layout de topo
   Pôster à esquerda · Informações à direita
   ============================================================ */
.drama-hero-header {
    position: relative;
    margin-bottom: 2rem;
    z-index: 15;
}

/* Fundo desfocado com a imagem de capa */
.drama-hero-header::before {
    content: '';
    position: absolute;
    inset: 0;
    clip-path: inset(0);
    background-image: var(--hero-bg-url);
    background-size: cover;
    background-position: center 20%;
    filter: blur(32px);
    transform: scale(1.15);
    opacity: 0.12;
    pointer-events: none;
}



/* Container interno: flex row para desktop — sem max-width próprio,
   já que o hero-header ja tem padding: 0 4% que limita o conteúdo */
.drama-hero-inner {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    gap: 2rem;
}

/* Coluna do pôster */
.drama-hero-poster {
    flex: 0 0 220px;
    width: 220px;
}

.movie-poster-wrap {
    position: relative;
    width: 100%;
}

.movie-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.20);
    border: 1px solid var(--border-color-soft);
    border-radius: 12px;
    display: block;
}

/* Coluna de informações (title, ratings, actions) */
.drama-hero-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Botões de ação no hero */
.drama-hero-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1.2rem;
}

/* Sidebar legada — mantida como compatibilidade */
.movie-sidebar {
    flex: 0 0 240px;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

/* ============================================================
   TAXONOMIAS — Badges mais limpos
   ============================================================ */
.drama-tropes-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.taxonomy-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.6rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
}

.taxonomy-category {
    background: rgba(113, 50, 245, 0.1);
    color: var(--brand-primary);
    border-color: rgba(113, 50, 245, 0.2);
}

.taxonomy-genre {
    background: var(--surface-hover);
    color: var(--text-dim);
    border-color: var(--border-color);
}

.taxonomy-trope {
    background: rgba(245, 166, 35, 0.1);
    color: #D97706;
    /* darker orange */
    border-color: rgba(245, 166, 35, 0.2);
}

/* ============================================================
   ELENCO INLINE — Seção de cartões abaixo da sinopse
   ============================================================ */
.cast-inline-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color-soft);
}

.cast-inline-section h3 {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text);
    margin-bottom: 1rem;
}

.cast-inline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.6rem;
}

.cast-inline-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border-color-soft);
    background: var(--surface);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.cast-inline-card:hover {
    border-color: var(--brand-primary);
    background: var(--surface-hover);
    box-shadow: 0 2px 10px rgba(113, 50, 245, 0.1);
    text-decoration: none;
    color: inherit;
}

/* Círculo de avatar (foto ou iniciais) */
.cast-avatar-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--surface-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color-soft);
}

.cast-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cast-avatar-initials {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--brand-primary);
    letter-spacing: 0.02em;
    line-height: 1;
    text-align: center;
    padding: 2px;
}

.cast-card-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.cast-actor-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.cast-character-name {
    font-size: 0.78rem;
    color: var(--brand-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.btn-favorite {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: auto !important;
    padding: var(--bs-btn-padding-y) var(--bs-btn-padding-x) !important;
    border: var(--bs-btn-border-width) solid var(--brand-danger-border);
    font-size: var(--bs-btn-font-size) !important;
    line-height: var(--bs-btn-line-height) !important;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.btn-favorite.active {
    background-color: var(--brand-danger-hover) !important;
    border-color: var(--brand-danger-border) !important;
    color: #fff !important;
}

.btn-favorite.active i {
    color: rgba(255, 255, 255, 0.75) !important;
}

.btn-favorite:hover {
    background-color: var(--brand-danger-hover) !important;
    color: #fff !important;
    border-color: var(--brand-danger-border) !important;
    transform: translateY(-1px);
}

.btn-favorite.active:hover {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #fff !important;
    transform: translateY(-1px);
}

.movie-sidebar dl {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1.2rem;
    margin: 0;
    border-radius: 12px;
}

.movie-sidebar dt {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 0.15rem;
}

.movie-sidebar dd {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-left: 0;
    margin-bottom: 0.8rem;
}

.movie-sidebar dd:last-child {
    margin-bottom: 0;
}

.movie-details {
    display: block;
    width: 100%;
}

.movie-details header h1 {
    font-size: 2rem;
    font-weight: 900;
    margin: 0 0 0.3rem 0;
    color: var(--text);
}

.original-title {
    font-size: 1.1rem;
    color: var(--text-dim);
    margin: 0 0 0.8rem 0;
}

.categories {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.categories li {
    background: var(--accent-soft);
    color: #ff8aa3;
    padding: 0.25rem 0.75rem;
    border-radius: 5px;
    font-size: 0.78rem;
    font-weight: 600;
}

.movie-synopsis h2 {
    font-size: 1.1rem;
    font-weight: 800;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.movie-synopsis p {
    color: var(--text-dim);
    line-height: 1.6;
    font-size: 0.95rem;
    margin: 0;
}

.movie-rating {
    display: flex;
    gap: 1.2rem;
    align-items: center;
}

.rating-destaque {
    display: inline-flex;
    align-items: baseline;
    gap: .3rem;
    margin-bottom: .9rem;
}

.rating-destaque .estrela {
    color: #ffce45;
    font-size: 1.1rem;
}

.rating-destaque .valor {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text);
}

.rating-destaque .max {
    font-size: .85rem;
    color: rgb(156 163 175 / 0.9);
}

.favorite-status {
    background: rgba(46, 213, 115, 0.12);
    color: #2ed573;
    border: 1px solid rgba(46, 213, 115, 0.25);
    font-size: 0.85rem;
    font-weight: bold;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.movie-tabs-nav {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-color-soft);
    margin-bottom: 1.5rem;
    /* Extrai a nav para fora do padding do .movie-container,
       fazendo a linha de borda ir de ponta a ponta */
    margin-left: -4%;
    margin-right: -4%;
    padding-left: 4%;
    padding-right: 4%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.movie-tabs-nav::-webkit-scrollbar {
    display: none;
}

.movie-tab-btn {
    flex-shrink: 0;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-dim);
    padding: 0.75rem 1.1rem 0.65rem;
    margin-bottom: -1px;
    /* alinha o border-bottom do btn com o border do nav */
    cursor: pointer;
    transition: color 0.18s, border-color 0.18s;
}

.movie-tab-btn:first-child {
    padding-left: 0;
}

.movie-tab-btn:hover {
    color: var(--text);
}

.movie-tab-btn.active {
    color: var(--text);
    font-weight: 700;
    border-bottom: 2px solid var(--brand-primary);
}

.movie-tab-content {
    color: var(--text-dim);
    font-size: 0.95rem;
    line-height: 1.6;
}

.bg-form-container {
    background-color: #ffffff05;
    border: 1px solid var(--border-color-soft);
}

.streaming-services {
    border-top: 1px solid var(--border);
    padding: 1.2rem;
    margin-top: 1rem;
}

.streaming-services h3 {
    font-size: 1rem;
    font-weight: 800;
    margin-top: 0;
    margin-bottom: 0.8rem;
}

.platform-link {
    display: inline-flex;
    align-items: center;
    background: var(--accent);
    color: white !important;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.platform-link:hover {
    background: #ff527a;
}

/* Suggest box */
.suggest-box {
    padding: 1.2rem 1.4rem;
    background: var(--surface);
    border: 1px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    border-radius: 12px;
}

.suggest-box p {
    font-size: .88rem;
    color: var(--text-dim);
    margin: 0;
}

.suggest-box a {
    font-size: .85rem;
    font-weight: 700;
    color: var(--accent);
    cursor: pointer;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 90%;
    max-width: 420px;
    padding: 1.5rem;
    position: relative;
    transform: translateY(20px);
    transition: transform .2s;
    box-shadow: 0 20px 40px rgba(0, 0, 0, .5);
}

.modal-overlay.open .modal {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-faint);
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: .3rem;
}

.form-control {
    width: 100%;
    padding: .65rem .8rem;
    border-radius: 8px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: inherit;
    font-size: .9rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
}



.cast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.reviews-layout {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.reviews-layout>div {
    flex: 1;
    min-width: 300px;
}

@media (max-width: 768px) {

    /* Hero Header: stack vertical no mobile */
    .drama-hero-header {
        padding: 1.5rem 4% 2rem;
    }

    .drama-hero-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.25rem;
    }

    .drama-hero-poster {
        flex: 0 0 160px;
        width: 260px;
    }

    .drama-hero-info {
        width: 100%;
        align-items: center;
    }

    .drama-hero-actions {
        justify-content: center;
    }

    /* Ratings: centralizar no mobile */
    .movie-rating {
        justify-content: center;
    }

    /* Tropes: centralizar no mobile */
    .drama-tropes-tags {
        justify-content: center;
    }

    /* Elenco inline: 1 coluna no mobile */
    .cast-inline-grid {
        grid-template-columns: 1fr;
    }

    .movie-details header h1 {
        font-size: 1.5rem;
        text-align: center;
    }

    .original-title {
        font-size: 0.95rem;
        text-align: center;
    }

    /* Cast tab grid */
    .cast-grid {
        grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
        gap: 0.75rem;
    }

    .reviews-layout>div {
        min-width: 100%;
    }
}

/* Ícone de lápis para sugerir edição de campo (substitui style inline +
   onmouseover/onmouseout repetidos ~18x em templates/drama.php) */
.drama-edit-icon {
    font-size: 0.8rem;
    color: var(--primary);
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.drama-edit-icon:hover {
    opacity: 1;
}

.drama-edit-icon--lg {
    font-size: 0.95rem;
}

.drama-edit-icon--sm {
    font-size: 0.85rem;
}