/* ==========================================================================
   FILMATIC FILM PAGES — Film page layout + search integration
   Follows Ive redesign aesthetic: gold accents, dark theme, clean typography
   ========================================================================== */

/* ── Hero ── */
.fp-hero {
    position: relative;
    width: 100%;
    height: 420px;
    overflow: hidden;
    margin-bottom: -60px;
}

.fp-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.85) contrast(1.05) brightness(0.7);
}

.fp-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--bg-primary, #0c0c0e) 0%, rgba(12,12,14,0.6) 50%, rgba(12,12,14,0.3) 100%);
}

/* No backdrop fallback */
.fp-hero-empty {
    height: 120px;
    background: var(--bg-primary, #0c0c0e);
    margin-bottom: 0;
}

/* ── 404 Film Not Found ── */
.fp-not-found {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

.fp-not-found-inner {
    text-align: center;
    max-width: 440px;
}

.fp-not-found-icon {
    color: var(--text-tertiary, #58585e);
    margin-bottom: 24px;
}

.fp-not-found-title {
    font-family: var(--font-heading, 'Inter', sans-serif);
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 600;
    color: var(--text-primary, #e5e5e7);
    margin: 0 0 12px;
    letter-spacing: -0.02em;
}

.fp-not-found-desc {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary, #86868b);
    margin: 0 0 32px;
}

.fp-not-found-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── Header ── */
.fp-header {
    position: relative;
    z-index: 1;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px 32px;
}

.fp-title {
    font-family: var(--font-heading, 'Inter', sans-serif);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary, #e5e5e7);
    margin: 12px 0 16px;
    line-height: 1.15;
}

.fp-identity {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.fp-rating-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--accent, #c9a96e);
    font-weight: 600;
    font-size: 15px;
    margin-right: 10px;
}

.fp-rating-badge svg {
    color: var(--accent, #c9a96e);
}

.fp-meta-item {
    color: var(--text-secondary, #86868b);
    font-size: 14px;
}

.fp-meta-item + .fp-meta-item::before {
    content: '\00B7';
    margin: 0 8px;
    color: var(--text-tertiary, #58585e);
}

.fp-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fp-genre {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-tertiary, #58585e);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    padding: 4px 10px;
}

/* ── Content (two-column) ── */
.fp-content {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px 48px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
}

.fp-poster-col {
    position: sticky;
    top: 24px;
    align-self: start;
}

.fp-poster {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
    display: block;
}

.fp-poster-placeholder {
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(201,169,110,0.25), #1a1a1a);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    color: rgba(255,255,255,0.5);
    font-size: 16px;
    font-weight: 600;
}

.fp-save-btn.watchlist-btn-inline {
    width: 100%;
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-secondary, #86868b);
    cursor: pointer;
    transition: all 0.2s ease;
}

.fp-save-btn.watchlist-btn-inline:hover {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.15);
}

.fp-save-btn.watchlist-btn-inline.saved {
    background: rgba(201,169,110,0.08);
    border-color: rgba(201,169,110,0.2);
    color: var(--accent, #c9a96e);
}

/* ── Details column ── */
.fp-overview {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-secondary, #86868b);
    margin: 0 0 32px;
}

.fp-section-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-tertiary, #58585e);
    margin: 0 0 16px;
}

/* Cast */
.fp-cast-section {
    margin-bottom: 32px;
}

.fp-cast-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.fp-cast-member {
    text-align: center;
}

.fp-cast-photo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 8px;
    display: block;
}

.fp-cast-photo.fp-cast-placeholder {
    background: var(--bg-tertiary, #1c1c22);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary, #58585e);
}

.fp-cast-name {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary, #e5e5e7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fp-cast-role {
    display: block;
    font-size: 11px;
    color: var(--text-tertiary, #58585e);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Streaming */
.fp-streaming-section {
    margin-bottom: 32px;
}

.fp-providers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fp-provider {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    font-size: 13px;
    color: var(--text-secondary, #86868b);
}

.fp-provider img {
    width: 24px;
    height: 24px;
    border-radius: 5px;
}

.fp-provider-link {
    text-decoration: none;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.fp-provider-link:hover {
    border-color: rgba(201,169,110,0.25);
    color: var(--accent, #c9a96e);
}

/* Tags (from curated quiz data) */
.fp-tags-section {
    margin-bottom: 32px;
}

.fp-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fp-tag {
    font-size: 12px;
    font-weight: 500;
    color: var(--accent, #c9a96e);
    background: rgba(201,169,110,0.06);
    border: 1px solid rgba(201,169,110,0.12);
    border-radius: 6px;
    padding: 4px 12px;
}

/* ── Sections (DF + Similar) ── */
.fp-section {
    border-top: 1px solid rgba(255,255,255,0.04);
    padding: 48px 0;
}

.fp-section-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
}

.fp-section-title {
    font-family: var(--font-heading, 'Inter', sans-serif);
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary, #e5e5e7);
    margin: 0 0 4px;
}

.fp-section-subtitle {
    font-size: 14px;
    color: var(--text-tertiary, #58585e);
    margin: 0 0 24px;
}

/* Double Feature Cards */
.fp-df-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.fp-df-card {
    display: block;
    text-decoration: none;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-secondary, #141418);
    border: 1px solid rgba(255,255,255,0.04);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.fp-df-card:hover {
    transform: translateY(-4px);
    border-color: rgba(201,169,110,0.2);
}

.fp-df-card img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    display: block;
}

.fp-df-card-placeholder {
    width: 100%;
    aspect-ratio: 2 / 3;
    background: linear-gradient(135deg, rgba(201,169,110,0.2), #1a1a1a);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    text-align: center;
    color: rgba(255,255,255,0.5);
    font-size: 14px;
}

.fp-df-card-info {
    padding: 12px 14px 4px;
}

.fp-df-card-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #e5e5e7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fp-df-card-year {
    font-size: 12px;
    color: var(--text-tertiary, #58585e);
}

.fp-df-card-connection {
    display: block;
    padding: 4px 14px 14px;
    font-size: 12px;
    color: var(--text-tertiary, #58585e);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Similar Films Grid */
.fp-similar-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

.fp-similar-card {
    display: block;
    text-decoration: none;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

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

.fp-similar-card img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    display: block;
    border-radius: 12px;
}

.fp-similar-placeholder {
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(201,169,110,0.15), #1a1a1a);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    text-align: center;
    color: rgba(255,255,255,0.4);
    font-size: 12px;
}

.fp-similar-title {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary, #e5e5e7);
    margin-top: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fp-similar-year {
    display: block;
    font-size: 11px;
    color: var(--text-tertiary, #58585e);
}

/* ── Search Autocomplete: Film Database Results ── */
.ac-group-films .ac-group-label {
    color: var(--accent, #c9a96e) !important;
}

.ac-film-db {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 10px 16px !important;
}

.ac-film-db .ac-thumb-poster {
    width: 32px !important;
    height: 48px !important;
    border-radius: 4px !important;
    flex-shrink: 0 !important;
    background: rgba(201,169,110,0.08) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--accent, #c9a96e) !important;
}

.ac-film-db .ac-item-info {
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
}

.ac-film-db .ac-title {
    font-weight: 500 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.ac-film-db .ac-meta {
    font-size: 12px !important;
    color: var(--text-tertiary, #58585e) !important;
}

/* ── Search Results Page: Film Section ── */
.fp-search-results-section {
    padding: 32px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.fp-search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

/* ── Mobile Responsive ── */
@media (max-width: 768px) {
    .fp-hero {
        height: 280px;
    }

    .fp-header {
        padding: 0 16px 24px;
    }

    .fp-title {
        font-size: 1.75rem;
    }

    .fp-identity {
        gap: 6px;
    }

    .fp-content {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 0 16px 32px;
    }

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

    .fp-cast-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }

    .fp-cast-photo {
        width: 44px;
        height: 44px;
    }

    .fp-similar-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .fp-df-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .fp-section-inner {
        padding: 0 16px;
    }
}

/* ── Hide search page genre/decade filters (not useful with title-only search) ── */
.search-filters {
    display: none !important;
}

@media (max-width: 480px) {
    .fp-hero {
        height: 220px;
    }

    .fp-title {
        font-size: 1.5rem;
    }

    .fp-cast-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .fp-similar-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .fp-df-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .fp-poster-col {
        max-width: 200px;
    }
}