@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg-primary: #07090e;
    --bg-secondary: #0c0f17;
    --bg-card: rgba(12, 16, 27, 0.7);
    --bg-card-hover: rgba(20, 27, 45, 0.85);
    --border-color: rgba(255, 255, 255, 0.05);
    --border-color-active: rgba(0, 255, 136, 0.4);
    
    --accent-gold: #00ff88; /* Electric sports green/teal */
    --accent-gold-rgb: 0, 255, 136;
    --accent-green: #00ff88;
    --accent-green-rgb: 0, 255, 136;
    --accent-purple: #3b82f6; /* Premium sports blue */
    --accent-purple-rgb: 59, 130, 246;
    --accent-red: #ef4444;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #4b5563;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --glass-blur: blur(16px);
    --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --glow-shadow: 0 0 25px rgba(0, 255, 136, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

/* Custom Scrollbars */
*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
*::-webkit-scrollbar-track {
    background: transparent;
}
*::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}
*::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gold);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.06) 0%, transparent 45%),
        radial-gradient(circle at 90% 80%, rgba(0, 255, 136, 0.06) 0%, transparent 45%);
    background-attachment: fixed;
}

/* Layout Container */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
header {
    background: rgba(12, 15, 24, 0.85);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    padding: 0.85rem 1.5rem;
    display: flex;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1350px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-purple));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
    font-weight: 800;
    font-size: 1.25rem;
    font-family: var(--font-heading);
    color: #07090e;
    transition: var(--transition-smooth);
}

.logo-container:hover .logo-icon {
    transform: rotate(5deg) scale(1.05);
    box-shadow: 0 0 25px rgba(0, 255, 136, 0.4);
}

.logo-text h1 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, var(--text-primary), var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text span {
    font-size: 0.75rem;
    color: var(--accent-green);
    font-weight: 600;
    letter-spacing: 1px;
    display: block;
    margin-top: -2px;
    text-transform: uppercase;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--accent-red);
}

.live-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-red);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

.add-channel-btn {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(139, 92, 246, 0.2));
    border: 1px solid var(--border-color-active);
    color: var(--text-primary);
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-smooth);
}

.add-channel-btn:hover {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-purple));
    color: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

/* Main Layout - Two Columns (Centered & Compact) */
.main-content {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1.5rem;
    padding: 1.5rem;
    flex: 1;
    max-width: 1350px;
    margin: 0 auto;
    width: 100%;
}

.channels-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    height: calc(100vh - 120px);
    position: sticky;
    top: 90px;
    overflow-y: auto;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.channels-sidebar::-webkit-scrollbar {
    width: 4px;
}

.channels-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}

.category-section {
    margin-bottom: 0.5rem;
}

.channels-sidebar .category-title {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.4rem;
}

.channels-sidebar .category-title.liga1 {
    color: var(--accent-gold);
}

.channels-sidebar .category-title.libertadores {
    color: var(--accent-purple);
}

.channels-sidebar .category-title.sudamericana {
    color: var(--accent-green);
}

.channels-sidebar .category-title.europeas {
    color: #ef4444;
}

.channels-sidebar .category-title.voley {
    color: #3b82f6;
}

.channels-sidebar .category-title.femenino {
    color: #ffbc00;
}

/* Sidebar Search Bar Styles */
.sidebar-search-container {
    margin-bottom: 1rem;
    position: relative;
    width: 100%;
}

.sidebar-search-input {
    width: 100%;
    padding: 0.65rem 2.25rem 0.65rem 0.85rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-family: var(--font-body);
    outline: none;
    transition: var(--transition-smooth);
}

.sidebar-search-input:focus {
    border-color: var(--accent-gold);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.1);
}

.sidebar-search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    pointer-events: none;
}

/* Competitions Pill Menu Styles */
.competitions-menu {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding-bottom: 0.6rem;
    margin-bottom: 0.5rem;
    scrollbar-width: none; /* Firefox */
}

.competitions-menu::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
}

.comp-pill {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-family: var(--font-heading);
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-smooth);
}

.comp-pill:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.comp-pill.active {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    color: #07090e;
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.15);
}

/* Left Section */
.left-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0; /* Prevents flex items from breaking layout overflow */
}

/* Video Player Area */
.player-container {
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--border-color);
    box-shadow: var(--glow-shadow);
}

