/**
 * Sports Archive & Single Page Styles
 *
 * Styles for sports archive page, single posts, and all related components
 *
 * @package StreamBox
 * @since 0.1.0
 */

/* ==========================================================================
   Sports Hero Section
   ========================================================================== */
.sports-hero {
    position: relative;
    padding: 80px 0 40px;
    background: linear-gradient(135deg, #0B0B1E 0%, #1B003D 50%, #000814 100%);
    border-bottom: 1px solid rgba(157, 78, 255, 0.3);
}

.sports-hero__container {
    max-width: 100%;
    margin: 0;
    padding: 0 2rem;
}

.sports-hero__content {
    text-align: center;
    margin-bottom: 40px;
}

.sports-hero__title {
    margin: 0 0 16px;
    font-size: 48px;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.sports-hero__description {
    margin: 0;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

/* League Filters */
.sports-hero__filters {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}

.filter-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateY(-2px);
}

.filter-tab.active {
    background: linear-gradient(135deg, #E91EFF 0%, #9D4EFF 100%);
    color: #fff;
    border-color: #E91EFF;
    box-shadow: 0 0 20px rgba(233, 30, 255, 0.4);
}

/* ==========================================================================
   Live Match Strip
   ========================================================================== */
.live-match-strip {
    background: #0B0B1E;
    padding: 24px 0;
    border-bottom: 1px solid rgba(157, 78, 255, 0.2);
}

.live-match-strip__container {
    max-width: 100%;
    margin: 0;
    padding: 0 2rem;
}

.live-match-strip__header {
    margin-bottom: 16px;
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(239, 68, 68, 0.2);
    border-radius: 16px;
    font-size: 12px;
    font-weight: 700;
    color: #ef4444;
    text-transform: uppercase;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.live-match-strip__track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.live-match-skeleton {
    display: flex;
    gap: 16px;
}

.skeleton-match {
    min-width: 300px;
    height: 80px;
    background: linear-gradient(90deg, #1a1a2e 25%, #2a2a3e 50%, #1a1a2e 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

/* ==========================================================================
   Featured Player
   ========================================================================== */
.sports-featured-player {
    padding: 60px 0;
    background: #0B0B1E;
}

.sports-featured-player__container {
    max-width: 100%;
    margin: 0;
    padding: 0 2rem;
}

.player-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: start;
}

.player-container {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.player-container[data-aspect="16:9"] {
    aspect-ratio: 16 / 9;
}

.player-iframe-wrapper {
    position: absolute;
    inset: 0;
}

.player-iframe-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.player-skeleton {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #0B0B1E 25%, #1B003D 50%, #0B0B1E 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

.player-info {
    padding: 24px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.player-info__league {
    display: inline-block;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    border-radius: 6px;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.player-info__title {
    margin: 0 0 12px;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}

.player-info__meta {
    margin: 0 0 20px;
    font-size: 14px;
    color: #9ca3af;
}

.player-info__meta .score {
    color: #fff;
}

.player-info__meta .separator {
    margin: 0 8px;
    opacity: 0.5;
}

.player-info__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #ec4899;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.player-info__link:hover {
    background: #db2777;
    transform: translateY(-2px);
}

/* ==========================================================================
   Sports Grid
   ========================================================================== */
.sports-grid {
    padding: 60px 0;
    background: #0B0B1E;
}

.sports-grid__container {
    max-width: 100%;
    margin: 0;
    padding: 0 2rem;
}

.sports-grid__items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 60px;
}

/* Sports Card */
.sports-card {
    background: rgba(27, 0, 61, 0.4);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(157, 78, 255, 0.2);
}

.sports-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4), 0 0 40px rgba(157, 78, 255, 0.3);
    border-color: rgba(233, 30, 255, 0.4);
}

.sports-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.sports-card__image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #1B003D;
}

.sports-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

.sports-card:hover .sports-card__img {
    transform: scale(1.05);
}

.sports-card__play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sports-card:hover .sports-card__play-overlay {
    opacity: 1;
}

.sports-card__league-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    border-radius: 4px;
    text-transform: uppercase;
}

.sports-card__content {
    padding: 20px;
}

.sports-card__title {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.sports-card__score {
    margin-bottom: 12px;
}

.score-display {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(34, 197, 94, 0.2);
    border-radius: 6px;
    font-weight: 700;
    color: #22c55e;
}

.sports-card__excerpt {
    margin-bottom: 16px;
    font-size: 14px;
    color: #9ca3af;
    line-height: 1.6;
}

.sports-card__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #6b7280;
}

.sports-card__duration {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Empty State */
.sports-grid__empty {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    color: #6b7280;
}

.sports-grid__empty h2 {
    margin: 0 0 12px;
    font-size: 24px;
    color: #fff;
}

.sports-grid__empty p {
    margin: 0;
    font-size: 16px;
    color: #9ca3af;
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.sports-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.sports-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.sports-pagination .page-numbers:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sports-pagination .page-numbers.current {
    background: #ec4899;
    border-color: #ec4899;
}

/* ==========================================================================
   Single Sports Article
   ========================================================================== */
.single-sports {
    background: #0a0a0f;
}

.sports-article__header {
    padding: 60px 0 40px;
    background: linear-gradient(135deg, #16213e 0%, #0f3460 100%);
    text-align: center;
}

.sports-article__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

.sports-article__league {
    display: inline-block;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    border-radius: 6px;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.sports-article__title {
    margin: 0 0 24px;
    font-size: 48px;
    font-weight: 900;
    color: #fff;
    line-height: 1.2;
}

.sports-article__score {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
}

.score-large {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
}

.score-large strong {
    display: inline-block;
    margin: 0 8px;
    font-size: 48px;
    color: #22c55e;
}

.score-separator {
    font-size: 32px;
    color: rgba(255, 255, 255, 0.3);
}

.sports-article__meta {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.meta-separator {
    margin: 0 12px;
}

.sports-article__player {
    padding: 60px 0;
    background: #000;
}

.sports-article__featured-image {
    padding: 60px 0;
}

.sports-article__img {
    width: 100%;
    height: auto;
    border-radius: 12px;
}

.sports-article__content {
    padding: 60px 0;
}

.sports-article__body {
    margin-bottom: 40px;
    font-size: 18px;
    line-height: 1.8;
    color: #d1d5db;
}

.sports-article__body p {
    margin-bottom: 24px;
}

.sports-article__external-link {
    margin-bottom: 40px;
}

.btn-external {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: #ec4899;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-external:hover {
    background: #db2777;
    transform: translateY(-2px);
}

.sports-article__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tags-label {
    font-weight: 600;
    color: #9ca3af;
}

.tag-link {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 13px;
    color: #d1d5db;
    text-decoration: none;
    transition: all 0.2s ease;
}

.tag-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Related Content */
.sports-article__related {
    padding: 60px 0;
    background: #0f0f1e;
}

.related-title {
    margin: 0 0 32px;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
}

.related-card {
    background: #1a1a2e;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.related-card:hover {
    transform: translateY(-4px);
}

.related-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.related-card__image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.related-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-card__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
}

.related-card__title {
    margin: 0;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    line-height: 1.4;
}

.related-card time {
    display: block;
    padding: 0 16px 16px;
    font-size: 13px;
    color: #9ca3af;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
    .sports-hero__title {
        font-size: 36px;
    }

    .player-wrapper {
        grid-template-columns: 1fr;
    }

    .sports-grid__items {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }

    .sports-article__title {
        font-size: 36px;
    }

    .score-large {
        font-size: 24px;
    }

    .score-large strong {
        font-size: 36px;
    }
}

@media (max-width: 768px) {
    .sports-hero {
        padding: 60px 0 30px;
    }

    .sports-hero__container,
    .sports-featured-player__container,
    .sports-grid__container,
    .sports-article__container {
        padding: 0 24px;
    }

    .sports-hero__title {
        font-size: 28px;
    }

    .sports-hero__description {
        font-size: 16px;
    }

    .filter-tab {
        padding: 10px 16px;
        font-size: 13px;
    }

    .sports-grid__items {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }

    .sports-article__title {
        font-size: 28px;
    }

    .sports-article__body {
        font-size: 16px;
    }

    .related-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 640px) {
    .sports-hero__title {
        font-size: 24px;
    }
    
    .sports-grid__items {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 14px;
    }
    
    .related-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

@media (max-width: 480px) {
    .sports-hero__title {
        font-size: 22px;
    }

    .sports-grid__items,
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .sports-article__score {
        flex-direction: column;
        gap: 16px;
    }

    .score-large {
        font-size: 20px;
    }

    .score-large strong {
        font-size: 28px;
    }
}

/* ==========================================================================
   SportsRC Custom Player
   ========================================================================== */
.sportsrc-player {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
}

.sportsrc-player__poster {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: brightness(0.6);
}

.sportsrc-player__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    transition: background 0.3s ease;
}

.sportsrc-player:hover .sportsrc-player__overlay {
    background: rgba(0, 0, 0, 0.5);
}

.sportsrc-player__button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: white;
    transition: transform 0.3s ease;
}

.sportsrc-player__button:hover {
    transform: scale(1.1);
}

.sportsrc-player__button svg {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
    transition: filter 0.3s ease;
}

.sportsrc-player__button:hover svg {
    filter: drop-shadow(0 6px 20px rgba(255, 255, 255, 0.3));
}

.sportsrc-player__button span {
    font-size: 18px;
    font-weight: 600;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    letter-spacing: 0.5px;
}

/* ==========================================================================
   Sports HLS Player Styles
   ========================================================================== */

.sports-player-wrapper {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.sports-player-wrapper .player-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #0a0a0a;
}

.sports-player-wrapper .player-container[data-aspect="16:9"] {
    padding-bottom: 56.25%;
}

.sports-player-wrapper .player-container[data-aspect="4:3"] {
    padding-bottom: 75%;
}

.sports-player-wrapper .player-container[data-aspect="21:9"] {
    padding-bottom: 42.86%;
}

.sports-video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.sports-video-player:focus {
    outline: 2px solid #E91EFF;
    outline-offset: 2px;
}

/* Player loading state */
.sports-player-wrapper .player-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10;
}

.sports-player-wrapper .loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #E91EFF;
    border-radius: 50%;
    animation: sports-player-spin 0.8s linear infinite;
}

@keyframes sports-player-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Player error state */
.sports-player-error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 12px;
    color: #ff6b6b;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    padding: 2rem;
}

/* Iframe wrapper */
.sports-player-wrapper .player-iframe-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.sports-player-wrapper .player-iframe-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Custom video controls overlay */
.sports-player-wrapper .custom-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 20px 15px 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sports-player-wrapper:hover .custom-controls {
    opacity: 1;
}

/* Quality selector */
.sports-player-quality {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 20;
}

.sports-player-quality select {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 0.8rem;
    cursor: pointer;
}

.sports-player-quality select:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: #E91EFF;
}

/* Mobile responsive */
@media (max-width: 767px) {
    .sports-player-wrapper {
        border-radius: 8px;
    }
    
    .sports-player-wrapper .loading-spinner {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }
    
    .sports-player-error {
        min-height: 150px;
        font-size: 0.9rem;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .sports-card,
    .filter-tab,
    .related-card {
        transition: none;
    }
    
    .sports-player-wrapper .loading-spinner {
        animation: none;
    }
}
