/* =====================================================
   SEARCH.CSS
   Page-specific styles for search.asp
   ===================================================== */


/* ===================== SEARCH HERO ===================== */
.search-hero {
    padding: 80px 60px 0;
    max-width: 1300px;
    margin: 0 auto;
}

.search-hero h1 {
    font-size: 44px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.search-hero .subtitle {
    color: #666;
    font-size: 15px;
    margin-bottom: 32px;
}


/* ===================== SEARCH BAR ===================== */
.search-bar {
    display: flex;
    gap: 0;
    margin-bottom: 28px;
}

.search-bar input {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-right: none;
    border-radius: 10px 0 0 10px;
    padding: 16px 20px;
    font-size: 15px;
    color: #fff;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    font-family: inherit;
}

.search-bar input::placeholder { color: #555; }

.search-bar input:focus {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.15);
}

.search-bar button {
    background: #fff;
    color: #000;
    border: none;
    border-radius: 0 10px 10px 0;
    padding: 16px 28px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
    font-family: inherit;
}

.search-bar button:hover { background: #e0e0e0; }


/* ===================== FILTER CHIPS ===================== */
.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 36px;
    align-items: center;
}

.filter-chip {
    position: relative;
}

.filter-chip select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: #aaa;
    padding: 10px 36px 10px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: all 0.15s;
    font-family: inherit;
}

.filter-chip select:hover,
.filter-chip select:focus {
    border-color: rgba(255,255,255,0.18);
    color: #fff;
}

.filter-chip::after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #666;
    pointer-events: none;
}

.filter-chip select option {
    background: #1a1a1a;
    color: #ddd;
}

.filter-chip select.active {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    color: #fff;
}

.filter-count {
    color: #555;
    font-size: 13px;
    margin-left: 8px;
}


/* ===================== LOADING / EMPTY STATES ===================== */
.search-loading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
}

.search-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: #555;
}

.search-empty p {
    font-size: 16px;
    margin-bottom: 8px;
}

.search-empty-sub {
    font-size: 13px;
    color: #444;
}


/* ===================== RESULTS GRID ===================== */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 60px 40px;
}


/* ===================== FILM CARD ===================== */
.film-card {
    position: relative;
    transition:
        transform .18s ease,
        box-shadow .18s ease;
    will-change: transform;
}

.film-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow:
        0 14px 30px rgba(0,0,0,.28),
        0 4px 10px rgba(0,0,0,.18);
}


    .film-card .thumb {
        position: relative;
        width: 100%;
        aspect-ratio: 16 / 9;
        overflow: visible;
        background: #111;
    }

.film-card .thumb img.poster-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.3s ease;
    display: block;
}

.film-card:hover .thumb img.poster-img {
    transform: scale(1.06);
}

/* Preview container for autoplay iframe */
.film-card .preview-host {
    position: absolute;
    inset: 0;
    display: none;
    background: #000;
}

.film-card .preview-host iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* Play icon overlay */
.film-card .play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    background: rgba(0,0,0,0.25);
    pointer-events: none;
}

.film-card.previewing {
    transform: translateY(-4px) scale(1.01);
}

.film-card:hover .play-overlay { opacity: 1; }
.film-card.previewing .play-overlay { opacity: 0 !important; }

.play-overlay .play-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    transition: transform 0.2s ease;
}

.film-card:hover .play-icon { transform: scale(1.08); }

.play-overlay svg {
    width: 18px;
    height: 18px;
    fill: #000;
    margin-left: 2px;
}

/* Year badge */
.film-card .year-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #ccc;
    z-index: 2;
}

/* Loading spinner */
.film-card .preview-loader {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.6);
    z-index: 1;
}

.film-card.loading .preview-loader { display: flex; }

.preview-loader .spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255,255,255,0.15);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* Card body */
.film-card .meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.film-card .meta-pill {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    line-height: 1.4;
    cursor: pointer;
    transition: all .15s ease;
}

.film-card .category-pill {
    background: rgba(212,175,55,0.15);
    color: #d4af37;
    border: 1px solid rgba(212,175,55,0.25);
}

    .film-card .category-pill:hover {
        background: rgba(212,175,55,0.25);
        border-color: rgba(212,175,55,0.45);
    }

.film-card .flag-pill img {
    width: 22px;
    height: 16px;
    border-radius: 2px;
    object-fit: cover;
    display: block;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.1);
}

.film-card .flag-pill:hover img {
    transform: scale(1.1);
}

/* Flag badge overlaid on thumbnail */
.film-card .flag-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
}

    .film-card .flag-badge img {
        width: 26px;
        height: 19px;
        border-radius: 3px;
        object-fit: cover;
        display: block;
        box-shadow: 0 1px 4px rgba(0,0,0,0.5);
    }


