/* Zhari - Netflix Style */

@font-face {
    font-family: 'Avigea';
    src: url('../assets/fonts/Avigea.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --zhari-red: #E50914;
    --zhari-black: #141414;
    --zhari-dark-gray: #181818;
    --zhari-gray: #808080;
    --zhari-white: #FFFFFF;
    --zhari-light-gray: #B3B3B3;
}

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

body {
    background-color: var(--zhari-black);
    color: var(--zhari-white);
    font-family: 'Helvetica Neue', Arial, sans-serif;
    overflow-x: hidden;
}

/* ========== HEADER ========== */

.header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
}

.header__logo {
    height: 45px;
    width: auto;
}

/* ========== HERO ========== */

.hero {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: flex-end;
    padding-bottom: 60px;
}

.hero__background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero__background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(20, 20, 20, 0.1) 0%,
        rgba(20, 20, 20, 0.3) 50%,
        rgba(20, 20, 20, 0.85) 80%,
        rgba(20, 20, 20, 1) 100%
    );
}

.hero__content {
    position: relative;
    z-index: 2;
    padding: 0 0 0 4%;
    max-width: 600px;
}

/* Hero Title */

.hero__title {
    line-height: 0.9;
    margin-bottom: 20px;
    font-family: 'Avigea', serif;
    font-weight: normal;
    font-size: clamp(4rem, 10vw, 8rem);
    white-space: nowrap;
}

.hero__title .ampersand {
    margin-left: 5px;
}

/* Badge Top 10 */

