/* Custom CSS for Football Matches Plugin - Enhanced Front-end Layout */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&display=swap');

.fmp-matches-container {
    font-family: 'Cairo', sans-serif !important;
    direction: rtl;
}

/* General Match Container Styling */
.fmp-match {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #edf2f7;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.fmp-match:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-color: #e2e8f0;
}

.fmp-match-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Competition Badge */
.fmp-match-competition {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
}

.fmp-competition-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* Top Row Styling (Teams, Logos, Score) */
.fmp-match-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 15px;
}

/* Team Box Styling */
.fmp-team-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    text-align: center;
    position: relative;
}

.fmp-team-side-icon-wrapper {
    margin-bottom: -10px;
    z-index: 2;
}

.fmp-team-side-icon {
    font-size: 12px;
    background: #fff;
    padding: 4px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.fmp-team-logo-container {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 12px;
    padding: 8px;
    transition: transform 0.3s ease;
    border: 1px solid #f1f5f9;
}

.fmp-match:hover .fmp-team-logo-container {
    transform: scale(1.1);
}

.fmp-team-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.fmp-team-name {
    font-weight: 700;
    font-size: 1rem;
    color: #1e293b;
    margin: 0;
}

/* Match Result (Score Box) Styling */
.fmp-match-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 100px;
}

.fmp-score {
    background: #1e293b; /* Default dark */
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 2px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* Upcoming / Countdown State */
.fmp-status-upcoming .fmp-score,
.fmp-status-ns .fmp-score,
[data-status="NS"] .fmp-score {
    background: #fff7ed;
    color: #ea580c;
    border: 1px solid #ffedd5;
}

/* Live State */
.fmp-status-live .fmp-score,
[data-status="LIVE"] .fmp-score,
[data-status="HT"] .fmp-score {
    background: #e11d48;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(225, 29, 72, 0.3);
}

/* Finished State */
.fmp-status-ft .fmp-score,
[data-status="FT"] .fmp-score {
    background: #0f172a;
    color: #94a3b8;
}

/* Match Status Badge */
.fmp-match-status {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 5px;
}

.fmp-status-live {
    background: #fff1f2;
    color: #e11d48;
    border: 1px solid #ffe4e6;
    box-shadow: 0 0 10px rgba(225, 29, 72, 0.1);
}

.fmp-status-live i {
    color: #e11d48;
    font-size: 8px;
    animation: fmp-pulse 1.2s infinite;
}

.fmp-status-ft {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.fmp-status-ns {
    background: #f0fdf4;
    color: #22c55e;
    border: 1px solid #dcfce7;
}

/* Info Bar Styling */
.fmp-match-info-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    background: #f8fafc;
    padding: 12px;
    border-radius: 12px;
    margin-top: 15px;
}

.fmp-info-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #475569;
    font-weight: 600;
}

.fmp-info-icon {
    color: #94a3b8;
    font-size: 0.9rem;
}

/* Extra Info Section */
.fmp-extra-info {
    margin-top: 15px;
    padding: 10px;
    background: #fffbeb;
    border-right: 4px solid #f59e0b;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #92400e;
    text-align: center;
}

/* Countdown Styling */
.fmp-countdown {
    font-family: monospace;
    font-weight: 700;
    color: #f59e0b;
}

/* Animations */
@keyframes fmp-pulse {
    0% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.4); }
    70% { transform: scale(1.1); opacity: 0.7; box-shadow: 0 0 0 6px rgba(225, 29, 72, 0); }
    100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(225, 29, 72, 0); }
}

