/* Homepage Hero Section */
.as-hero {
    padding: var(--as-spacing-md) 0;
}

.as-hero-container {
    max-width: 1320px;
    /* Reduced to allow wider banners on 1920px screens */
    margin: 0 auto;
    padding: 0 var(--as-spacing-md);
    display: grid;
    /* Responsive grid: Main Content | Sidebar */
    grid-template-columns: 1fr 380px;
    gap: var(--as-spacing-md);
    align-items: start;
}

/* Sidebar Banners (Absolute - Not Sticky) */
.as-side-banner {
    position: absolute;
    top: 130px;
    /* Adjusted for header height */
    width: 220px;
    /* Widened from 160px */
    z-index: 90;
}

.as-side-banner img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--as-radius-lg);
    box-shadow: var(--as-shadow);
}

.as-side-banner-left {
    left: 20px;
}

.as-side-banner-right {
    right: 20px;
}

/* Responsive Logic for Banners */
/*
   Calculation: 1320px (content) + 2 * (220px banner + 20px margin) = ~1800px
   Fit comfortably on 1920px (Full HD)
   Hide on screens narrower than 1700px to avoid overlap/crowding
*/
@media (min-width: 1500px) {
    .as-side-banner {
        z-index: -1;
    }
}

@media (max-width: 1500px) {
    .as-side-banner {
        display: none;
    }
}

.as-sidebar-left,
.as-sidebar-right {
    display: block;
}

/* Main Content Area */
.as-hero-main {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    gap: var(--as-spacing-md);
    min-width: 0;
    /* Prevent flex item from overflowing */
}

.as-sidebar-matches {
    grid-column: 2 !important;
    /* Override style.css which sets it to 3 */
}

/* Top/Bottom Banners */
.as-top-banner,
.as-bottom-banner {
    width: 100%;
    border-radius: var(--as-radius-lg);
    overflow: hidden;
    box-shadow: var(--as-shadow);
}

.as-top-banner .as-banner-img,
.as-bottom-banner .as-banner-img {
    width: 100%;
    height: auto;
    display: block;
}

/* Video Player Container */
.as-player-container {
    background: var(--as-bg-secondary);
    border: 1px solid var(--as-border);
    border-radius: var(--as-radius-lg);
    overflow: hidden;
    box-shadow: var(--as-shadow-lg);
    width: 100%;
}

.as-player-wrapper {
    position: relative;
    width: 100%;
    /* padding-bottom removed to prevent double aspect ratio when using player-main.php */
    background: #000;
}

.as-video-player {
    /* Legacy styles for simple video tag, keeping for backward compat if needed */
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.as-player-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: var(--as-spacing-sm);
    color: var(--as-text-secondary);
    pointer-events: none;
    transition: var(--as-transition);
}

.as-player-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.as-player-message {
    text-align: center;
}

.as-player-message svg {
    margin-bottom: var(--as-spacing-sm);
    opacity: 0.5;
}

.as-player-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--as-spacing-sm);
    color: white;
}

.as-player-loading p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--as-text-secondary);
}

/* Player Info Bar */
.as-player-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--as-spacing-md);
    background: var(--as-bg-tertiary);
    border-top: 1px solid var(--as-border);
    flex-wrap: wrap;
    /* Allow wrapping on small screens */
    gap: 10px;
}

.as-player-match-title {
    display: flex;
    align-items: center;
    gap: var(--as-spacing-sm);
}

.as-player-match-title h2 {
    font-size: 1.125rem;
    margin: 0;
}

.as-player-viewers {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--as-text-secondary);
    font-size: 0.9rem;
}

/* Right Sidebar - Match List */
.as-sidebar-matches {
    background: var(--as-bg-secondary);
    border: 1px solid var(--as-border);
    border-radius: var(--as-radius-lg);
    overflow: hidden;
    top: 90px;
    max-height: calc(100vh - 110px);
    display: flex;
    flex-direction: column;
}

/* Match Tabs */
.as-match-tabs {
    display: flex;
    border-bottom: 1px solid var(--as-border);
    background: var(--as-bg-tertiary);
}

.as-tab-btn {
    flex: 1;
    padding: var(--as-spacing-sm);
    background: transparent;
    border: none;
    color: var(--as-text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--as-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-bottom: 2px solid transparent;
}

.as-tab-btn:hover {
    color: var(--as-text-primary);
    background: var(--as-bg-hover);
}

.as-tab-btn.active {
    color: var(--as-primary);
    border-bottom-color: var(--as-primary);
}

.as-tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
}

.as-tab-content.active {
    display: block;
}

.as-matches-list {
    display: flex;
    flex-direction: column;
}

/* Channel List (Sidebar) */
.as-channel-list {
    display: flex;
    flex-direction: column;
}

.as-channel-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--as-border);
    cursor: pointer;
    transition: var(--as-transition);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.as-channel-item:hover {
    background: var(--as-bg-hover);
}

