/*
Theme Name: KoraTrend Approved 5
Author: You & Gemini
Description: The final approved design for KoraTrend.
Version: 2.1 (Final Polish)
*/

/* Basic Reset & Body Style */
body {
    font-family: 'Tajawal', sans-serif;
    background-color: #F5F3FF; /* Light Purple Background */
    color: #1F2937;
    margin: 0;
    direction: rtl;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease-in-out;
}

/* Main Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem;
}

/* Header */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    background-color: #FFFFFF;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.site-header .logo-container {
    display: flex;
    align-items: center;
}

.site-header .logo-svg {
    width: 2.5rem;
    height: 2.5rem;
    margin-left: 0.75rem;
}

.site-header .logo-text {
    font-size: 1.875rem;
    font-weight: bold;
    color: #1F2937;
}

.site-header .logo-text .accent {
    color: #6D28D9;
}

/* Navigation */
.main-navigation ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
}

.main-navigation a {
    font-weight: 600;
}

.main-navigation a:hover {
    color: #6D28D9;
}

.main-navigation .menu-item a[href*="donate"] {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
}

/* Main Content Grid */
.main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* This rule now applies only to screens wider than 1024px */
@media (min-width: 1025px) {
    .main-grid {
        grid-template-columns: 2fr 1fr;
    }
}