.hero__badge {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.badge-top10 {
    background-color: var(--zhari-red);
    color: var(--zhari-white);
    font-size: 0.65rem;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.badge-text {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Description */

.hero__description {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--zhari-light-gray);
    margin-bottom: 24px;
    max-width: 100%;
}

/* Action Buttons */

.hero__actions {
    display: flex;
    gap: 12px;
}

.btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.btn:hover {
    opacity: 0.85;
}

.btn--play {
    background-color: var(--zhari-white);
    color: var(--zhari-black);
}

/* Hero Player */

.hero__player {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    max-width: 300px;
}

.hero__player-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.hero__player-progress {
    height: 100%;
    width: 0%;
    background: var(--zhari-red);
    border-radius: 2px;
    transition: width 0.1s linear;
}

.hero__player-bar:hover .hero__player-progress {
    background: var(--zhari-white);
}

.hero__player-time {
    font-size: 0.8rem;
    color: var(--zhari-light-gray);
    white-space: nowrap;
}

.btn--play.playing {
    background-color: rgba(109, 109, 110, 0.7);
    color: var(--zhari-white);
}

.btn svg {
    flex-shrink: 0;
}

/* ========== INFO SECTION ========== */

.info {
    background-color: var(--zhari-black);
    padding: 40px 4%;
}

.info__layout {
    display: flex;
    justify-content: space-between;
    gap: 120px;
    max-width: 1200px;
}

.info__left {
    flex: 1;
}

.info__right {
    width: 300px;
    flex-shrink: 0;
}

/* Meta row: year, duration, HD */

.info__meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.info__year,
.info__duration {
    color: var(--zhari-light-gray);
    font-size: 1rem;
}

.info__badge-hd {
    font-size: 0.7rem;
    font-weight: 700;
    border: 1px solid var(--zhari-gray);
    border-radius: 3px;
    padding: 1px 6px;
    color: var(--zhari-light-gray);
}

/* Rating row: age + genres */

.info__rating {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.info__age {
    font-size: 0.8rem;
    font-weight: 700;
    border: 1px solid var(--zhari-gray);
    padding: 2px 8px;
    color: var(--zhari-light-gray);
}

.info__genres-inline {
    font-size: 0.9rem;
    color: var(--zhari-light-gray);
}

/* Premiere */

.info__premiere {
    font-size: 0.85rem;
    color: var(--zhari-gray);
    margin-bottom: 20px;
}

/* Synopsis */

.info__synopsis {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--zhari-white);
}

/* Right column */

.info__right p {
    font-size: 0.9rem;
    color: var(--zhari-light-gray);
    margin-bottom: 12px;
    line-height: 1.5;
}

.info__label {
    color: var(--zhari-gray);
}

/* ========== PROMISE SECTION ========== */

.promise {
    background-color: var(--zhari-black);
    padding: 60px 4%;
    border-top: 1px solid #333;
}

.promise__container {
    max-width: 650px;
    margin: 0 auto;
    text-align: center;
}

.promise__icon {
    margin-bottom: 24px;
    opacity: 0.9;
}

.promise__title {
    font-family: 'Avigea', serif;
    font-weight: normal;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    margin-bottom: 20px;
    color: var(--zhari-white);
}

.promise__divider {
    width: 60px;
    height: 2px;
    background: var(--zhari-red);
    margin: 0 auto 30px;
}

.promise__text {
    font-size: 1rem;
    line-height: 1.9;
    color: var(--zhari-light-gray);
    margin-bottom: 20px;
    text-align: left;
}

.promise__text--highlight {
    color: var(--zhari-white);
    font-weight: 600;
    font-style: italic;
    border-left: 3px solid var(--zhari-red);
    padding-left: 18px;
    margin-top: 30px;
}

.promise__signature {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.promise__author {
    font-size: 0.9rem;
    color: var(--zhari-gray);
    font-style: italic;
}

.promise__name {
    font-family: 'Avigea', serif;
    font-size: 1.8rem;
    color: var(--zhari-white);
}

/* ========== EPISODES SECTION ========== */

.episodes {
    background-color: var(--zhari-black);
    padding: 40px 4%;
    border-top: 1px solid #333;
}

.episodes__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.episodes__title {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Dropdown */

.episodes__dropdown select {
    appearance: none;
    background-color: var(--zhari-black);
    color: var(--zhari-white);
    border: 1px solid var(--zhari-gray);
    padding: 10px 40px 10px 16px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M1.5 5.5l6.5 6.5 6.5-6.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.episodes__dropdown select:focus {
    outline: 1px solid var(--zhari-white);
}

/* Season info */

.episodes__season-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
}

.episodes__season-label {
    font-size: 0.95rem;
    font-weight: 700;
}

.episodes__season-genres {
    font-size: 0.9rem;
    color: var(--zhari-light-gray);
}

/* Episode card */

.episode {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid #333;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.episode:hover {
    background-color: #333;
    cursor: pointer;
}

.episode__number {
    font-size: 1.5rem;
    color: var(--zhari-light-gray);
    min-width: 30px;
    text-align: center;
    flex-shrink: 0;
}

.episode__thumb {
    width: 170px;
    height: 96px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    background-color: #333;
}

.episode__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.episode__info {
    flex: 1;
}

.episode__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.episode__name {
    font-size: 1rem;
    font-weight: 700;
}

.episode__duration {
    font-size: 0.9rem;
    color: var(--zhari-light-gray);
    flex-shrink: 0;
    margin-left: 20px;
}

.episode__description {
    font-size: 0.85rem;
    color: var(--zhari-gray);
    line-height: 1.5;
}

/* Coming soon episodes */

.episode--coming-soon {
    opacity: 0.7;
    cursor: default;
    pointer-events: none;
}

.episode__thumb--locked {
    display: flex;
    align-items: center;
    justify-content: center;
}

.episode__duration--soon {
    color: var(--zhari-white);
    font-style: italic;
    background: var(--zhari-red);
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 0.75rem;
}

/* ========== MODAL ========== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    justify-content: center;
    padding: 30px;
    overflow-y: auto;
}

.modal.active {
    display: flex;
}

.modal__backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 0;
    animation: modalFadeIn 0.3s ease forwards;
}

.modal__container {
    position: relative;
    z-index: 1;
    background-color: var(--zhari-dark-gray);
    border-radius: 10px;
    width: 100%;
    max-width: 850px;
    max-height: 90vh;
    margin: auto;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    animation: modalSlideUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Loading state */

.modal__loader {
    position: sticky;
    top: 0;
    width: 100%;
    height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background-color: var(--zhari-dark-gray);
    z-index: 5;
    border-radius: 10px;
}

.modal__loader.reveal {
    animation: revealOut 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    pointer-events: none;
}

.modal__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #333;
    border-top-color: var(--zhari-red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.modal__loader-text {
    font-size: 0.85rem;
    color: var(--zhari-gray);
    letter-spacing: 1px;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes revealOut {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-30px);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 10;
    background: rgba(20, 20, 20, 0.7);
    border: none;
    color: var(--zhari-white);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal__close:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Modal Hero */

.modal__hero {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
}

.modal__hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal__hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    background: linear-gradient(to bottom, transparent, var(--zhari-dark-gray));
}

.modal__hero-content {
    position: absolute;
    bottom: 25px;
    left: 35px;
    z-index: 2;
}

.modal__episode-title {
    font-family: 'Avigea', serif;
    font-weight: normal;
    font-size: 2.5rem;
    margin-bottom: 6px;
}

.modal__episode-subtitle {
    font-size: 0.95rem;
    color: var(--zhari-light-gray);
}

/* Modal Letter */

.modal__letter {
    padding: 35px;
    border-bottom: 1px solid #333;
}

.modal__letter-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--zhari-white);
}

.modal__letter-text {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--zhari-light-gray);
    margin-bottom: 24px;
    font-style: italic;
    padding-left: 15px;
    border-left: 2px solid var(--zhari-red);
}

.btn--listen {
    background: var(--zhari-white);
    border: none;
    color: var(--zhari-black);
    padding: 12px 28px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    width: auto;
}

.btn--listen svg {
    fill: var(--zhari-black);
}

.btn--listen:hover:not(:disabled) {
    background: var(--zhari-light-gray);
}

.btn--listen:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.modal__audio-player {
    display: flex;
    align-items: center;
    gap: 16px;
}

.modal__audio-progress-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.modal__audio-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
    overflow: hidden;
}

.modal__audio-progress {
    height: 100%;
    width: 0%;
    background: var(--zhari-red);
    border-radius: 2px;
    transition: width 0.1s linear;
}

.modal__audio-time {
    font-size: 0.8rem;
    color: var(--zhari-gray);
    white-space: nowrap;
}

.btn--listen.playing {
    background: var(--zhari-red);
    color: var(--zhari-white);
}

.btn--listen.playing svg {
    fill: var(--zhari-white);
}

/* Modal Gallery */

.modal__gallery {
    padding: 35px;
}

.modal__gallery-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.modal__gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.modal__gallery-grid img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.modal__gallery-grid img:hover {
    transform: scale(1.03);
    opacity: 0.85;
}

/* ========== LIGHTBOX ========== */

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    background: rgba(0, 0, 0, 0.95);
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox__img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 6px;
    animation: modalIn 0.3s ease;
}

