:root{
    --brand:#0B3350;   /* نفس الكحلي الأساسي في الهيرو الرئيسي */
    --brand-2:#0a1f38; /* الكحلي الأغمق */
}

body {
    background: linear-gradient(135deg, #eef2ff, #ffffff);
    font-family: "Times New Roman", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #212121;
}

.page-wrapper {
    min-height: 100vh;
}

.hero {
    position: relative;
    background:
      radial-gradient(1200px 600px at 120% -10%, rgba(88,180,255,.12), transparent 58%),
      radial-gradient(800px 520px at -12% 115%, rgba(14,89,160,.18), transparent 60%),
      conic-gradient(from 210deg at 60% 40%, rgba(88,180,255,.10), transparent 30%, rgba(88,180,255,.10) 60%, transparent 80%),
      linear-gradient(180deg, var(--brand) 0%, var(--brand-2) 100%);
    color: #fff;
    border-radius: 0 0 30px 30px;
    padding: 20px 0 26px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.hero::before{
    content:"";
    position:absolute;
    inset:0;
    pointer-events:none;
    background: radial-gradient(600px 260px at 50% 0%, rgba(255,255,255,.08), transparent 60%);
}

.hero-title {
    font-weight: 700;
    letter-spacing: 1px;
}

.hero-subtitle {
    opacity: .9;
}

.hero .btn-home {
    background-color: #ffffff;
    border: none;
    color: #1565c0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.hero .btn-home:hover {
    background-color: #f5f5f5;
}

.stat-pill {
    background-color: #ffffff;
    border-radius: 999px;
    padding: 4px 10px 6px;
    display: inline-flex;
    flex-direction: column;    /* نخلي المحتوى عمودي: رقم + سطر تحت */
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 60px;
    font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    color: #37474f;
}

.stat-pill strong {
    font-weight: 700;
}

.stat-pill-main {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-pill-label {
    font-size: 0.7rem;
    line-height: 1;
    color: #78909c;
}

.date-control input[type="date"] {
    min-width: 190px;
}

/* بطاقة التحكم العلوية (فلترة + بحث + تنقل البطولات) */
.controls-card {
    background-color: #ffffff;
    border-radius: 18px;
    padding: 12px 16px 14px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.04);
    margin-top: -32px;
    margin-bottom: 20px;
    position: relative;
    z-index: 10;
}

.controls-card-label {
    font-size: 0.8rem;
    color: #78909c;
    margin-bottom: 4px;
}

.competition-chips-wrapper {
    max-height: 90px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding-bottom: 3px;
}

.competition-chip {
    border-radius: 999px;
    border: 1px solid #e0e0e0;
    background-color: #ffffff;
    padding: 7px 14px;
    font-size: 0.85rem;
    margin: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all .2s ease;
}

.competition-chip:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.competition-chip img {
    width: 18px;
    height: 18px;
}

.competition-chip.active {
    background: linear-gradient(120deg, #1565c0, #42a5f5);
    color: #fff;
    border-color: transparent;
}

.competition-card {
    border-radius: 18px;
    border: none;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.06);
    margin-bottom: 25px;
}

.competition-card .card-header {
    border-radius: 18px 18px 0 0;
    background: #fafbff;
    border-bottom: 1px solid #eceff1;
}

.competition-logo {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: contain;
    background-color: #ffffff;
    padding: 3px;
    border: 1px solid #eceff1;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    margin-left: 4px;
}

.dot-live { background-color: #2e7d32; }
.dot-ended { background-color: #c62828; }
.dot-upcoming { background-color: #ff8f00; }

.match-card {
    border-radius: 14px;
    border: 1px solid #e0e0e0;
    background-color: #ffffff;
    padding: 10px 10px 8px;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: box-shadow .2s ease, transform .15s ease;
    position: relative; /* لظهور أيقونة الكورة فوق الكرت */
}

.match-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
    transform: translateY(-2px);
}

/* تأثير بسيط عند تسجيل هدف جديد (توهج حول كرت المباراة) */
.match-card.goal-flash {
    /* نخلي الأنيميشن يتكرر 5 مرات تقريبًا = حوالي 6 ثواني */
    animation: goalFlash 1.2s ease-out 0s 5;
}

@keyframes goalFlash {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.85);
        transform: scale(1.01);
    }
    60% {
        box-shadow: 0 0 0 12px rgba(255, 193, 7, 0);
        transform: scale(1.015);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
        transform: scale(1);
    }
}

/* أيقونة كورة تظهر مؤقتاً مع الفلاش فوق نتيجة المباراة */
.match-card.goal-flash .match-score::before {
    content: "⚽";
    position: absolute;
    top: -18px;                 /* فوق النتيجة */
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.1rem;
    filter: drop-shadow(0 0 4px rgba(0,0,0,.3));
    animation: ballPop 0.7s ease-out infinite;
}

@keyframes ballPop {
    0% {
        transform: scale(0.6);
        opacity: 0;
    }
    40% {
        transform: scale(1.15);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0.9;
    }
}

.team-block {
    text-align: center;
    width: 40%;
    display: flex;
    justify-content: center;
}

.team-block .team-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

/* كروت الفرق تحت اسم الفريق في كرت المباراة */
.team-card-badges {
    margin-top: 2px;
    min-height: 18px; /* عشان ما يتحرك التصميم لو ما فيه كروت */
}

.team-card-badges .icon-svg {
    width: 16px;
    height: 22px;
    display: inline-block;
    margin-inline: 1px;
}

.team-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-bottom: 4px;
}

.team-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #263238;
}

