/**
 * نظام البيانات الرياضية - ملف الأنماط الرئيسي
 * تصميم احترافي حديث مع دعم كامل للغة العربية
 */

/* ===== FONTS & TYPOGRAPHY ===== */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@200;300;400;500;600;700;800;900&display=swap');

:root {
    /* Primary Colors */
    --primary-color: #667eea;
    --primary-dark: #5a6fd8;
    --primary-light: #7c8ef0;
    
    /* Secondary Colors */
    --secondary-color: #764ba2;
    --secondary-dark: #6a4190;
    --secondary-light: #8357b4;
    
    /* Accent Colors */
    --accent-success: #28a745;
    --accent-warning: #ffc107;
    --accent-danger: #dc3545;
    --accent-info: #17a2b8;
    
    /* Neutral Colors */
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #dee2e6;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    --gradient-success: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    --gradient-warning: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    --gradient-danger: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    --gradient-info: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%);
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 5px 15px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.1);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 15px;
    --radius-xl: 20px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-xxl: 3rem;
}

/* ===== GLOBAL STYLES ===== */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: #f5f7fa;
    direction: rtl;
    text-align: right;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

.display-1 { font-size: 6rem; font-weight: 300; }
.display-2 { font-size: 5.5rem; font-weight: 300; }
.display-3 { font-size: 4.5rem; font-weight: 300; }
.display-4 { font-size: 3.5rem; font-weight: 300; }

.lead {
    font-size: 1.25rem;
    font-weight: 300;
    opacity: 0.9;
}