.lightbox__close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--zhari-white);
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.lightbox__close:hover {
    opacity: 1;
}

.lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(20, 20, 20, 0.6);
    border: none;
    color: var(--zhari-white);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.lightbox__nav:hover {
    background: rgba(255, 255, 255, 0.15);
}

.lightbox__nav--prev {
    left: 20px;
}

.lightbox__nav--next {
    right: 20px;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 768px) {
    .header {
        padding: 15px 0;
    }

    .header__logo {
        height: 30px;
    }

    .hero {
        min-height: 90vh;
        padding-bottom: 40px;
    }

    .hero__content {
        padding: 0 5%;
    }

    .hero__background img {
        object-position: 30% center;
    }

    .hero__title {
        font-size: clamp(3.5rem, 14vw, 5.5rem);
    }

    .hero__description {
        font-size: 0.85rem;
    }

    .hero__actions {
        flex-wrap: wrap;
    }

    .hero__player {
        max-width: 100%;
        width: 100%;
    }

    .btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }

    .info__layout {
        flex-direction: column;
        gap: 30px;
    }

    .info__right {
        width: 100%;
    }

    .episode {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 0;
        padding-bottom: 20px;
        margin-bottom: 20px;
    }

    .episode:hover {
        background-color: transparent;
    }

    .episode__number {
        display: none;
    }

    .episode__name::before {
        content: attr(data-num) '. ';
    }

    .episode__thumb {
        width: 100%;
        height: 180px;
        border-radius: 6px;
    }

    .episode__top {
        flex-direction: row;
        align-items: center;
    }

    .episode__duration {
        margin-left: auto;
    }

    .episodes__season-info {
        flex-wrap: wrap;
    }

    .modal {
        padding: 10px;
    }

    .modal__hero {
        height: 250px;
    }

    .modal__episode-title {
        font-size: 1.8rem;
    }

    .modal__hero-content {
        left: 20px;
    }

    .modal__letter,
    .modal__gallery {
        padding: 20px;
    }

    .modal__gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal__gallery-grid img {
        height: 150px;
    }
}