.match-center {
    width: 20%;
    text-align: center;
}

.match-score {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a237e;
    position: relative;      /* عشان نقدر نحط الكورة فوقها */
    display: inline-block;   /* عشان الـ ::before يتمركز صح */
    padding-top: 8px;        /* مسافة صغيرة تحت الكورة لو نزلت شوي */
}

.match-time-small {
    font-size: 0.8rem;
    color: #546e7a;
}

.match-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: #607d8b;
    margin-top: 6px;
}

.match-status-badge {
    font-size: 0.75rem;
    border-radius: 999px;
    padding: 3px 9px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.status-upcoming {
    background-color: #fff3e0;
    color: #e65100;
}

.status-live {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status-ended {
    background-color: #ffebee;
    color: #c62828;
}

.match-timer {
    font-size: 0.8rem;
    color: #1565c0;
    font-weight: 600;
}

.btn-details {
    font-size: 0.8rem;
    border-radius: 999px;
    padding: 4px 10px;
}

.no-matches {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    color: #607d8b;
}

.filter-btn {
    border-radius: 999px;
    font-size: 0.8rem;
    padding: 5px 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.filter-btn.active {
    background-color: #1565c0 !important;
    box-shadow: 0 0 0 1px rgba(21,101,192,0.20);
}

.badge-extra {
    font-size: 0.7rem;
    border-radius: 999px;
}

/* دوران أيقونة التحديث */
.refresh-rotating {
    animation: refresh-spin 0.9s linear infinite;
}

@keyframes refresh-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

#last-updated-label {
    font-size: 0.75rem;
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 1.3rem;
    }

    .controls-card {
        margin-top: -26px;
        padding: 10px 10px 12px;
    }

    .match-card {
        padding: 8px 8px 6px;
    }

    .match-main-row {
        gap: 6px;
    }

    .team-block {
        width: auto;
        flex: 1 1 0;
    }

    .team-logo {
        width: 28px;
        height: 28px;
    }

    .team-name {
        font-size: 0.75rem;
        line-height: 1.1;
        max-width: 95px;
        white-space: nowrap;
    }

    .match-center {
        width: auto;
        flex: 0 0 auto;
        min-width: 58px;
    }

    .match-score {
        font-size: 1.05rem;
    }

    .match-time-small {
        font-size: 0.7rem;
    }

    .match-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
        font-size: 0.72rem;
    }

    .btn-details {
        padding: 3px 8px;
        font-size: 0.72rem;
    }
}
.fav-team-toggle {
    line-height: 1;
}

.fav-team-toggle.is-fav {
    color: #ffc107;
}

.fav-team-toggle.is-fav i {
    text-shadow: 0 0 4px rgba(0,0,0,0.25);
}
/* تلوين أسماء الفرق حسب النتيجة في كروت مباريات اليوم */
.match-card .team-name.team-winner {
    color: #0b6623; /* أخضر غامق */
    font-weight: 700;
}