.video-element {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.iframe-container {
    width: 100%;
    height: 100%;
    border: none;
    display: none;
}

/* Player Custom Controls Overlays */
.player-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 40%, transparent 60%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.player-container:hover .player-overlay {
    opacity: 1;
}

.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.controls-left, .controls-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.control-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--accent-gold);
}

.volume-slider-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.volume-slider {
    width: 70px;
    accent-color: var(--accent-gold);
    height: 4px;
    border-radius: 2px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.volume-slider:hover {
    width: 100px;
}

.stream-info-overlay {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.stream-info-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-heading);
}

.stream-info-status {
    font-size: 0.75rem;
    color: var(--accent-green);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Loading & Error Screens */
.player-state-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 5;
    gap: 1rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.state-message {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
    max-width: 80%;
}

.error-retry-btn {
    background: var(--accent-gold);
    color: var(--bg-primary);
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-heading);
    transition: var(--transition-smooth);
}

.error-retry-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

/* Dashboard Panels (Tabs) */
.tabs-navigation {
    display: flex;
    gap: 0.6rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    margin-bottom: 1.25rem;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.1);
}

.tab-btn.active {
    background: rgba(0, 255, 136, 0.1);
    color: var(--accent-gold);
    border-color: var(--accent-gold);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.05);
}

.tab-content-panel {
    display: none;
    animation: fadeIn 0.4s ease;
}

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

/* EPG Grid inside Sidebar */
.channels-grid {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.channel-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.85rem;
    position: relative;
    overflow: hidden;
}

.channel-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(0, 255, 136, 0.3);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.channel-card.active {
    border-color: var(--accent-gold);
    background: rgba(0, 255, 136, 0.06);
    box-shadow: inset 0 0 12px rgba(0, 255, 136, 0.03);
}

.channel-card.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-gold);
}

.channel-logo-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.channel-logo {
    width: 75%;
    height: 75%;
    object-fit: contain;
}

.channel-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.channel-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--font-heading);
}

.channel-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quality-badge {
    font-size: 0.65rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
}

.live-status {
    font-size: 0.65rem;
    color: var(--accent-green);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
}

.live-status .dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
    animation: pulse 2s infinite;
}

.play-indicator {
    opacity: 0;
    color: var(--accent-gold);
    display: flex;
    align-items: center;
    transition: var(--transition-smooth);
}

.channel-card:hover .play-indicator {
    opacity: 1;
}

.custom-channel-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    color: var(--accent-purple);
    font-size: 0.75rem;
}

.delete-custom-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: var(--transition-smooth);
}

.channel-card:hover .delete-custom-btn {
    opacity: 1;
}

.delete-custom-btn:hover {
    color: var(--accent-red);
}

/* Matches Grid (Partidos) */
.matches-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.match-row {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-smooth);
}

.match-row:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.15);
}

.match-teams {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
}

.team-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 180px;
}

.team-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.team-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.match-score-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    width: 80px;
}

.score-box {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    letter-spacing: 3px;
    text-indent: 3px;
    color: var(--accent-gold);
}

.match-time-badge {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.match-status-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    min-width: 100px;
}

.match-status-badge.live {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
    animation: soft-pulse 2s infinite;
}

.match-status-badge.upcoming {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-gold);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.match-status-badge.finished {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* Standings Table */
.standings-table-container {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-card);
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.standings-table th {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.standings-table td {
    padding: 0.85rem 1rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.standings-table tr:last-child td {
    border-bottom: none;
}

.standings-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.pos-col {
    width: 50px;
    font-weight: 700;
    text-align: center;
}

.team-col {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
}

.team-col-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.pts-col {
    font-weight: 700;
    color: var(--accent-gold);
}

/* Stats panel */
.stats-panel-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.current-match-header {
    grid-column: span 2;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--accent-gold);
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
}

.stat-title {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 0.5px;
}

.stat-numbers {
    display: flex;
    justify-content: space-between;
    font-size: 1.25rem;
    font-weight: 800;
    font-family: var(--font-heading);
}

.stat-num-left { color: var(--accent-purple); }
.stat-num-right { color: var(--accent-gold); }

.stat-bars-container {
    display: flex;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
}

.stat-bar-left {
    background: var(--accent-purple);
    height: 100%;
    transition: width 0.5s ease;
}

.stat-bar-right {
    background: var(--accent-gold);
    height: 100%;
    transition: width 0.5s ease;
}

/* Guide & Diagnostic Panel */
.guide-container {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 1.5rem;
}

.guide-steps-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.guide-steps-card h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--accent-gold);
}