/* Main Content & Widget Styling */
.main-content,
.sidebar .widget {
    background-color: #FFFFFF;
    padding: 1rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.section-header, .widget-title-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-title, .widget-title {
    font-size: 1.5rem;
    font-weight: bold;
    border-right: 4px solid #6D28D9;
    padding-right: 0.5rem;
    margin: 0;
}

.current-date {
    font-size: 1.125rem;
    font-weight: 600;
    color: #6B7280;
}

.matches-container, .summaries-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Match Card */
.match-card {
    display: flex;
    border-radius: 0.75rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.match-card:hover {
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.match-card .status-bar { width: 0.5rem; }
.match-card .status-bar.upcoming { background-color: #6D28D9; }
.match-card .status-bar.live { background-color: #DC2626; }
.match-card .status-bar.finished { background-color: #6B7280; }

.match-card .card-content { padding: 1rem; flex-grow: 1; }
.match-card .card-header { display: flex; justify-content: space-between; align-items: center; font-size: 0.875rem; color: #6B7280; margin-bottom: 0.5rem; }
.match-card .card-header .time { font-weight: 600; color: #9CA3AF; }
.match-card .card-body { display: flex; align-items: center; justify-content: space-between; }
.match-card .team { flex: 1; display: flex; align-items: center; }
.match-card .team.home { justify-content: flex-end; }
.match-card .team.away { justify-content: flex-start; }
.match-card .team-logo { width: 2.5rem; height: 2.5rem; object-fit: contain; }
.match-card .team-name { font-weight: bold; font-size: 1.125rem; margin: 0 1rem; }
.match-card .score-time { width: 6rem; text-align: center; font-weight: bold; font-size: 1.5rem; }
.match-card .score-time .vs { font-size: 1.25rem; color: #9CA3AF; }
.match-card .card-status-box {
    background-color: #EDE9FE; color: #6D28D9; font-weight: bold;
    display: flex; align-items: center; justify-content: center;
    width: 6rem; text-align: center; padding: 0 0.5rem;
}

.live-dot {
    width: 10px; 
    height: 10px; 
    background-color: #DC2626; 
    border-radius: 50%;
    margin-left: 0.5rem; 
    animation: pulse-red 1.5s infinite;
    flex-shrink: 0; /* **الإضافة الجديدة هنا**: تمنع الدائرة من التقلص */
}
@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 1.5rem; }
.social-icons { display: flex; justify-content: space-around; flex-wrap: wrap; gap: 0.5rem; }
.social-icons a { color: #4B5563; }
.social-icons a:hover { opacity: 0.75; }
.social-icons svg { width: 2rem; height: 2rem; }

.summary-card {
    display: flex; align-items: center; justify-content: space-between;
    background-color: #EDE9FE; padding: 0.75rem; border-radius: 0.5rem;
    transition: background-color 0.2s ease;
}
.summary-card:hover { background-color: #DDD6FE; }
.summary-card img { width: 1.75rem; height: 1.75rem; object-fit: contain; }
.summary-card .score { font-weight: bold; color: #1F2937; }


/* Single Match Page */
.single-match .back-button {
    margin-bottom: 1.5rem; background-color: #EDE9FE; color: #1F2937;
    padding: 0.5rem 1rem; border-radius: 0.5rem; display: inline-block;
}
.single-match .match-header-card { padding: 1.5rem; margin-bottom: 2rem; }
.single-match .match-header-teams { display: flex; justify-content: space-around; align-items: center; }
.single-match .team-display { text-align: center; }
.single-match .team-display img { width: 5rem; height: 5rem; margin-bottom: 0.5rem; object-fit: contain; }
.single-match .team-display .name { font-size: 1.5rem; font-weight: bold; }
.single-match .match-header-meta { text-align: center; margin: 0 2rem; }
.single-match .match-header-meta .score { font-size: 2.5rem; font-weight: bold; }
.single-match .match-header-meta .status {
    color: #FFFFFF; padding: 0.25rem 0.75rem; font-size: 0.875rem;
    border-radius: 9999px; margin-top: 0.5rem; display: inline-block;
}
.single-match .match-header-meta .status.upcoming { background-color: #FBBF24; }
.single-match .match-header-meta .status.live { background-color: #DC2626; }
.single-match .match-header-meta .status.finished { background-color: #6B7280; }

.single-match .servers-card, .single-match .player-card,
.single-match .details-card, .single-match .share-card { margin-bottom: 1.5rem; }

.servers-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.server-btn {
    color: #FFFFFF; font-weight: 600; padding: 0.75rem 1.25rem;
    border-radius: 0.5rem; border: none; cursor: pointer;
    background-color: #4B5563; transition: background-color 0.2s ease;
}
.server-btn.active, .server-btn:hover { background-color: #6D28D9; }

.player-card { background-color: #000; padding: 0 !important; }
.player-container { position: relative; width: 100%; padding-top: 56.25%; }
.player-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

.details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; text-align: center; }
.details-grid .detail-item .label { color: #6B7280; }
.details-grid .detail-item .value { font-weight: bold; font-size: 1.125rem; }


/* =========================================================
   Injected & Improved Sections
   ========================================================= */

.social-icons a svg,
.social-icons a svg *,
.social-icons a svg [fill]:not([fill="none"]),
.social-icons a svg [stroke] {
    fill: currentColor !important;
    stroke: currentColor !important;
}
.social-icons a {
    color: #8B5CF6 !important;
}
.social-icons a:hover svg {
    transform: translateY(-1px);
    transition: transform 0.15s ease;
}

.details-card .widget-title {
    margin-bottom: 1.25rem;
}
.details-grid .detail-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}
.details-grid .detail-item .label {
    color: #6B7280;
    font-weight: 600;
}
.details-grid .detail-item .label::after {
    content: " :";
    margin-left: 0.25rem;
}
.share-card .widget-title { margin-bottom: 0.75rem; }


/* =========================================================
   Responsive Design (for Mobiles & Tablets)
   ========================================================= */
/* This rule now applies to all screens up to 1024px wide */
@media (max-width: 1024px) {
    /* --- General Adjustments --- */
    body { font-size: 15px; }
    .container { padding: 0.75rem; }

    /* --- Header --- */
    .site-header { flex-direction: column; gap: 1rem; padding: 1rem; }
    .site-header .logo-text { font-size: 1.5rem; }
    .main-navigation ul { justify-content: center; gap: 1rem; }

    /* --- Titles --- */
    .section-title, .widget-title { font-size: 1.25rem; }
    .current-date { font-size: 1rem; }

    /* --- Match Card (Homepage) --- */
    .match-card .card-content { padding: 0.75rem; }
    .match-card .team-name { font-size: 1rem; margin: 0 0.5rem; }
    .match-card .team-logo { width: 2rem; height: 2rem; }
    .match-card .score-time { font-size: 1.25rem; width: auto; min-width: 4rem; flex-shrink: 0; }
    .match-card .card-status-box { width: auto; min-width: 4rem; padding: 0.25rem 0.5rem; font-size: 0.8rem; }

    /* --- Single Match Page (Horizontal Header) --- */
    .single-match .match-header-card {
        padding: 1rem 0.5rem;
    }
    .single-match .match-header-teams {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
        order: 0 !important;
    }
    .single-match .team-display {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
    }
    .single-match .team-display img {
        width: 3rem;
        height: 3rem;
        margin-bottom: 0;
    }
    .single-match .team-display .name {
        font-size: 0.9rem;
        line-height: 1.2;
        word-break: break-word;
    }
    .single-match .match-header-meta {
        flex: 0 0 auto;
        padding: 0 0.25rem;
        margin: 0;
    }
    .single-match .match-header-meta .score {
        font-size: 1.75rem;
        margin-bottom: 0.25rem;
    }
    .single-match .match-header-meta .status {
        font-size: 0.75rem;
        padding: 0.15rem 0.5rem;
        margin-top: 0;
    }

    /* --- Details Card (Stability Fixes) --- */
    .details-grid {
        grid-template-columns: 1fr;
        text-align: right;
        gap: 1.25rem;
    }
    .details-grid .detail-item {
        display: block;
        margin-bottom: 0;
    }
    .details-grid .detail-item .label {
        font-size: 0.9rem;
        font-weight: 600;
        color: #6B7280;
    }
    .details-grid .detail-item .label::after {
        content: "";
    }
    .details-grid .detail-item .value {
        font-size: 1.1rem;
        font-weight: bold;
        color: #1F2937;
        display: block;
    }

    /* --- Main Grid Layout --- */
    .main-grid { grid-template-columns: 1fr; }
    .main-content { order: 1; }
    .sidebar { order: 2; }
}


/* ==== Mobile overflow/jitter fix (sidebar summaries) ==== */
*, *::before, *::after { box-sizing: border-box; }

@media (max-width: 1024px) {
  /* امنع أي عنصر جانبي يطلع خارج العرض */
  .container,
  .main-content,
  .sidebar,
  .sidebar .widget,
  .summaries-container,
  .summary-card,
  .match-card {
    max-width: 100%;
    overflow-x: hidden;
  }

  /* تأكد إن عناصر الفليكس تقدر تصغر بدل ما تدفش العرض */
  .summary-card { min-width: 0; }
  .summary-card img { flex: 0 0 auto; }
  .summary-card .score {
    flex: 1 1 auto;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}



/**
 * =================================================================
 * KoraTrend - Final Homepage Design (vFinal-21 Full-Height Status Bar)
 * =================================================================
 */

/* ================== [ 1. تصميم الكمبيوتر ] ================== */
@media (min-width: 1025px) {
    body.home .matches-container {
        gap: 1.25rem;
    }
    body.home .match-card .card-content {
        padding: 1.25rem;
    }
    body.home .match-card .card-header {
        font-size: 1.1rem;
        margin-bottom: 0.6rem;
    }
    body.home .match-card .team-logo {
        width: 3.2rem;
        height: 3.2rem;
    }
    body.home .match-card .team-name {
        font-size: 1.4rem;
        margin: 0 1.25rem;
    }
    body.home .match-card .score-time {
        font-size: 1.9rem;
    }
    body.home .match-card .card-status-box {
        font-size: 1rem;
        width: 7rem;
    }
}

/* ================== [ 2. إصلاحات وتحسينات الجوال ] ================== */
@media (max-width: 1024px) {

    .match-card .team-name {
        white-space: normal;
        overflow-wrap: break-word;
        line-height: 1.25;
        font-size: 0.8rem; /* Fallback */
        font-size: clamp(0.5rem, 2.5vw, 0.9rem); 
    }

    /* <<-- التعديل الجديد هنا -->> */
    /* القاعدة العامة لجعل صندوق الحالة شريطاً عمودياً كاملاً */
    .match-card .card-status-box {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 4.5rem; /* عرض موحد لكل الحالات */
        min-width: 0;
        text-align: center;
        padding: 0.4rem 0.2rem;
        /* لا نضع height هنا، ليتم تمديده تلقائياً بطول البطاقة */
        font-size: 0.8rem; /* Fallback */
        font-size: clamp(0.5rem, 2.5vw, 0.8rem);
    }

    /* قاعدة خاصة لإخفاء كلمة "مباشر" فقط */
    .match-card .card-status-box:has(.live-dot) {
        font-size: 0 !important;
    }

    .match-card .card-status-box:has(.live-dot) .live-dot {
        margin: 0; /* نضمن توسط الدائرة داخل الشريط الطولي */
    }
    /* <<-- نهاية التعديل الجديد -->> */

    .match-card .card-body {
        align-items: center; 
    }
    
    .match-card .team {
        min-width: 0;
    }
}