/* ================================================================
   Trailers Page — css/pages/trailers.css
   Cinematic trailer grid with YouTube lazy-embed cards
   ================================================================ */

/* ── Hero (re-uses cinematic-hero base, adds trailer-specific text) */
#view-trailers .cinematic-hero .small { letter-spacing: 0.3em; }

/* ── Status Bar ────────────────────────────────────────────────── */
.trailers-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    max-width: 1300px;
    margin: 0 auto 1.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--text-muted, #aaa);
}

.trailers-status-bar .status-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent, #00f0ff);
    box-shadow: 0 0 6px var(--accent, #00f0ff);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.4; transform: scale(0.7); }
}

.trailers-refresh-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    color: var(--text-muted, #aaa);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.trailers-refresh-btn:hover:not(:disabled) {
    border-color: var(--accent, #00f0ff);
    color: var(--accent, #00f0ff);
}

.trailers-refresh-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.trailers-refresh-btn svg { transition: transform 0.4s ease; }
.trailers-refresh-btn.spinning svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Controls: Search & Filters ─────────────────────────────────── */
.trailers-controls {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 1300px;
    margin: 0 auto 2rem;
    padding: 0 0.25rem;
}

.trailers-search-wrapper {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted, #aaa);
    pointer-events: none;
}

.trailers-search-input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.8rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary, #fff);
    font-size: 0.9rem;
    font-family: var(--font-body, 'Inter', sans-serif);
    transition: all 0.3s ease;
}

.trailers-search-input:focus {
    outline: none;
    border-color: var(--accent, #00f0ff);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.2);
}

.trailers-search-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.trailers-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 0.4rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: var(--text-muted, #aaa);
    font-size: 0.8rem;
    font-family: var(--font-body, 'Inter', sans-serif);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-chip:hover {
    border-color: var(--accent, #00f0ff);
    color: var(--accent, #00f0ff);
}

.filter-chip.active {
    background: var(--accent, #00f0ff);
    border-color: var(--accent, #00f0ff);
    color: #000;
    font-weight: 600;
}

/* ── Trailer Grid ───────────────────────────────────────────────── */
.trailers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    max-width: 1300px;
    margin: 0 auto;
}

/* ── Trailer Card ───────────────────────────────────────────────── */
.trailer-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
}

.trailer-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--accent, #00f0ff);
    border-color: var(--accent, #00f0ff);
}

/* NEW badge */
.trailer-card .new-badge {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    z-index: 10;
    background: var(--accent, #00f0ff);
    color: #000;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    padding: 0.25rem 0.55rem;
    border-radius: 20px;
    text-transform: uppercase;
    animation: badge-pulse 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes badge-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.6); }
    50%       { box-shadow: 0 0 0 6px rgba(0, 240, 255, 0); }
}

/* Type badge (Trailer / Teaser / Clip) */
.trailer-card .type-badge {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    z-index: 10;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.25rem 0.55rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    pointer-events: none;
}

/* ── Video Thumbnail / Lazy Embed ───────────────────────────────── */
.trailer-thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #0a0a0a;
    cursor: pointer;
    overflow: hidden;
}

.trailer-thumb-wrap img.thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease, filter 0.3s ease;
    display: block;
}

.trailer-thumb-wrap:hover img.thumb-img {
    transform: scale(1.04);
    filter: brightness(0.6);
}

/* Play button overlay */
.play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.play-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    transition: transform 0.2s ease, background 0.2s ease;
}

.trailer-thumb-wrap:hover .play-circle {
    transform: scale(1.1);
    background: var(--accent, #00f0ff);
    border-color: var(--accent, #00f0ff);
}

.play-circle svg { margin-left: 4px; }

/* Embedded iframe replaces thumbnail */
.trailer-thumb-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ── Card Info ──────────────────────────────────────────────────── */
.trailer-card-info {
    padding: 1rem 1.1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.trailer-movie-title {
    font-family: var(--font-display, 'Outfit', sans-serif);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary, #fff);
    line-height: 1.3;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.trailer-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-muted, #888);
}

.trailer-meta .release-date { display: flex; align-items: center; gap: 0.3rem; }

.genre-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.genre-chip {
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-muted, #aaa);
    letter-spacing: 0.04em;
}

.trailer-yt-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.25rem;
    padding: 0.45rem 0.85rem;
    background: rgba(255, 0, 0, 0.12);
    border: 1px solid rgba(255, 0, 0, 0.25);
    border-radius: 8px;
    color: #ff4444;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    width: fit-content;
    transition: background 0.2s, border-color 0.2s;
}

.trailer-yt-link:hover {
    background: rgba(255, 0, 0, 0.22);
    border-color: rgba(255, 0, 0, 0.5);
}

/* ── Skeleton loaders ───────────────────────────────────────────── */
.trailer-skeleton {
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.skeleton-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
}

.skeleton-body { padding: 1rem; display: flex; flex-direction: column; gap: 0.6rem; }

.skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
}

.skeleton-line.short { width: 55%; }
.skeleton-line.medium { width: 75%; }

@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Empty / Error States ───────────────────────────────────────── */
.trailers-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted, #888);
}

.trailers-empty .empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.trailers-empty h3 { font-size: 1.2rem; margin-bottom: 0.5rem; color: var(--text-primary, #fff); }

/* ── Content Wrapper ────────────────────────────────────────────── */
#trailers-content {
    padding: 2.5rem 1.5rem 4rem;
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .trailers-grid { grid-template-columns: 1fr; gap: 1rem; }
    .trailers-status-bar { font-size: 0.8rem; }
    #trailers-content { padding: 1.5rem 1rem 3rem; }
}

@media (max-width: 480px) {
    .trailers-grid { grid-template-columns: 1fr; }
    .play-circle { width: 48px; height: 48px; }
}