.tip-item {
    display: flex;
    gap: 1rem;
}

.tip-number {
    width: 28px;
    height: 28px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    font-size: 0.875rem;
}

.tip-text h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.tip-text p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.diagnostic-card {
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.diagnostic-card h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--accent-purple);
}

.diag-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.75rem;
}

.diag-stat-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.diag-stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.diag-stat-value {
    font-size: 0.9rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

.diag-stat-value.healthy { color: var(--accent-green); }
.diag-stat-value.warning { color: var(--accent-gold); }

.test-speed-btn {
    background: linear-gradient(135deg, var(--accent-purple), #4f46e5);
    color: var(--text-primary);
    border: none;
    padding: 0.75rem;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    width: 100%;
}

.test-speed-btn:hover {
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
}

/* Chat Sidebar (Right Section) */
.chat-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px - 1rem);
    position: sticky;
    top: 90px;
    overflow: hidden;
}

.chat-header {
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
}

.chat-header-users {
    font-size: 0.75rem;
    color: var(--accent-green);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.chat-msg {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    animation: slideUp 0.3s ease;
}

.chat-msg-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.chat-msg-username {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-gold);
}

.chat-msg-badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    font-weight: 600;
}

.chat-msg-badge.team-al {
    background: rgba(30, 64, 175, 0.2);
    color: #3b82f6;
    border: 1px solid rgba(30, 64, 175, 0.4);
}

.chat-msg-badge.team-u {
    background: rgba(120, 113, 108, 0.2);
    color: #e7e5e4;
    border: 1px solid rgba(120, 113, 108, 0.4);
}

.chat-msg-badge.team-sc {
    background: rgba(6, 182, 212, 0.2);
    color: #06b6d4;
    border: 1px solid rgba(6, 182, 212, 0.4);
}

.chat-msg-body {
    font-size: 0.85rem;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
    padding: 0.5rem 0.75rem;
    border-radius: 0 10px 10px 10px;
    border: 1px solid rgba(255, 255, 255, 0.02);
    display: inline-block;
    word-break: break-word;
}

.chat-msg.self .chat-msg-username {
    color: var(--accent-purple);
}

.chat-msg.self .chat-msg-body {
    background: rgba(139, 92, 246, 0.08);
    border-color: rgba(139, 92, 246, 0.15);
    border-radius: 10px 0px 10px 10px;
    align-self: flex-end;
}

.chat-msg.self {
    align-self: flex-end;
    align-items: flex-end;
}

.chat-input-form {
    border-top: 1px solid var(--border-color);
    padding: 0.75rem;
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.1);
}

.chat-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: inherit;
}

.chat-input:focus {
    outline: none;
    border-color: var(--accent-gold);
}

.chat-send-btn {
    background: var(--accent-gold);
    color: var(--bg-primary);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

/* Modals & Dialogs */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-gold);
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover {
    color: var(--text-primary);
}

.modal-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.modal-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.modal-input, .modal-select {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    width: 100%;
}

