/* movie.css — сторінка фільму/серіалу */

.movie-page-container {
    padding-top: 20px;
    padding-bottom: 60px;
}

.movie-back {
    margin-bottom: 16px;
}

.btn-back {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
    font-family: inherit;
}

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

/* ===== ВЕРХНЯ СЕКЦІЯ ===== */
.movie-top {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
    margin-bottom: 48px;
}

/* ===== ПОСТЕР ===== */
.movie-poster-col {
    position: sticky;
    top: 80px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.movie-poster-wrap {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.movie-poster {
    width: 100%;
    display: block;
    object-fit: cover;
    object-position: top;
    border-radius: var(--radius-lg);
    min-height: 200px;
    background: var(--bg-card-inner);
}

.movie-imdb-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #f5c518;
    color: #000;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: var(--transition);
}

.movie-imdb-btn:hover { opacity: 0.88; }

/* ===== ІНФО ===== */
.movie-info-col {
    padding-top: 4px;
}

.movie-type-badge {
    display: inline-block;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
    letter-spacing: 0.3px;
}

.movie-title-uk {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 4px;
    color: var(--text-primary);
    line-height: 1.2;
}

.movie-title-orig {
    font-size: 1rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 24px;
}

/* ===== META ===== */
.movie-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 28px;
}

.movie-meta-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
}

.movie-meta-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.movie-meta-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== ОПИС ===== */
.movie-description-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 600;
}

.movie-description {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.movie-description p {
    margin: 0 0 1em;
}

.movie-description p:last-child {
    margin-bottom: 0;
}

/* ===== СЕКЦІЇ ===== */
.movie-section {
    margin-bottom: 48px;
}

.movie-section-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
    color: var(--text-primary);
}

/* ===== АКТОРИ ===== */
.movie-actors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
}

.movie-actor-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: transform var(--transition);
    gap: 8px;
}

.movie-actor-card:hover { transform: translateY(-4px); }

.movie-actor-photo {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    object-position: top;
    border: 2px solid var(--border);
    background: var(--bg-card-inner);
}

.movie-actor-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.movie-actor-orig {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.2;
}

.actors-show-all-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 24px auto 0;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 10px 24px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.actors-show-all-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Приховування акторів через CSS (Show All) */
.movie-actors-grid {
    overflow: hidden;
    transition: max-height 0.4s ease;
}
.movie-actors-grid.expanded {
    max-height: 3000px !important;
}

/* ===== КАДРИ ===== */
.movie-stills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.movie-still-item {
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 16/9;
    background: var(--bg-card-inner);
}

.movie-still-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.movie-still-item:hover img { transform: scale(1.04); opacity: 0.85; }

/* ===== LIGHTBOX (той самий що в новинах) ===== */
.gallery-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-modal.show {
    display: flex;
    opacity: 1;
}

.gallery-modal img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    object-position: top;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.gallery-modal.show img { transform: scale(1); }

.gallery-modal-close {
    position: absolute;
    top: 20px; right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    color: white;
    border: none;
    font-size: 40px;
    padding: 20px;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px; height: 70px;
}

.gallery-nav:hover { background: rgba(255,255,255,0.3); }
.gallery-nav.prev { left: 20px; }
.gallery-nav.next { right: 20px; }

/* ===== НЕ ЗНАЙДЕНО ===== */
.movie-not-found {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* ===== МОБІЛЬНА ВЕРСІЯ ===== */
@media (max-width: 768px) {
    .movie-top {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .movie-poster-col {
        position: static;
        max-width: 220px;
        margin: 0 auto;
    }

    .movie-title-uk { font-size: 1.5rem; }

    .movie-meta { grid-template-columns: 1fr 1fr; }

    .movie-actors-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 10px;
    }

    .movie-actor-photo { width: 70px; height: 70px; }
}

@media (max-width: 480px) {
    .movie-meta { grid-template-columns: 1fr; }
    .movie-stills-grid { grid-template-columns: 1fr 1fr; }
}

/* ===== SELECT & OPTIONS FIXES ===== */
#movieListSelect {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    border: 1px solid var(--border-strong) !important;
    
    /* Custom SVG Arrow for dark/light themes */
    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='gray' 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 14px center;
    background-size: 16px;
    padding-right: 40px;
}

#movieListSelect,
#movieListSelect option {
    -webkit-appearance: none; /* Для Chrome/Opera */
    -moz-appearance: none;    /* Для Firefox */
    appearance: none;         /* Вимикаємо системні стилі */
    background-color: #08080C !important;
    color: #f1f5f9 !important;
}

/* Окремо для Firefox, щоб залізобетонно перебити внутрішній колір випадаючого вікна */
@-moz-document url-prefix() {
    #movieListSelect {
        background-color: #08080C !important;
    }
    #movieListSelect option {
        background: #08080C !important;
        color: #f1f5f9 !important;
    }
}

/* Прибираємо світле виділення в Firefox та Opera */
#movieListSelect:focus, 
#movieListSelect:active {
    outline: none !important;
    box-shadow: none !important;
    background-color: #08080C !important;
}

/* ===== ЖАНРИ (GENRE BADGES) ===== */
.movie-genres-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.genre-badge {
    background: rgba(225, 29, 72, 0.08); /* Ніжний пастельний рожевий фон для світлої теми */
    color: #e11d48;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.genre-badge:hover {
    background: rgba(225, 29, 72, 0.15);
    transform: translateY(-2px);
}

/* Темна тема */
body.dark-mode .genre-badge {
    background: rgba(225, 29, 72, 0.15);
    color: #fb7185;
}

body.dark-mode .genre-badge:hover {
    background: rgba(225, 29, 72, 0.25);
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.4); /* Неоновий ефект */
}

/* ===== ОПИС ФІЛЬМУ ===== */
.movie-description-block {
    background: #ffffff; /* Світле тло для світлої теми */
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 16px;
    padding: 24px;
    margin-top: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.movie-description-block #movieDescription {
    color: #334155; /* Чіткий темний текст для світлої теми */
}

.movie-description-block h2#labelDescription {
    color: #64748b;
}

/* Темна тема */
body.dark-mode .movie-description-block {
    background: #08080C;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

body.dark-mode .movie-description-block #movieDescription {
    color: #f1f5f9; /* Світлий текст для темної теми */
}

body.dark-mode .movie-description-block h2#labelDescription {
    color: #94a3b8;
}

/* ===== ПОВ'ЯЗАНІ МАТЕРІАЛИ (НОВИНИ) ===== */
.related-news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.related-news-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 12px);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.related-news-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md, 0 8px 20px rgba(0, 0, 0, 0.12));
    border-color: var(--accent, #e11d48);
}

.related-news-thumb-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-card-inner, #1e293b);
    flex-shrink: 0;
}

.related-news-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
    transition: transform 0.3s ease;
}

.related-news-card:hover .related-news-thumb {
    transform: scale(1.04);
}

.related-news-info {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.related-news-date {
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
}

.related-news-title {
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
