/* ============================================================
   CINEMA CLUB — components.css (v3.0 Filimo-Style)
   کامپوننت‌ها: کارت پوستر، ردیف افقی، مودال، توست
============================================================ */

/* ============================================================
   دکمه‌ها
============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 999px;
    border: 1.5px solid var(--border);
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    transition: var(--tr);
    white-space: nowrap;
    user-select: none;
    text-decoration: none;
    line-height: 1;
    min-height: 42px;
    font-family: inherit;
}

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

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn--sm {
    padding: 8px 14px;
    font-size: 11.5px;
    min-height: 34px;
}

.btn--lg {
    padding: 15px 32px;
    font-size: 15px;
    min-height: 52px;
}

.btn--block {
    width: 100%;
}

.btn--primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    border-color: transparent;
    color: #000;
    box-shadow: 0 8px 24px rgba(0, 188, 212, 0.35);
    font-weight: 700;
}
.btn--primary:hover {
    background: linear-gradient(135deg, var(--brand-light), var(--brand));
    box-shadow: 0 12px 30px rgba(0, 188, 212, 0.5);
}

.btn--ghost {
    background: transparent;
    border-color: var(--border-2);
}
.btn--ghost:hover {
    background: rgba(255, 255, 255, 0.05);
}

.btn--danger {
    background: rgba(231, 76, 60, 0.12);
    border-color: rgba(231, 76, 60, 0.4);
    color: #ff7b6b;
}
.btn--danger:hover {
    background: rgba(231, 76, 60, 0.2);
    border-color: rgba(231, 76, 60, 0.6);
}

.btn--gold {
    background: linear-gradient(135deg, var(--gold), var(--imdb));
    border-color: transparent;
    color: #000;
    box-shadow: 0 8px 24px rgba(255, 215, 0, 0.35);
    font-weight: 700;
}
.btn--gold:hover {
    box-shadow: 0 12px 30px rgba(255, 215, 0, 0.5);
}

/* ============================================================
   بج (Badge)
============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 8px;
    white-space: nowrap;
    line-height: 1.4;
}

.badge--brand   { background: rgba(0, 188, 212, 0.15); color: var(--brand); }
.badge--imdb    { background: var(--imdb); color: #000; }
.badge--gold    { background: rgba(255, 215, 0, 0.15); color: var(--gold); }
.badge--success { background: rgba(46, 204, 113, 0.15); color: var(--success); }
.badge--info    { background: rgba(52, 152, 219, 0.15); color: #5dade2; }
.badge--danger  { background: rgba(231, 76, 60, 0.15); color: #ff7b6b; }
.badge--dim     { background: rgba(255, 255, 255, 0.06); color: var(--text-dim); }

/* ============================================================
   کارت پوستر — Filimo Style
============================================================ */
.poster-card {
    display: block;
    position: relative;
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--bg-3);
    transition: all .25s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
    width: 100%;
}

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

.poster-card__img {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.1), rgba(0, 0, 0, 0.5));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--text-mute);
    overflow: hidden;
}

.poster-card__img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.poster-card:hover .poster-card__img img {
    transform: scale(1.08);
}

.poster-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 60%);
    opacity: 0;
    transition: opacity .25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.poster-card:hover .poster-card__overlay {
    opacity: 1;
}

.poster-card__play {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(0, 188, 212, 0.95);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 8px 24px rgba(0, 188, 212, 0.5);
    transform: scale(0.8);
    transition: transform .25s ease;
    padding-right: 3px;
}

.poster-card:hover .poster-card__play {
    transform: scale(1);
}

.poster-card__badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    padding: 3px 9px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}

.poster-card__badge--imdb {
    background: var(--imdb);
    color: #000;
    top: auto;
    bottom: 8px;
    right: 8px;
}

.poster-card__title {
    padding: 10px 8px 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center;
}

.poster-card__meta {
    padding: 0 8px 10px;
    font-size: 11px;
    color: var(--text-mute);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* ============================================================
   ردیف افقی — Filimo Style
============================================================ */
.row-section {
    margin-bottom: 32px;
}

.row-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding: 0 4px;
}

.row-section__title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.row-section__title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 22px;
    background: var(--brand);
    border-radius: 4px;
    flex-shrink: 0;
}

.row-section__see-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    padding: 8px 14px;
    border-radius: 8px;
    transition: all .2s;
}

.row-section__see-all:hover {
    color: var(--brand);
    background: rgba(0, 188, 212, 0.1);
}

.row-section__scroll {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.row-section__scroll::-webkit-scrollbar {
    display: none;
}

.row-section__scroll > * {
    scroll-snap-align: start;
    width: 170px;
    min-width: 170px;
}

/* ============================================================
   مودال
============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: var(--z-modal);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.modal-overlay.active {
    display: flex;
    animation: modalFadeIn 0.2s ease;
}

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

.modal {
    background: rgba(30, 30, 30, 0.98);
    border: 1px solid var(--border-2);
    border-radius: var(--r-xl);
    width: 100%;
    max-width: 500px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* ============================================================
   توست (Toast)
============================================================ */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 90vw;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: var(--bg-3);
    border: 1px solid var(--border-2);
    border-right: 3px solid var(--brand);
    border-radius: var(--r-md);
    color: var(--text);
    font-size: 13px;
    box-shadow: var(--shadow-md);
    max-width: 380px;
    pointer-events: auto;
    animation: toastIn 0.3s ease;
}

.toast--success { border-right-color: var(--success); }
.toast--error   { border-right-color: var(--danger); }
.toast--warning { border-right-color: var(--warning); }
.toast--info    { border-right-color: var(--info); }

.toast__icon {
    font-size: 18px;
    flex-shrink: 0;
}

@keyframes toastIn {
    from { transform: translateX(-100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

.toast.hiding {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
    to { transform: translateX(-100%); opacity: 0; }
}

/* ============================================================
   Responsive
============================================================ */
@media (max-width: 768px) {
    .row-section {
        margin-bottom: 24px;
    }

    .row-section__title {
        font-size: 16px;
    }

    .row-section__title::before {
        height: 18px;
        width: 3px;
    }

    .row-section__scroll {
        gap: 10px;
    }

    .row-section__scroll > * {
        width: 130px;
        min-width: 130px;
    }

    .row-section__see-all {
        font-size: 12px;
        padding: 6px 10px;
    }

    .poster-card__title {
        font-size: 12px;
        padding: 8px 6px 2px;
    }

    .poster-card__play {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }

    .toast-container {
        bottom: 16px;
        left: 16px;
        right: 16px;
        max-width: none;
    }

    .toast {
        max-width: none;
    }

    .modal {
        max-height: 96vh;
    }
}