.modal-input:focus, .modal-select:focus {
    outline: none;
    border-color: var(--accent-gold);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 0.5rem;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-primary {
    background: var(--accent-gold);
    color: var(--bg-primary);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

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

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.4; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes soft-pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Footer styling */
footer {
    text-align: center;
    padding: 2rem;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    background: rgba(8, 12, 20, 0.9);
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

footer a {
    color: var(--accent-gold);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Hero Banner Styles */
.hero-banner {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(8, 12, 20, 0.95)), 
                radial-gradient(circle at 80% 20%, rgba(245, 158, 11, 0.15) 0%, transparent 50%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    margin: 1.5rem 1.5rem 0 1.5rem;
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 10% 90%, rgba(139, 92, 246, 0.1) 0%, transparent 40%);
    pointer-events: none;
}

.hero-content {
    max-width: 85%;
    z-index: 2;
}

.hero-badge {
    background: linear-gradient(to right, rgba(245, 158, 11, 0.15), rgba(139, 92, 246, 0.15));
    border: 1px solid var(--border-color-active);
    color: var(--accent-gold);
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1rem;
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, var(--text-primary), var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Stability Notice Banner */
.status-alert-banner {
    background: rgba(0, 255, 136, 0.02);
    border: 1px solid rgba(0, 255, 136, 0.15);
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.825rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.status-alert-banner strong {
    color: var(--accent-gold);
    font-weight: 700;
}

/* Unmute Floating Button Overlay */
.unmute-overlay-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(12, 15, 24, 0.85);
    border: 1px solid var(--accent-gold);
    color: var(--text-primary);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 20;
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.2);
    animation: soft-pulse 2s infinite;
    transition: var(--transition-smooth);
}

.unmute-overlay-btn:hover {
    background: var(--accent-gold);
    color: #07090e;
    transform: scale(1.05);
}

/* Goal Notification Toast Styles */
.goal-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: rgba(12, 16, 27, 0.95);
    border: 1px solid var(--accent-gold);
    border-left: 5px solid var(--accent-gold);
    color: var(--text-primary);
    padding: 0.85rem 1.5rem;
    border-radius: 12px;
    font-family: var(--font-heading);
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 255, 136, 0.25);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
    pointer-events: none;
}

.goal-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.goal-notification-title {
    font-weight: 800;
    color: var(--accent-gold);
    font-size: 0.9rem;
    margin: 0;
    letter-spacing: 0.5px;
}

.goal-notification-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
    margin-top: 0.15rem;
}

/* Mobile Menu Button (Hidden on Desktop) */
.mobile-menu-btn {
    display: none;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

/* Sidebar Backdrop Styles */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 6, 10, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 140;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
    display: block;
    opacity: 1;
}

/* Responsive Rules */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    /* Turn Sidebar into a Slide-out Drawer */
    .channels-sidebar {
        position: fixed !important;
        top: 0;
        right: -100%; /* Hidden off-screen right */
        width: 320px;
        height: 100vh !important;
        z-index: 150;
        background: #090c13 !important;
        border-radius: 0 !important;
        border-left: 1px solid var(--border-color);
        box-shadow: -10px 0 30px rgba(0,0,0,0.6);
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 1.5rem 1.25rem;
    }
    
    .channels-sidebar.open {
        right: 0; /* Slide in! */
    }

    .mobile-menu-btn {
        display: flex;
    }
}

@media (max-width: 768px) {
    .hero-banner {
        padding: 1.25rem;
        margin: 1rem 1rem 0 1rem;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-content {
        max-width: 100%;
    }

    /* Keep header on a single row in mobile, logo left, menu button right */
    header {
        padding: 0.75rem 1.25rem;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 0;
    }
    
    .header-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    /* Hide live indicator on mobile to save space */
    .live-indicator {
        display: none !important;
    }

    /* Make logo and text smaller on mobile */
    .logo-text h1 {
        font-size: 0.95rem !important;
    }
    
    .logo-icon {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
        border-radius: 8px;
    }
    
    .main-content {
        padding: 1rem;
        gap: 1rem;
    }
    
    .stats-panel-container {
        grid-template-columns: 1fr;
    }
    
    .current-match-header {
        grid-column: span 1;
    }
    
    .guide-container {
        grid-template-columns: 1fr;
    }
    
    .match-teams {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .team-info {
        width: auto;
    }

    .player-assist-text {
        display: none !important;
    }
}

/* Hide Diagnostic tab on desktop (screens wider than 1024px) */
@media (min-width: 1025px) {
    .tab-btn[data-tab="diagnosticTab"] {
        display: none !important;
    }
    #diagnosticTab {
        display: none !important;
    }
}

/* Footer Styles */
footer {
    background: #06080c;
    border-top: 1px solid var(--border-color);
    padding: 2.5rem 1.5rem;
    margin-top: auto;
    text-align: center;
}

.footer-container {
    max-width: 1350px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    align-items: center;
}

.footer-tags-section {
    width: 100%;
}

.footer-tags-section h3 {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--accent-gold);
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.15);
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
}

.tag-pill {
    font-size: 0.72rem;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.35rem 0.8rem;
    border-radius: 50px;
    text-decoration: none;
    display: inline-block;
    transition: var(--transition-smooth);
}

.tag-pill:hover {
    background: rgba(0, 255, 136, 0.05);
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 255, 136, 0.1);
}

.footer-copyright {
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    width: 100%;
    padding-top: 1.25rem;
}