/* ===================== PAGINATION ===================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 60px 48px;
}

.page-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
    background: transparent;
    color: #666;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    font-family: inherit;
}

.page-btn:hover {
    border-color: rgba(255,255,255,0.15);
    color: #fff;
}

.page-btn.active {
    background: #fff;
    color: #000;
    border-color: #fff;
}

.page-btn.nav-btn {
    width: auto;
    padding: 0 16px;
    font-size: 13px;
}

.page-ellipsis {
    color: #444;
    font-size: 14px;
    padding: 0 4px;
}


/* ===================== ALTERNATIVE BROWSE ===================== */
.alt-browse {
    max-width: 1300px;
    margin: 0 auto;
    padding: 20px 60px 60px;
}

.alt-browse-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #444;
    margin-bottom: 18px;
}

.alt-browse-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.alt-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 28px 24px;
    transition: all 0.2s ease;
    cursor: pointer;
    display: block;
    color: inherit;
    text-decoration: none;
}

.alt-card:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.alt-card .alt-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.alt-card .alt-icon svg {
    width: 18px;
    height: 18px;
    stroke: #888;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.alt-card h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 6px;
}

.alt-card p {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}


/* ===================== SPONSORS ===================== */
.sponsors {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 60px 70px;
    position: relative;
}

.sponsors-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #666;
    margin-bottom: 24px;
    text-align: center;
}

.sponsors-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.sponsors-carousel {
    overflow: hidden;
    width: 100%;
    position: relative;
}

/* Gradient fade edges */
.sponsors-carousel::before,
.sponsors-carousel::after {
    content: "";
    position: absolute;
    top: 0;
    width: 80px;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

.sponsors-carousel::before {
    left: 0;
    background: linear-gradient(to right, #0b0b0b 0%, rgba(11,11,11,0) 100%);
}

.sponsors-carousel::after {
    right: 0;
    background: linear-gradient(to left, #0b0b0b 0%, rgba(11,11,11,0) 100%);
}

.sponsors-track {
    display: flex;
    gap: 45px;
    align-items: center;
    width: max-content;
    animation: scrollSponsors 40s linear infinite;
    transition: transform 0.4s ease;
}

@keyframes scrollSponsors {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

.sponsors-carousel:hover .sponsors-track {
    animation-play-state: paused;
}

.sponsor-item {
    flex: 0 0 auto;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sponsor-item img {
    height: 80px;
    max-width: 200px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.sponsor-item:hover img { transform: scale(1.08); }

.sponsor-arrow {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 5;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sponsor-arrow:hover {
    background: var(--accent);
    color: #fff;
}

.sponsor-arrow.left { margin-right: 14px; }
.sponsor-arrow.right { margin-left: 14px; }


/* ===================== RESPONSIVE ===================== */
@media (max-width: 980px) {
    .search-hero       { padding: 120px 20px 0; }
    .search-hero h1    { font-size: 32px; }
    .results-grid      { padding: 0 20px 40px; gap: 16px; }
    .alt-browse        { padding: 20px 20px 48px; }
    .alt-browse-grid   { grid-template-columns: 1fr; }
    .sponsors          { padding: 0 20px 44px; }
    .pagination        { padding: 10px 20px 40px; }
}

@media (max-width: 640px) {
    .search-hero h1    { font-size: 28px; }
    .results-grid      { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
    .search-bar button { padding: 16px 18px; font-size: 14px; }
}

@media (max-width: 768px) {
    .sponsor-arrow { display: none; }
}

/* Touch devices: no hover preview */
@media (hover: none) {
    .film-card:hover                    { transform: translateY(-2px); }
    .film-card:hover .thumb img.poster-img { transform: none; }
    .film-card .play-overlay            { opacity: 1; background: rgba(0,0,0,0.15); }
}


/* SEO fallback */

.seo-results {
    max-width: 900px;
    margin: 40px auto;
}

.seo-film-list {
    list-style: none;
    padding: 0;
}

    .seo-film-list li {
        margin: 8px 0;
    }

    .seo-film-list a {
        text-decoration: none;
        font-weight: 500;
    }

.catalogue-browse {
    max-width: 1200px;
    margin: 10px auto;
    padding: 45px 50px;
    background: linear-gradient(180deg,#111,#0a0a0a);
    border-radius: 14px;
    border: 1px solid rgba(255,215,0,.15);
    box-shadow: 0 20px 40px rgba(0,0,0,.6);
    position: relative;
    overflow: hidden;
}

    /* subtle gold glow */

    .catalogue-browse:before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 2px;
        background: linear-gradient(90deg,transparent,#d4af37,transparent);
        opacity: .6;
    }

.browse-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 28px;
    font-weight: 600;
    color: #d4af37;
    letter-spacing: .04em;
}

.browse-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(240px,1fr));
    gap: 50px;
}

.browse-group h3 {
    margin-bottom: 14px;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #bfa44a;
}

.browse-group ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.browse-group li {
    margin: 8px 0;
}

.browse-group a {
    text-decoration: none;
    color: #e6e6e6;
    font-size: 15px;
    transition: all .2s ease;
}

    .browse-group a:hover {
        color: #d4af37;
        transform: translateX(3px);
    }

.browse-group {
    padding-right: 20px;
    border-right: 1px solid rgba(255,255,255,.06);
}

    .browse-group:last-child {
        border-right: none;
    }