/* ============================================
   HIGHLIGHTS PAGE STYLES
   ============================================ */

/* Ensure page is scrollable and visible */
.page-highlights {
    min-height: 100vh;
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

/* Video elements within cards respect container */
.page-highlights .video-card video,
.page-highlights .video-card iframe,
.page-highlights .video-card video-js {
    max-width: 100%;
    max-height: 100%;
}

/* Allow fullscreen in modals */
.video-modal video,
.video-modal iframe,
.video-modal video-js {
    max-width: 100% !important;
    max-height: 100% !important;
}

.highlights-page-header {
    background: var(--brand-navy-900);
    color: var(--neutral-white);
    padding: var(--space-6) var(--space-6) var(--space-5);
    position: relative;
    z-index: 1;
}

.highlights-header-content {
    max-width: var(--container-2xl);
    margin: 0 auto;
}

.highlights-page-header h1 {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-black);
    line-height: var(--line-height-tight);
    margin: 0 0 var(--space-2) 0;
}

.season-subtitle {
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    opacity: 0.9;
    margin: 0;
}

#highlights-container {
    max-width: var(--container-2xl);
    margin: 0 auto;
    padding: var(--space-6) var(--space-6) var(--space-12);
    position: relative;
    z-index: 1;
}

/* ============================================
   FILTER BUTTONS
   ============================================ */

.highlights-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    border-color: #d1d5db;
    color: #374151;
    background: #f9fafb;
}

.filter-btn.active {
    background: #041E42;
    border-color: #041E42;
    color: #ffffff;
}

.filter-btn.active .filter-count {
    background: rgba(255, 184, 28, 0.2);
    color: #FFB81C;
}

.filter-count {
    background: #f3f4f6;
    color: #6b7280;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

.no-videos-message {
    text-align: center;
    padding: 60px 20px;
    background: #ffffff;
    border-radius: 12px;
    color: #6b7280;
}

.no-videos-message p {
    margin: 0;
    font-size: 16px;
}

/* ============================================
   CATEGORY SECTIONS
   ============================================ */

.highlights-category {
    margin-bottom: var(--space-12);
    width: 100%;
}

/* Category header button */
.category-header {
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    margin-bottom: var(--space-4);
}

.category-header:hover .category-title {
    color: var(--brand-gold-900);
}

.category-toggle-icon {
    font-size: 14px;
    color: #6b7280;
    transition: transform 0.2s ease;
    padding: 8px;
}

.category-header[aria-expanded="false"] .category-toggle-icon {
    transform: rotate(-90deg);
}

.category-title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--neutral-900);
    margin: 0;
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--brand-gold-900);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex: 1;
    transition: color 0.2s ease;
}

/* Collapsed state */
.videos-grid.collapsed {
    display: none;
}

.category-icon {
    font-size: var(--font-size-2xl);
}

.category-count {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-snug);
    color: var(--neutral-700);
    background: var(--neutral-100);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    margin-left: auto;
}

/* ============================================
   VIDEO GRID - Responsive Grid Layout
   ============================================ */

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
}

/* Tablet: 2 columns */
@media (max-width: 900px) {
    .videos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

/* Mobile: 1 column */
@media (max-width: 600px) {
    .videos-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

.page-highlights .video-card,
.highlights-category .video-card,
.videos-grid .video-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
}

.video-card:hover .video-thumbnail {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* ============================================
   VIDEO THUMBNAIL
   ============================================ */

.page-highlights .video-thumbnail,
.highlights-category .video-thumbnail,
.videos-grid .video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    background: #000;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    transition: all 0.3s ease;
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-duration {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.9;
    transition: all 0.3s ease;
    z-index: 2;
}

.play-button:hover {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.play-button svg {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

/* ============================================
   VIDEO INFO
   ============================================ */

.video-info {
    padding: 14px;
    background: #ffffff;
}

.video-title {
    font-size: 14px;
    font-weight: 600;
    color: #48494A;
    margin: 0 0 6px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-description {
    font-size: 12px;
    color: #6b7280;
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    font-size: 12px;
    color: #9ca3af;
    margin: 0;
    display: block;
}

.video-date {
    font-size: 12px;
    color: #9ca3af;
}

/* ============================================
   VIDEO MODAL
   ============================================ */

.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.video-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
}

.video-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    z-index: 10001;
}

.video-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 184, 28, 0.9);
    border: none;
    color: #041E42;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    padding: 8px;
    width: 48px;
    height: 48px;
    line-height: 1;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 10002;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.video-modal-close:hover {
    transform: scale(1.1);
    background: rgba(255, 184, 28, 1);
}

/* Video player wrapper - ONLY inside modal */
.video-modal .video-player-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: #000;
}

.video-modal .video-player-wrapper video-js {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 968px) {
    .highlights-page-header h1 {
        font-size: 28px;
    }

    .category-title {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .highlights-page-header {
        padding: 20px 16px;
    }

    .highlights-page-header h1 {
        font-size: 24px;
    }

    .season-subtitle {
        font-size: 14px;
    }

    #highlights-container {
        padding: 20px 16px 60px;
    }

    .highlights-filters {
        gap: 8px;
        margin-bottom: 20px;
    }

    .filter-btn {
        padding: 8px 12px;
        font-size: 12px;
        flex: 1 1 calc(50% - 4px);
        justify-content: center;
    }

    .filter-count {
        font-size: 11px;
        padding: 1px 6px;
    }

    .category-title {
        font-size: 18px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .category-count {
        margin-left: 0;
    }

    .video-info {
        padding: 12px;
    }

    .video-title {
        font-size: 13px;
        line-height: 1.35;
    }

    .video-description {
        font-size: 11px;
    }

    .video-duration {
        font-size: 10px;
        padding: 2px 6px;
    }

    .video-meta,
    .video-date {
        font-size: 11px;
    }

    .play-button svg {
        width: 48px;
        height: 48px;
    }

    .video-modal-content {
        width: 95%;
        margin-top: 60px;
    }

    .video-modal-close {
        top: 10px;
        right: 10px;
        position: fixed;
        width: 44px;
        height: 44px;
        font-size: 28px;
    }
}