.as-channel-item.active {
    background: var(--as-bg-card);
    border-left: 3px solid var(--as-primary);
    padding-left: calc(1rem - 3px);
}

.as-channel-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    background: white;
    border-radius: 4px;
    padding: 2px;
    flex-shrink: 0;
}

.as-channel-logo-placeholder {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--as-text-muted);
}

.as-channel-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.as-channel-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--as-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.as-channel-status {
    font-size: 0.7rem;
    color: var(--as-live);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.as-channel-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--as-live);
    animation: pulse 1.5s infinite;
}

/* Match Item (Sidebar) */
.as-match-item {
    padding: 0.75rem 0.75rem;
    border-bottom: 1px solid var(--as-border);
    cursor: pointer;
    transition: var(--as-transition);
    position: relative;
    display: flex;
    /* Changed from grid to flex for better control */
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
}

.as-match-item:hover {
    background: var(--as-bg-hover);
}

.as-match-item.is-live {
    background: linear-gradient(to right, rgba(239, 68, 68, 0.08), transparent);
    border-left: 2px solid var(--as-live);
    padding-left: calc(0.75rem - 2px);
}

.as-match-item.active {
    background: var(--as-bg-card);
    border-left: 3px solid var(--as-primary);
    padding-left: calc(0.75rem - 3px);
}

/* Main Content Column (League & Teams) */
.as-match-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    /* Reduced gap */
    min-width: 0;
    flex: 1;
    /* Take available space */
}

/* Meta Row: Live Status + League */
.as-match-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.65rem;
    line-height: 1;
    margin-bottom: 2px;
    height: 14px;
    /* Fixed height for consistency */
}

.as-live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-weight: 700;
    font-size: 0.55rem;
    color: white;
    background: var(--as-live);
    padding: 1px 4px;
    border-radius: 2px;
    line-height: 1;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.as-live-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: white;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.as-match-league {
    color: var(--as-text-muted);
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    font-size: 0.6rem;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

/* Teams Column */
.as-match-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.as-team {
    display: flex;
    align-items: center;
    flex: 1;
    overflow: hidden;
    height: 24px;
}

.as-team-home {
    justify-content: flex-end;
    text-align: right;
}

.as-team-away {
    justify-content: flex-start;
    text-align: left;
    flex-direction: row-reverse;
}

.as-team-home .as-team-logo,
.as-team-home .as-team-logo-placeholder {
    margin-left: 6px;
    margin-right: 0;
    order: 2;
    /* Logo after name */
}

.as-team-away .as-team-logo,
.as-team-away .as-team-logo-placeholder {
    margin-right: 6px;
    margin-left: 0;
    order: 1;
    /* Logo before name */
}

.as-team-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--as-text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.as-match-time-display {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--as-text-muted);
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    min-width: 40px;
    text-align: center;
}

.as-live-badge-mini {
    color: #e11d48;
    /* Red for live */
    font-weight: 800;
    font-size: 0.75rem;
    animation: pulse 2s infinite;
}

.as-team img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

.as-team-logo-placeholder {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

/* Add margin right to placeholder */
}

.as-team-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--as-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    /* Ensure text aligns left */
    flex: 1;
    /* Allow name to take available space */
}

.as-score {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--as-primary);
    /* Highlight score */
    margin-left: 8px;
    min-width: 16px;
    text-align: right;
}

/* Action/Time Column (Right Side) */
.as-match-action {
    margin-left: 8px;
    flex-shrink: 0;
}

.as-match-time {
    font-size: 0.75rem;
    color: var(--as-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 600;
    background: var(--as-bg-tertiary);
    padding: 3px 6px;
    border-radius: 4px;
    white-space: nowrap;
    min-width: 40px;
}

.as-btn-watch {
    padding: 4px 8px;
    /* Compact padding */
    background: var(--as-primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 3px;
    transition: var(--as-transition);
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    min-width: 55px;
}

.as-match-item:hover .as-btn-watch {
    background: var(--as-accent);
    transform: translateY(-1px);
}

/* Empty State */
.as-empty-state {
    padding: var(--as-spacing-xl);
    text-align: center;
    color: var(--as-text-muted);
}

.as-empty-state svg {
    margin-bottom: var(--as-spacing-sm);
    opacity: 0.3;
}

.as-empty-state p {
    margin: 0;
    font-size: 0.9rem;
}

/* ================================
   Leagues Section
   ================================ */
.as-leagues-section {
    background: var(--as-bg-secondary);
    border-top: 1px solid var(--as-border);
    border-bottom: 1px solid var(--as-border);
}

.as-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--as-spacing-lg);
}

.as-section-header h2 {
    margin: 0;
    font-size: 1.75rem;
}

.as-leagues-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--as-spacing-md);
}

