/* Custom Properties for Theming */
:root {
    --bg-color: #0b0f19;
    /* Deep dark blue background */
    --surface-color: #151a28;
    /* Slightly lighter surface */
    --primary-color: #e5ff3c;
    /* Neon yellow accent */
    --primary-color-hover: #c4dc20;
    --text-primary: #ffffff;
    --text-secondary: #949ab0;
    --accent-blue: #3b82f6;
    --accent-red: #ef4444;

    --border-color: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(21, 26, 40, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);

    --sidebar-width: 250px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;

    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
    font-family: 'Outfit', sans-serif;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--surface-color);
    border-radius: 10px;
}

/* App Container */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--surface-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 3rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-blue));
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(229, 255, 60, 0.3);
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.logo span {
    color: var(--primary-color);
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-links li a {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
}

.nav-links li a svg {
    width: 20px;
    height: 20px;
}

.nav-links li a:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.03);
}

.nav-links li a.active {
    color: var(--bg-color);
    background-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(229, 255, 60, 0.2);
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.1), transparent 400px), var(--bg-color);
}

/* Top Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    position: sticky;
    top: 0;
    background: rgba(11, 15, 25, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 5;
    border-bottom: 1px solid var(--border-color);
}

.search-bar {
    position: relative;
    width: 400px;
    max-width: 100%;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

.search-bar input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-fast);
}

.search-bar input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(229, 255, 60, 0.1);
}

.user-profile .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #ec4899);
    cursor: pointer;
    border: 2px solid var(--surface-color);
}

/* Content Wrapper */
.content-wrapper {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Hero Section */
.hero-section {
    margin-bottom: 3rem;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
}

.hero-card {
    position: relative;
    overflow: hidden;
    padding: 4rem 3rem;
    /* Optional: add a background image of a stadium using a pseudo-element if available, else a gradient */
    background: linear-gradient(135deg, rgba(21, 26, 40, 0.9) 0%, rgba(11, 15, 25, 0.9) 100%),
        url('https://images.unsplash.com/photo-1574629810360-7efbbcb695cc?q=80&w=2574&auto=format&fit=crop') center/cover no-repeat;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.hero-title {
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.5;
}

.primary-btn {
    padding: 14px 28px;
    background-color: var(--primary-color);
    color: var(--bg-color);
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: 0 4px 20px rgba(229, 255, 60, 0.25);
}

.primary-btn:hover {
    background-color: var(--primary-color-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(229, 255, 60, 0.35);
}

/* Sections */
.content-section {
    margin-bottom: 3rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.view-all {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

.view-all:hover {
    text-decoration: underline;
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.video-card {
    background-color: var(--surface-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition-normal);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(229, 255, 60, 0.3);
}

.thumbnail-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
    background-color: var(--bg-color);
    overflow: hidden;
}

.thumbnail-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.video-card:hover .thumbnail-container img {
    transform: scale(1.05);
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: var(--transition-normal);
}

.video-card:hover .play-overlay {
    opacity: 1;
}

.play-btn {
    width: 50px;
    height: 50px;
    background-color: rgba(229, 255, 60, 0.9);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--bg-color);
    transform: scale(0.8);
    transition: var(--transition-normal);
}

.video-card:hover .play-btn {
    transform: scale(1);
}

.play-btn svg {
    width: 20px;
    height: 20px;
    margin-left: 4px;
    /* Adjust optical center for play triangle */
}

.video-info {
    padding: 1.2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.video-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.tag {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* News List */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.news-card {
    display: flex;
    background-color: var(--surface-color);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition-normal);
    text-decoration: none;
    color: var(--text-primary);
}

.news-card:hover {
    background-color: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.15);
}

.news-thumb {
    width: 200px;
    height: 130px;
    object-fit: cover;
    background-color: var(--bg-color);
}

.news-content {
    padding: 1.2rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.news-category {
    color: var(--accent-blue);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.news-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.news-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Loaders, Error states */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin: 2rem auto;
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.show-loader {
    display: block !important;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

/* Competition Badge on Card Thumbnail */
.card-competition {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(6px);
    color: var(--primary-color);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(229, 255, 60, 0.3);
    pointer-events: none;
}

/* RTL Arabic text */
[dir="rtl"] {
    text-align: right;
}

/* ── Video Modal ──────────────────────────────────────────────────────────── */
#video-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

#video-modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    z-index: 2;
    background: var(--surface-color);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(229, 255, 60, 0.05);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.modal-frame-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 */
    background: #000;
    flex-shrink: 0;
}

.modal-frame-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.modal-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
    direction: rtl;
    text-align: right;
}

.modal-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    direction: rtl;
}

.modal-ext-link {
    display: inline-block;
    margin-top: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

.modal-ext-link:hover {
    text-decoration: underline;
}

/* Responsive constraints */
@media (max-width: 1024px) {
    .news-card {
        flex-direction: column;
    }

    .news-thumb {
        width: 100%;
        height: 200px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-card {
        padding: 2.5rem 1.5rem;
    }

    .modal-content {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
}