/* Responsive Design */
@media (max-width: 640px) {
    .fmp-match {
        padding: 12px;
    }
    
    .fmp-team-logo-container {
        width: 55px;
        height: 55px;
        padding: 6px;
    }
    
    .fmp-team-name {
        font-size: 0.85rem;
    }
    
    .fmp-score {
        font-size: 1.2rem;
        padding: 5px 10px;
        min-width: 70px;
    }

    .fmp-match-result {
        min-width: 80px;
    }
    
    .fmp-match-info-bar {
        grid-template-columns: 1fr 1fr;
        padding: 8px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .fmp-match-top-row {
        gap: 8px;
    }
    
    .fmp-team-logo-container {
        width: 45px;
        height: 45px;
        padding: 4px;
    }

    .fmp-team-name {
        font-size: 0.75rem;
        line-height: 1.2;
    }
    
    .fmp-score {
        font-size: 1rem;
        padding: 4px 8px;
        min-width: 60px;
        letter-spacing: 1px;
    }

    .fmp-match-result {
        min-width: 70px;
        gap: 4px;
    }

    .fmp-match-status {
        font-size: 0.65rem;
        padding: 2px 8px;
    }
    
    .fmp-match-info-bar {
        grid-template-columns: 1fr 1fr;
        gap: 5px;
        padding: 6px;
    }

    .fmp-info-item {
        font-size: 0.7rem;
    }
}

@media (max-width: 350px) {
    .fmp-match-info-bar {
        grid-template-columns: 1fr;
    }
}

/* ══════════════════════════════════════════════════════════════════════════
   هيدر المقالة التلقائية — خلفية ملعب + شعار الفريقين
══════════════════════════════════════════════════════════════════════════ */
.fmp-post-header-wrap {
    margin: 0 0 25px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.22);
}

.fmp-post-header-pitch {
    background:
        /* طبقة تدرج داكنة فوق الصورة */
        linear-gradient(135deg,
            rgba(0,20,60,0.88) 0%,
            rgba(0,40,104,0.82) 40%,
            rgba(0,80,30,0.80) 100%),
        /* نمط الملعب SVG */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='260' viewBox='0 0 400 260'%3E%3Crect width='400' height='260' fill='%23166534'/%3E%3Crect x='20' y='20' width='360' height='220' fill='none' stroke='rgba(255,255,255,0.35)' stroke-width='2'/%3E%3Ccircle cx='200' cy='130' r='40' fill='none' stroke='rgba(255,255,255,0.35)' stroke-width='2'/%3E%3Cline x1='200' y1='20' x2='200' y2='240' stroke='rgba(255,255,255,0.25)' stroke-width='1.5'/%3E%3Crect x='20' y='90' width='55' height='80' fill='none' stroke='rgba(255,255,255,0.35)' stroke-width='2'/%3E%3Crect x='325' y='90' width='55' height='80' fill='none' stroke='rgba(255,255,255,0.35)' stroke-width='2'/%3E%3Crect x='20' y='105' width='25' height='50' fill='none' stroke='rgba(255,255,255,0.25)' stroke-width='1.5'/%3E%3Crect x='355' y='105' width='25' height='50' fill='none' stroke='rgba(255,255,255,0.25)' stroke-width='1.5'/%3E%3Ccircle cx='200' cy='130' r='4' fill='rgba(255,255,255,0.6)'/%3E%3Ccircle cx='75' cy='130' r='4' fill='rgba(255,255,255,0.4)'/%3E%3Ccircle cx='325' cy='130' r='4' fill='rgba(255,255,255,0.4)'/%3E%3C/svg%3E")
        center/cover;
    padding: 28px 22px 22px;
    direction: rtl;
    position: relative;
}

/* شريط البطولة */
.fmp-post-hdr-comp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 18px;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.8);
    font-weight: 700;
    letter-spacing: 0.5px;
}
.fmp-post-hdr-comp-logo {
    width: 22px;
    height: 22px;
    object-fit: contain;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}

/* صف الفريقين + النتيجة */
.fmp-post-hdr-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