.as-league-card {
    background: var(--as-bg-card);
    border: 1px solid var(--as-border);
    border-radius: var(--as-radius-lg);
    padding: var(--as-spacing-lg);
    text-align: center;
    transition: var(--as-transition);
    text-decoration: none;
    color: inherit;
}

.as-league-card:hover {
    background: var(--as-bg-hover);
    transform: translateY(-4px);
    box-shadow: var(--as-shadow-lg);
    border-color: var(--as-primary);
}

.as-league-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--as-spacing-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--as-primary) 0%, var(--as-accent) 100%);
    border-radius: 50%;
    color: white;
}

.as-league-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.as-league-card p {
    margin: 0;
    color: var(--as-text-secondary);
    font-size: 0.875rem;
}

/* ================================
   Matches Grid
   ================================ */
.as-filter-tabs {
    display: flex;
    gap: var(--as-spacing-xs);
}

.as-filter-btn {
    padding: 0.5rem 1rem;
    background: var(--as-bg-card);
    border: 1px solid var(--as-border);
    border-radius: var(--as-radius-sm);
    color: var(--as-text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--as-transition);
}

.as-filter-btn:hover {
    color: var(--as-text-primary);
    border-color: var(--as-primary);
}

.as-filter-btn.active {
    background: linear-gradient(135deg, var(--as-primary) 0%, var(--as-accent) 100%);
    color: white;
    border-color: transparent;
}

.as-matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--as-spacing-md);
    margin-top: var(--as-spacing-lg);
}

/* Match Card (Grid) */
/* ... existing card styles ... */

/* ================================
   Responsive Adjustments
   ================================ */

/* Tablet & Mobile Grid Fixes */
@media (max-width: 1200px) {
    .as-hero-container {
        grid-template-columns: 1fr;
        /* Stack columns */
        gap: var(--as-spacing-lg);
    }

    .as-sidebar-matches {
        grid-column: 1 !important;
        /* Reset grid column */
        position: relative;
        /* Remove sticky on mobile if needed, or keep top */
        top: 0;
        max-height: none;
        overflow-y: visible;
        width: 100%;
        max-width: none;
    }

    .as-sidebar-matches .as-matches-list,
    .as-sidebar-matches .as-channel-list {
        max-height: 500px;
        overflow-y: auto;
    }
}

/* Mobile Specific Fixes */
@media (max-width: 768px) {
    .as-hero {
        padding: var(--as-spacing-sm) 0;
    }

    .as-hero-container {
        padding: 0;
        gap: var(--as-spacing-md);
        display: flex;
        flex-direction: column;
    }

    .as-hero-main {
        width: 100%;
    }

    .as-player-container {
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }

    /* Player aspect ratio fix for mobile */
    .as-player-wrapper {
        min-height: 200px;
    }

    .as-player-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .as-player-viewers {
        font-size: 0.8rem;
    }

    /* Matches Grid Mobile */
    .as-matches-grid {
        grid-template-columns: 1fr;
    }

    /* Mobile Navigation Styling (triggered by JS) */
    .as-header-nav {
        position: fixed;
        top: 70px;
        /* Below header */
        left: 0;
        right: 0;
        background: var(--as-bg-secondary);
        border-bottom: 1px solid var(--as-border);
        padding: 1rem;
        z-index: 1000;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .as-header-nav.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    }

    .as-nav-menu {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .as-nav-menu li {
        width: 100%;
        text-align: center;
    }

    .as-nav-menu a {
        display: block;
        padding: 0.8rem;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 8px;
    }

    /* Header Mobile Adjustments */
    .as-header-actions .as-btn {
        display: none;
        /* Hide 'Canlı Yayınlar' button on small mobile if tight, or keep icon only */
    }

    .as-search-toggle {
        display: flex;
        /* Ensure search is visible */
    }
}

/* Modern Player Start Overlay */
.kf-start-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    /* Lightweight overlay over poster */
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    cursor: pointer;
}

.kf-start-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.kf-big-play-btn {
    background: rgba(37, 99, 235, 0.9);
    border: none;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.6);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.2s;
    cursor: pointer;
    margin-bottom: 1rem;
}

.kf-big-play-btn svg {
    margin-left: 6px;
    /* Optical center adjustment */
}

.kf-start-overlay:hover .kf-big-play-btn {
    transform: scale(1.1);
    background: #2563eb;
}

.kf-start-text {
    color: white;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

/* Modern Controls Overrides */
.kf-player-controls {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 100%);
    padding-bottom: 15px;
    padding-top: 40px;
    /* Move up slightly to look like floating on video */
}

.kf-control-btn {
    background: transparent;
    border-radius: 8px;
    transition: background 0.2s;
}

.kf-control-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.kf-progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    transition: height 0.2s;
}

.kf-progress-bar:hover {
    height: 6px;
}

.kf-progress-fill {
    background: var(--as-primary);
    box-shadow: 0 0 10px var(--as-primary);
}