/* ===== NAVIGATION ===== */
.navbar {
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    transition: all var(--transition-fast);
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.nav-link {
    font-weight: 500;
    padding: var(--spacing-sm) var(--spacing-md) !important;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: rgba(255,255,255,0.1);
    transition: width var(--transition-normal);
    z-index: -1;
}

.nav-link:hover::before,
.nav-link.active::before {
    width: 100%;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

/* ===== HERO SECTION ===== */
.hero-section {
    background: var(--gradient-primary);
    color: white;
    padding: var(--spacing-xxl) 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: var(--spacing-lg);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    animation: fadeInUp 1s ease;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: var(--spacing-xl);
    opacity: 0.9;
    animation: fadeInUp 1s ease 0.2s both;
}

.hero-stats {
    display: flex;
    gap: var(--spacing-xl);
    margin-top: var(--spacing-xl);
    animation: fadeInUp 1s ease 0.4s both;
}

.stat-item {
    text-align: center;
    padding: var(--spacing-lg);
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all var(--transition-normal);
}

.stat-item:hover {
    transform: translateY(-5px);
    background: rgba(255,255,255,0.2);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: var(--spacing-sm);
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.hero-image {
    text-align: center;
    font-size: 8rem;
    opacity: 0.3;
    animation: float 3s ease-in-out infinite;
}

/* ===== CARDS ===== */
.card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    overflow: hidden;
    background: var(--bg-white);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: var(--spacing-lg);
    font-weight: 600;
}

.card-body {
    padding: var(--spacing-lg);
}

/* ===== SECTION HEADERS ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--border-color);
}

.section-header h2 {
    margin: 0;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.section-header h2 i {
    font-size: 1.2em;
    color: var(--primary-color);
}

/* ===== MATCH CARDS ===== */
.match-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: none;
    margin-bottom: var(--spacing-lg);
    transition: all var(--transition-normal);
    overflow: hidden;
    position: relative;
}

.match-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.match-card.live-match {
    border-right: 4px solid var(--accent-danger);
    animation: pulse-border 2s infinite;
}

.match-header {
    background: linear-gradient(45deg, var(--bg-light), #e9ecef);
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.match-body {
    padding: var(--spacing-lg);
}

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

.team-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.team-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-left: var(--spacing-md);
    border-radius: var(--radius-sm);
}

.team-logo-sm {
    width: 24px;
    height: 24px;
    object-fit: contain;
    margin-left: var(--spacing-sm);
}

.team-logo-xs {
    width: 20px;
    height: 20px;
    object-fit: contain;
    margin-left: var(--spacing-sm);
}

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

.score-section {
    text-align: center;
    padding: 0 var(--spacing-md);
    min-width: 80px;
}

.score-display {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.match-time {
    font-size: 0.9rem;
    margin-top: var(--spacing-sm);
}

/* ===== MATCHES LIST ===== */
.matches-list {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.match-item {
    display: flex;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

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

.match-item:last-child {
    border-bottom: none;
}

.match-time-col {
    min-width: 80px;
    text-align: center;
    font-weight: 600;
}

.match-teams {
    flex: 1;
    margin: 0 var(--spacing-md);
}

.team-row {
    display: flex;
    align-items: center;
    margin-bottom: var(--spacing-xs);
}

.team-row:last-child {
    margin-bottom: 0;
}

.match-score-col {
    min-width: 60px;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.match-league {
    min-width: 120px;
    text-align: left;
}

/* ===== RESULTS GRID ===== */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
}

.result-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-md);
    transition: all var(--transition-normal);
}

.result-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.result-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.result-body .team {
    display: flex;
    align-items: center;
    flex: 1;
}

.result-body .score {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-primary);
    margin: 0 var(--spacing-md);
}

/* ===== NEWS STYLES ===== */
.news-list {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.news-item {
    display: flex;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    text-decoration: none;
    color: inherit;
}

.news-item:hover {
    background: var(--bg-light);
    text-decoration: none;
    color: inherit;
}

.news-item:last-child {
    border-bottom: none;
}

.news-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-left: var(--spacing-md);
}

.news-content {
    flex: 1;
}

.news-title {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.news-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ===== BADGES & LABELS ===== */
.badge {
    font-weight: 600;
    padding: 0.5em 0.75em;
    border-radius: var(--radius-md);
}

.pulse {
    animation: pulse 2s infinite;
}

/* ===== BUTTONS ===== */
.btn {
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left var(--transition-slow);
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-success {
    background: var(--gradient-success);
    color: white;
}

.btn-warning {
    background: var(--gradient-warning);
    color: white;
}

.btn-danger {
    background: var(--gradient-danger);
    color: white;
}

.btn-info {
    background: var(--gradient-info);
    color: white;
}

/* ===== FORMS ===== */
.form-control {
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    padding: 0.75rem 1rem;
    transition: all var(--transition-normal);
    font-weight: 500;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    transform: translateY(-1px);
}

.form-select {
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    padding: 0.75rem 1rem;
    transition: all var(--transition-normal);
    font-weight: 500;
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

/* ===== PAGINATION ===== */
.pagination {
    gap: var(--spacing-xs);
}

.page-link {
    border-radius: var(--radius-md);
    border: none;
    padding: 0.75rem 1rem;
    font-weight: 600;
    transition: all var(--transition-normal);
}

.page-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* ===== FOOTER ===== */
footer {
    background: var(--gradient-primary);
    color: white;
    padding: var(--spacing-xl) 0;
    margin-top: var(--spacing-xxl);
}

footer h5 {
    font-weight: 700;
    margin-bottom: var(--spacing-md);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

@keyframes pulse-border {
    0% { border-right-color: var(--accent-danger); }
    50% { border-right-color: #ff6b7a; }
    100% { border-right-color: var(--accent-danger); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes shimmer {
    0% { background-position: -468px 0; }
    100% { background-position: 468px 0; }
}

/* ===== LOADING STATES ===== */
.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton {
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    animation: shimmer 1.5s infinite;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1200px) {
    .hero-title { font-size: 3rem; }
    .hero-subtitle { font-size: 1.3rem; }
    .hero-stats { gap: var(--spacing-lg); }
}

@media (max-width: 992px) {
    .hero-title { font-size: 2.5rem; }
    .hero-subtitle { font-size: 1.2rem; }
    .hero-stats { 
        flex-direction: column; 
        gap: var(--spacing-md);
    }
    .stat-item { padding: var(--spacing-md); }
    .stat-number { font-size: 2rem; }
}

@media (max-width: 768px) {
    .hero-section { padding: var(--spacing-xl) 0; }
    .hero-title { font-size: 2rem; }
    .hero-subtitle { font-size: 1.1rem; }
    .hero-image { font-size: 4rem; }
    
    .team-section { flex-direction: column; gap: var(--spacing-md); }
    .score-section { order: -1; }
    
    .match-item { flex-direction: column; text-align: center; }
    .match-time-col, .match-score-col, .match-league { margin-bottom: var(--spacing-sm); }
    
    .results-grid { grid-template-columns: 1fr; }
    
    .section-header { flex-direction: column; gap: var(--spacing-md); }
    
    .btn { padding: 0.6rem 1.2rem; font-size: 0.9rem; }
}

@media (max-width: 576px) {
    .hero-title { font-size: 1.8rem; }
    .hero-subtitle { font-size: 1rem; }
    
    .card-body { padding: var(--spacing-md); }
    .match-body { padding: var(--spacing-md); }
    
    .team-logo { width: 30px; height: 30px; }
    .team-name { font-size: 1rem; }
    
    .news-item { padding: var(--spacing-sm) var(--spacing-md); }
    .news-image { width: 50px; height: 50px; }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f8f9fa;
        --text-secondary: #adb5bd;
        --text-muted: #6c757d;
        --bg-light: #343a40;
        --bg-white: #495057;
        --border-color: #6c757d;
    }
    
    body {
        background-color: #212529;
        color: var(--text-primary);
    }
    
    .card {
        background: var(--bg-white);
        color: var(--text-primary);
    }
    
    .match-header {
        background: linear-gradient(45deg, #343a40, #495057);
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.btn:focus,
.form-control:focus,
.form-select:focus,
.nav-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
        --shadow-md: 0 5px 15px rgba(0,0,0,0.2);
        --shadow-lg: 0 10px 25px rgba(0,0,0,0.3);
    }
    
    .card {
        border: 2px solid var(--border-color);
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .navbar,
    .hero-section,
    footer,
    .btn,
    .pagination {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    body {
        background: white;
        color: black;
    }
}

