/* ========================================
   Highlights Slider Component
   Used by: home.php, tv_home.php
   Loaded only on pages with featured content slider
   ======================================== */

/* ========== HIGHLIGHTS SLIDER (Base) ========== */
.highlights-section {
    padding: 20px 0 30px;
}

.highlights-slider {
    position: relative;
    display: flex;
    gap: 20px;
    overflow: hidden;
}

/* Bottom shadow - blend with background */
.highlights-slider::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom,
            transparent 0%,
            rgba(24, 24, 27, 0.6) 40%,
            rgba(24, 24, 27, 0.95) 100%);
    pointer-events: none;
    z-index: 5;
}

.highlight-card {
    flex: 0 0 calc(50% - 10px);
    min-height: 285px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: var(--bg-card);
    cursor: pointer;
    /* Slide animation */
    transition: transform 0.5s ease-out, opacity 0.5s ease, box-shadow 0.5s ease-out;
    animation: fadeSlideIn 0.5s ease;
}

.highlight-card:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.highlight-card:hover .btn-watch {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(220, 38, 38, 0.8), 0 0 0 2px rgba(255, 255, 255, 0.25);
}

/* Invisible overlay link for entire card clickability */
.card-link-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.highlight-card .backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.85;
}

.highlight-card .gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            rgba(24, 24, 27, 0.95) 0%,
            rgba(24, 24, 27, 0.6) 50%,
            rgba(24, 24, 27, 0.2) 100%);
}

.highlight-content {
    position: relative;
    z-index: 2;
    padding: 30px 30px 30px 50px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
}

.highlight-top {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.highlight-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 15px;
    line-height: 1.2;
    color: #ffffff;
}

.highlight-meta {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
    font-size: 13px;
}

.highlight-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 10px;
    border-radius: 4px;
    color: #ffffff;
    font-weight: 600;
}

.imdb-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    letter-spacing: 0.3px;
}

.highlight-genres {
    color: #ffffff;
    font-weight: 700;
}

.highlight-genres span {
    color: #ffffff;
    font-weight: 400;
}

.highlight-genres .genre-link {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

.highlight-genres .genre-link:hover {
    color: var(--accent-color, #dc2626);
    text-decoration: underline;
}

.highlight-duration {
    color: #ffffff;
    font-weight: 700;
    white-space: nowrap;
}

.highlight-duration span {
    font-weight: 400;
}

.highlight-desc {
    font-size: 14px;
    color: #ffffff;
    font-weight: 400;
    line-height: 1.6;
    margin-top: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: calc(100% - 60px);
}

.highlight-actions {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

.btn-watch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.6), 0 0 0 2px rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-watch:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(220, 38, 38, 0.8), 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.btn-watch svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.slider-nav:hover {
    background: rgba(0, 0, 0, 0.8);
}

.slider-nav svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.slider-prev {
    left: 10px;
}

.slider-next {
    right: 10px;
}

/* Hidden slide utility */
.highlight-card.hidden-slide {
    display: none;
}

/* ========================================
   Slider Responsive Overrides
   ======================================== */

/* Desktop / Small Desktop */
@media (max-width: 1200px) {
    .highlights-slider {
        gap: 16px;
    }

    .highlight-card {
        flex: 0 0 calc(50% - 8px);
    }
}

/* iPad Pro / Large Tablet */
@media (max-width: 1024px) {
    .highlight-card {
        flex: 0 0 100%;
    }

    .slider-nav {
        display: flex;
    }
}

/* Small Tablet / Large Phone */
@media (max-width: 768px) {
    .highlight-card {
        border-radius: 12px;
        min-height: 280px;
    }

    .highlight-content {
        padding: 16px 16px 16px 40px;
    }

    .highlight-title {
        font-size: 18px;
        margin-bottom: 8px;
    }

    /* Stack meta vertically on mobile for better fit */
    .highlight-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        font-size: 11px;
    }

    .highlight-rating {
        padding: 3px 8px;
    }

    /* Show summary on mobile - 2 lines */
    .highlight-desc {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        font-size: 12px;
        margin-top: 10px;
        max-width: calc(100% - 50px);
    }

    .highlight-actions {
        justify-content: flex-end;
    }

    .btn-watch {
        padding: 10px 20px;
        font-size: 13px;
        width: auto;
        background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
        box-shadow: 0 4px 18px rgba(220, 38, 38, 0.7), 0 0 0 2px rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.3);
    }

    /* Slider nav */
    .slider-nav {
        width: 28px;
        height: 28px;
        background: rgba(0, 0, 0, 0.7);
    }

    .slider-prev {
        left: 5px;
    }

    .slider-next {
        right: 5px;
    }
}

/* Mobile - 576px and below */
@media (max-width: 576px) {
    .highlights-section {
        padding: 10px 0 16px;
    }

    .highlight-card {
        border-radius: 10px;
        min-height: 260px;
    }

    .highlight-content {
        padding: 14px 14px 14px 36px;
    }

    .highlight-title {
        font-size: 16px;
        margin-bottom: 6px;
    }

    .highlight-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
        font-size: 10px;
    }

    .highlight-rating {
        padding: 2px 6px;
        font-size: 10px;
    }

    .highlight-genres,
    .highlight-duration {
        font-size: 10px;
    }

    /* Show summary on mobile - 2 lines */
    .highlight-desc {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        font-size: 11px;
        margin-top: 8px;
        max-width: calc(100% - 40px);
    }

    /* Watch Now button - position right */
    .highlight-actions {
        justify-content: flex-end;
    }

    .btn-watch {
        width: auto;
        padding: 10px 18px;
        font-size: 12px;
        max-width: none;
        background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
        box-shadow: 0 4px 18px rgba(220, 38, 38, 0.7), 0 0 0 2px rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.3);
    }

    /* Hide slider arrows on very small screens or make smaller */
    .slider-nav {
        width: 28px;
        height: 28px;
    }

    .slider-prev {
        left: 3px;
    }

    .slider-next {
        right: 3px;
    }
}

/* Very Small Mobile */
@media (max-width: 400px) {
    .highlight-info h2 {
        font-size: 14px;
    }
}