.match-card .team-name.team-loser {
    color: #c62828; /* أحمر واضح */
    font-weight: 700;
}
/* حاوية شعار الفريق مع النجمة (نفس فكرة صفحة تفاصيل المباراة) */
.match-card .team-logo-wrapper {
    position: relative;
    display: inline-block;
}

/* النجمة فوق الشعار للفائز بركلات الترجيح */
.match-card .team-logo-wrapper .winner-star {
    position: absolute;
    top: -16px;             /* رفع النجمة فوق الشعار أكثر */
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85rem;     /* نفس الحجم الصغير */
    line-height: 1;
    color: #FFC107;         /* ذهبي */
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.35);
    pointer-events: none;
    z-index: 2;             /* تأكد أنها فوق الشعار */
}



.match-card .team-logo-wrapper .winner-star i {
    color: #FFC107;
    font-size: 0.85rem;     /* نفس حجم الحاوية */
}

/* تمييز زر "بطولاتي المفضلة فقط" عن زر "فرقي المفضلة فقط" */

/* الوضع العادي: نفس الخلفية، لكن النص/الأيقونة بلون الكحلي الأساسي */
#btn-fav-leagues-filter {
    color: var(--brand);        /* الكحلي */
    border-color: var(--brand); /* حد الكحلي بدل الأصفر */
    font-weight: 600;
}

#btn-fav-leagues-filter i {
    color: inherit;             /* نفس لون النص */
}

/* هوفر خفيف */
#btn-fav-leagues-filter:hover {
    background-color: rgba(11, 51, 80, 0.06); /* لمسة خفيفة */
}

/* عند التفعيل (class="active" يضيفها الجافاسكربت):
   نعكس الألوان: الخلفية كحلي والنص أبيض */
#btn-fav-leagues-filter.active {
    background-color: var(--brand);
    color: #ffffff;
    border-color: var(--brand);
}

/* الأيقونة لما يكون الزر مفعَّل */
#btn-fav-leagues-filter.active i {
    color: #ffffff;
}
/* ================================
   تلوين أزرار الفلترة حسب الحالة
   ================================ */

/* --- زر "مباشرة فقط" --- */
.filter-btn[data-filter="live"] {
    border-color: #2e7d32;   /* أخضر */
    color: #2e7d32;
}
.filter-btn[data-filter="live"] i {
    color: inherit;
}
/* النص داخل الزر (عليه class text-success من بوتستراب) */
.filter-btn[data-filter="live"] .text-success {
    color: #2e7d32 !important;
}

/* عند التفعيل: نعكس الألوان */
.filter-btn[data-filter="live"].active {
    background-color: #2e7d32 !important;
    border-color: #2e7d32 !important;
    color: #ffffff !important;
}
.filter-btn[data-filter="live"].active i,
.filter-btn[data-filter="live"].active .text-success {
    color: #ffffff !important;
}

/* --- زر "لم تبدأ" --- */
.filter-btn[data-filter="upcoming"] {
    border-color: #ff8f00;   /* برتقالي */
    color: #ff8f00;
}
.filter-btn[data-filter="upcoming"] i {
    color: inherit;
}
.filter-btn[data-filter="upcoming"] .text-warning {
    color: #ff8f00 !important;
}

/* عند التفعيل */
.filter-btn[data-filter="upcoming"].active {
    background-color: #ff8f00 !important;
    border-color: #ff8f00 !important;
    color: #ffffff !important;
}
.filter-btn[data-filter="upcoming"].active i,
.filter-btn[data-filter="upcoming"].active .text-warning {
    color: #ffffff !important;
}

/* --- زر "منتهية" --- */
.filter-btn[data-filter="ended"] {
    border-color: #c62828;   /* أحمر */
    color: #c62828;
}
.filter-btn[data-filter="ended"] i {
    color: inherit;
}
.filter-btn[data-filter="ended"] .text-danger {
    color: #c62828 !important;
}