/* صندوق كل فريق */
.fmp-post-hdr-team {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}
.fmp-post-hdr-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    background: rgba(255,255,255,0.12);
    border-radius: 14px;
    padding: 8px;
    border: 2px solid rgba(255,255,255,0.18);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    transition: transform 0.3s;
}
.fmp-post-hdr-logo:hover { transform: scale(1.08); }
.fmp-logo-placeholder {
    width: 72px;
    height: 72px;
    background: rgba(255,255,255,0.1);
    border-radius: 14px;
    border: 2px solid rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.4);
    font-size: 28px;
}
.fmp-post-hdr-name {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.3;
    text-shadow: 0 2px 6px rgba(0,0,0,0.5);
    max-width: 120px;
}

/* صندوق النتيجة/الوقت المركزي */
.fmp-post-hdr-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 90px;
}
.fmp-post-hdr-scorebox {
    background: linear-gradient(135deg, #D4AF37, #f0cc58);
    color: #1a0a00;
    font-size: 1.8rem;
    font-weight: 900;
    padding: 10px 18px;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(212,175,55,0.45);
    letter-spacing: 2px;
    min-width: 80px;
    text-align: center;
    line-height: 1;
}
.fmp-post-hdr-date {
    color: rgba(255,255,255,0.7);
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
}

/* شريط معلومات الأسفل */
.fmp-post-hdr-meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.15);
}
.fmp-post-hdr-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.75);
    font-weight: 600;
}
.fmp-post-hdr-meta i { color: #D4AF37; }

/* قسم البث داخل المقالة */
.fmp-post-stream {
    margin: 22px 0;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.fmp-stream-heading {
    background: linear-gradient(135deg, #002868, #001540);
    color: #fff !important;
    padding: 12px 18px !important;
    margin: 0 !important;
    font-size: 1em !important;
    font-weight: 700 !important;
}
.fmp-stream-heading i { color: #D4AF37; }

/* كود الإعلان */
.fmp-post-ad {
    margin: 20px 0;
    text-align: center;
}

/* موبايل */
@media (max-width: 600px) {
    .fmp-post-hdr-logo, .fmp-logo-placeholder { width: 54px; height: 54px; padding: 6px; }
    .fmp-post-hdr-name { font-size: 0.82rem; max-width: 90px; }
    .fmp-post-hdr-scorebox { font-size: 1.4rem; padding: 8px 12px; min-width: 68px; }
    .fmp-post-hdr-meta { gap: 10px; }
    .fmp-post-hdr-meta span { font-size: 0.72rem; }
    .fmp-post-header-pitch { padding: 18px 14px 16px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   ودجت النتائج المباشرة [fmp_livescores]
══════════════════════════════════════════════════════════════════════════ */
.fmp-livescores-wrap {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    margin: 20px 0;
    background: #fff;
}
.fmp-livescores-header {
    background: linear-gradient(135deg, #1a0505, #3a0a0a);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    border-bottom: 2px solid #e11d48;
}
.fmp-ls-live-badge {
    margin-right: auto;
    font-size: 10px;
    font-weight: 800;
    color: #ef4444;
    background: rgba(239,68,68,0.12);
    border-radius: 8px;
    padding: 2px 8px;
    animation: fmp-pulse 1.4s infinite;
}
.fmp-ls-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    padding: 40px;
    color: #64748b;
    font-size: 13px;
}
.fmp-ls-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e2e8f0;
    border-top-color: #002868;
    border-radius: 50%;
    animation: fmp-spin 0.8s linear infinite;
}
@keyframes fmp-spin { to { transform: rotate(360deg); } }

/* جدول نتائج API */
.fmp-ls-api-wrap { padding: 14px; }
.fmp-ls-api-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Cairo', sans-serif;
    font-size: 13px;
    direction: rtl;
}
.fmp-ls-api-table thead tr {
    background: #f8fafc;
    color: #64748b;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
}
.fmp-ls-api-table th,
.fmp-ls-api-table td {
    padding: 9px 12px;
    border-bottom: 1px solid #f1f5f9;
    text-align: right;
}
.fmp-ls-api-table tr:hover td { background: #f8fafc; }
.fmp-ls-score {
    font-weight: 800;
    color: #e11d48;
    text-align: center !important;
    font-size: 15px;
    letter-spacing: 1px;
}