/* عند التفعيل */
.filter-btn[data-filter="ended"].active {
    background-color: #c62828 !important;
    border-color: #c62828 !important;
    color: #ffffff !important;
}
.filter-btn[data-filter="ended"].active i,
.filter-btn[data-filter="ended"].active .text-danger {
    color: #ffffff !important;
}
/* ===== فوتر صفحة مباريات اليوم ===== */
.sf-copy {
    background: linear-gradient(90deg, #0B3350, #0a1f38);
    color: #ffffff;
    padding: 10px 0 12px;
    margin-top: 24px;
    text-align: center;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.18);
    font-size: 0.85rem;
}

.sf-copy-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    opacity: 0.9;
}

.sf-copy i {
    color: #ffc107;
    font-size: 0.95rem;
}
/* ------------------------------
   ويدجت أقرب مباراة ستنطلق
   ------------------------------ */
.next-match-card {
    border-width: 2px;
    border-color: #2e7d32; /* أخضر هادي */
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

/* شريط علوي بسيط على الكرت */
.next-match-card::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    inset-inline-end: 0;
    top: 0;
    height: 4px;
    background: linear-gradient(90deg, #2e7d32, #43a047, #66bb6a);
}

/* تنسيق النص داخل الودجت */
.next-match-card .card-body {
    padding: 0.9rem 1rem;
}

.next-match-card .fw-semibold {
    font-size: 0.95rem;
}

.next-match-card .small.text-muted {
    font-size: 0.78rem;
}

/* العد التنازلي */
#next-match-countdown {
    font-size: 0.9rem;
}

/* لو حبيت نميّز "بدأت الآن" بلون مختلف */
#next-match-countdown.started {
    color: #c62828 !important;
}

/* في الشاشات الصغيرة نخلي العناصر تتكدس بشكل لطيف */
@media (max-width: 576px) {
    .next-match-card .card-body {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .next-match-card .text-end {
        width: 100%;
        text-align: start !important;
    }

    #next-match-countdown {
        margin-bottom: 0.25rem;
    }
}
#fav-matches-today .card {
    border-color: #f7b733;
    background: #fbfcff;
}

#fav-matches-today .match-card-clone {
    box-shadow: none;
    border: 1px solid rgba(247,183,51,0.25);
    background-color: #fff;
}

#fav-matches-today .fav-match-col {
    /* مساحة بسيطة بين الكروت */
}
/* سكشن مباريات المفضلة */
#fav-matches-today .card {
    border-color: #f7b733;
    background: #fbfcff;
}

.fav-league-block + .fav-league-block {
    border-top: 1px dashed #e0e0e0;
    padding-top: .75rem;
    margin-top: .75rem;
}

.fav-league-header {
    font-size: 0.95rem;
}

.fav-league-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
    background: #fff;
}

.fav-league-name {
    font-weight: 600;
}

.match-card-clone {
    box-shadow: none;
    border: 1px solid rgba(247, 183, 51, 0.25);
    background-color: #fff;
}
/* ======= سكشن مباريات اليوم لفرقي/بطولاتي المفضلة ======= */

#fav-matches-today .card {
    border-width: 2px;
}

.fav-league-block {
    border-radius: 12px;
    border: 1px solid #ffe0b2;
    padding: 0.75rem 0.75rem 0.5rem;
    background: #fffaf3;
}

.fav-league-block + .fav-league-block {
    margin-top: 0.75rem;
}

.fav-league-header {
    margin-bottom: 0.5rem;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
    padding-bottom: 0.35rem;
}

.fav-league-logo {
    width: 26px;
    height: 26px;
    object-fit: contain;
    border-radius: 4px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* نسخة مصغّرة للكارد داخل سكشن المفضلة */
.match-card-compact {
    box-shadow: none;
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 0.5rem 0.75rem;
}

#fav-matches-container .match-card-compact .btn-details {
    padding-inline: 0.75rem;
}
.guest-fav-alert {
    background: rgba(0, 0, 0, 0.65);      /* خلفية غامقة شفافة */
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.9rem;                    /* أو 1rem لو تبي أكبر */
    line-height: 1.7;
}

.guest-fav-alert i {
    margin-left: .35rem;
}

.guest-fav-alert .btn-close {
    filter: invert(1);                    /* يخلي علامة الإغلاق بيضاء */
}
.small text-muted {
    color:#000;
}