/* ===================================================================
   Match Prediction Plugin — Team Page Styles (mtp-*)
   RTL, responsive, professional sports design
   =================================================================== */

:root {
    --mtp-primary:      #1a56db;
    --mtp-primary-dark: #1345b7;
    --mtp-accent:       #f59e0b;
    --mtp-success:      #22c55e;
    --mtp-danger:       #ef4444;
    --mtp-text:         #111827;
    --mtp-text-2:       #374151;
    --mtp-text-3:       #6b7280;
    --mtp-text-4:       #9ca3af;
    --mtp-border:       #e5e7eb;
    --mtp-bg:           #f8fafc;
    --mtp-card-bg:      #ffffff;
    --mtp-radius:       12px;
    --mtp-shadow:       0 2px 8px rgba(0,0,0,.07), 0 0 0 1px rgba(0,0,0,.04);
    --mtp-shadow-lg:    0 8px 32px rgba(0,0,0,.12);
}

/* ── Reset ── */
.mtp-wrap *,
.mtp-wrap *::before,
.mtp-wrap *::after {
    box-sizing: border-box;
}

.mtp-wrap {
    font-family: 'Tahoma', 'Segoe UI', Arial, sans-serif;
    direction: rtl;
    color: var(--mtp-text);
    background: var(--mtp-bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════════════════════
   HERO
═══════════════════════════════════════════════════════════ */
.mtp-hero {
    position: relative;
    min-height: 320px;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 60%, #1a56db 100%);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    padding-bottom: 0;
    overflow: hidden;
}

.mtp-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10,15,40,.92) 0%, rgba(10,15,40,.55) 50%, rgba(10,15,40,.25) 100%);
}

.mtp-hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    gap: 28px;
    padding: 40px 24px 32px;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.mtp-hero-logo {
    flex-shrink: 0;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    border: 3px solid rgba(255,255,255,.3);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: var(--mtp-shadow-lg);
}

.mtp-hero-logo img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.mtp-hero-info {
    flex: 1;
    min-width: 0;
}

.mtp-hero-type {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--mtp-accent);
    background: rgba(245,158,11,.15);
    border: 1px solid rgba(245,158,11,.3);
    border-radius: 20px;
    padding: 3px 12px;
    margin-bottom: 8px;
}

.mtp-hero-name {
    font-size: clamp(24px, 4vw, 38px);
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 6px;
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(0,0,0,.4);
}

.mtp-hero-short {
    font-size: 15px;
    color: rgba(255,255,255,.6);
    display: block;
    margin-bottom: 12px;
}

.mtp-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mtp-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 13px;
    color: rgba(255,255,255,.9);
    backdrop-filter: blur(4px);
}

/* ═══════════════════════════════════════════════════════════
   CONTAINER
═══════════════════════════════════════════════════════════ */
.mtp-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

/* ═══════════════════════════════════════════════════════════
   INFO ROW
═══════════════════════════════════════════════════════════ */
.mtp-info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}

.mtp-info-card {
    flex: 1 1 180px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--mtp-card-bg);
    border: 1px solid var(--mtp-border);
    border-radius: var(--mtp-radius);
    padding: 14px 18px;
    box-shadow: var(--mtp-shadow);
    transition: transform .15s, box-shadow .15s;
}

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

.mtp-info-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.mtp-info-label {
    font-size: 11px;
    color: var(--mtp-text-3);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 3px;
}

.mtp-info-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--mtp-text);
}

/* ═══════════════════════════════════════════════════════════
   TABS
═══════════════════════════════════════════════════════════ */
.mtp-tabs-wrap {
    background: var(--mtp-card-bg);
    border: 1px solid var(--mtp-border);
    border-radius: var(--mtp-radius);
    box-shadow: var(--mtp-shadow);
    overflow: hidden;
}

.mtp-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    background: var(--mtp-bg);
    border-bottom: 2px solid var(--mtp-border);
    gap: 0;
}

.mtp-tabs::-webkit-scrollbar { display: none; }

.mtp-tab {
    flex-shrink: 0;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: 14px 20px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    color: var(--mtp-text-3);
    cursor: pointer;
    transition: color .15s, border-color .15s;
    white-space: nowrap;
    direction: rtl;
}

.mtp-tab:hover {
    color: var(--mtp-primary);
}

.mtp-tab.mtp-tab-active {
    color: var(--mtp-primary);
    border-bottom-color: var(--mtp-primary);
}

.mtp-tab-panel {
    display: none;
    padding: 24px;
    animation: mtpFadeIn .2s ease;
}

.mtp-tab-panel.mtp-tab-panel-active {
    display: block;
}

@keyframes mtpFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

/* ═══════════════════════════════════════════════════════════
   SECTION TITLE
═══════════════════════════════════════════════════════════ */
.mtp-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--mtp-text);
    margin: 0 0 16px;
    padding-right: 12px;
    border-right: 3px solid var(--mtp-primary);
}

/* ═══════════════════════════════════════════════════════════
   MATCHES LIST
═══════════════════════════════════════════════════════════ */
.mtp-matches-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
}

.mtp-match-row {
    background: var(--mtp-bg);
    border: 1px solid var(--mtp-border);
    border-radius: 10px;
    padding: 12px 16px;
    transition: box-shadow .15s;
}

.mtp-match-row:hover {
    box-shadow: var(--mtp-shadow-lg);
}

.mtp-match-tournament {
    font-size: 11px;
    color: var(--mtp-text-3);
    margin-bottom: 8px;
    font-weight: 600;
}

.mtp-match-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.mtp-match-team {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    flex: 1;
}

.mtp-match-team-2 {
    flex-direction: row-reverse;
    text-align: left;
}

.mtp-match-team a {
    color: var(--mtp-text);
    text-decoration: none;
    transition: color .12s;
}

.mtp-match-team a:hover {
    color: var(--mtp-primary);
}

.mtp-match-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 4px;
}

.mtp-match-vs {
    font-size: 12px;
    font-weight: 800;
    color: var(--mtp-text-4);
    letter-spacing: 1px;
    padding: 4px 12px;
    background: var(--mtp-border);
    border-radius: 20px;
    flex-shrink: 0;
}

.mtp-match-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    direction: rtl;
    gap: 5px;
    font-size: 20px;
    font-weight: 800;
    color: var(--mtp-primary);
    padding: 4px 16px;
    background: rgba(26,86,219,.08);
    border-radius: 8px;
    flex-shrink: 0;
    letter-spacing: 2px;
}

.mtp-match-score__team {
    direction: ltr;
    unicode-bidi: isolate;
}

.mtp-match-date {
    font-size: 12px;
    color: var(--mtp-text-3);
}

.mtp-match-status {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    margin-top: 6px;
}

.mtp-status-upcoming {
    background: rgba(245,158,11,.12);
    color: #b45309;
}

.mtp-status-live {
    background: rgba(34,197,94,.12);
    color: #15803d;
}

.mtp-status-finished {
    background: rgba(107,114,128,.1);
    color: var(--mtp-text-3);
}

/* ═══════════════════════════════════════════════════════════
   PLAYERS GRID
═══════════════════════════════════════════════════════════ */
.mtp-players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
}

.mtp-player-card {
    background: var(--mtp-bg);
    border: 1px solid var(--mtp-border);
    border-radius: 10px;
    overflow: hidden;
    text-align: center;
    transition: transform .15s, box-shadow .15s;
}

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

.mtp-player-photo {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.mtp-player-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mtp-player-placeholder {
    font-size: 40px;
}

.mtp-shirt-number {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: var(--mtp-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mtp-player-info {
    padding: 10px 8px;
}

.mtp-player-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--mtp-text);
    margin-bottom: 4px;
    line-height: 1.3;
}

.mtp-player-position {
    font-size: 11px;
    color: var(--mtp-primary);
    font-weight: 600;
    margin-bottom: 2px;
}

.mtp-player-nation,
.mtp-player-age {
    font-size: 11px;
    color: var(--mtp-text-3);
}

/* ═══════════════════════════════════════════════════════════
   STATS
═══════════════════════════════════════════════════════════ */
.mtp-stats-block {
    margin-bottom: 20px;
}

.mtp-stats-season {
    font-size: 14px;
    font-weight: 700;
    color: var(--mtp-text-2);
    margin-bottom: 12px;
    padding: 6px 14px;
    background: var(--mtp-border);
    border-radius: 20px;
    display: inline-block;
}

.mtp-stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.mtp-stat-item {
    flex: 1 1 80px;
    background: var(--mtp-bg);
    border: 1px solid var(--mtp-border);
    border-radius: 10px;
    padding: 14px 12px;
    text-align: center;
    transition: transform .12s;
}

.mtp-stat-item:hover {
    transform: translateY(-2px);
}

.mtp-stat-win  { border-top: 3px solid var(--mtp-success); }
.mtp-stat-draw { border-top: 3px solid var(--mtp-accent); }
.mtp-stat-loss { border-top: 3px solid var(--mtp-danger); }
.mtp-stat-pts  { border-top: 3px solid var(--mtp-primary); }

.mtp-stat-val {
    display: block;
    font-size: 26px;
    font-weight: 800;
    color: var(--mtp-text);
    line-height: 1.1;
    margin-bottom: 4px;
}

.mtp-stat-lbl {
    display: block;
    font-size: 11px;
    color: var(--mtp-text-3);
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════
   TROPHIES
═══════════════════════════════════════════════════════════ */
.mtp-trophies-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mtp-trophy-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, rgba(245,158,11,.06), rgba(245,158,11,.02));
    border: 1px solid rgba(245,158,11,.2);
    border-radius: 10px;
    padding: 14px 18px;
    transition: transform .12s;
}

.mtp-trophy-item:hover {
    transform: translateX(-3px);
    border-color: rgba(245,158,11,.4);
}

.mtp-trophy-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.mtp-trophy-info {
    flex: 1;
}

.mtp-trophy-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--mtp-text);
}

.mtp-trophy-comp {
    font-size: 12px;
    color: var(--mtp-text-3);
    margin-top: 2px;
}

.mtp-trophy-year {
    font-size: 20px;
    font-weight: 800;
    color: var(--mtp-accent);
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   ABOUT / DESCRIPTION
═══════════════════════════════════════════════════════════ */
.mtp-about-text {
    font-size: 15px;
    line-height: 1.8;
    color: var(--mtp-text-2);
    max-width: 780px;
    margin-bottom: 28px;
}

.mtp-about-text p {
    margin: 0 0 14px;
}

.mtp-tournaments-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.mtp-tournament-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--mtp-bg);
    border: 1px solid var(--mtp-border);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
}

.mtp-tournament-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.mtp-tournament-group {
    font-size: 11px;
    color: var(--mtp-text-3);
    background: var(--mtp-border);
    padding: 2px 8px;
    border-radius: 20px;
}

/* ═══════════════════════════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════════════════════════ */
.mtp-empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--mtp-text-3);
}

.mtp-empty-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.mtp-empty-state p {
    font-size: 15px;
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════
   ADMIN: team page management panel (used in WP admin area)
═══════════════════════════════════════════════════════════ */
.mtp-admin-pages-wrap { direction: rtl; }

.mtp-pages-table { width: 100%; border-collapse: collapse; }

.mtp-pages-table th,
.mtp-pages-table td {
    text-align: right;
    padding: 10px 14px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 13px;
}

.mtp-pages-table th {
    background: #f8fafc;
    font-weight: 700;
}

.mtp-team-page-status-yes  { color: #15803d; font-weight: 700; }
.mtp-team-page-status-no   { color: #9ca3af; }

.mtp-btn-sync {
    display: inline-block;
    padding: 5px 14px;
    background: #1a56db;
    color: #fff;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background .15s;
    font-family: inherit;
}

.mtp-btn-sync:hover { background: #1345b7; }

.mtp-btn-del-page {
    display: inline-block;
    padding: 5px 14px;
    background: #fee2e2;
    color: #b91c1c;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background .15s;
    font-family: inherit;
    margin-right: 6px;
}

.mtp-btn-del-page:hover { background: #fca5a5; }

.mtp-sync-all-wrap {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

#mtp-sync-status {
    font-size: 13px;
    color: #374151;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    .mtp-hero-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 32px 16px 24px;
    }

    .mtp-hero-meta {
        justify-content: center;
    }

    .mtp-info-card {
        flex: 1 1 100%;
    }

    .mtp-tab {
        padding: 11px 14px;
        font-size: 12px;
    }

    .mtp-tab-panel {
        padding: 16px;
    }

    .mtp-players-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }

    .mtp-match-team {
        font-size: 12px;
    }

    .mtp-match-logo {
        width: 22px;
        height: 22px;
    }

    .mtp-stats-grid {
        gap: 8px;
    }

    .mtp-stat-val {
        font-size: 20px;
    }
}

/* ── Inline team links in match cards ── */
.mpm-team-link {
    color: inherit;
    text-decoration: none;
    transition: color .12s;
}

.mpm-team-link:hover {
    color: var(--mpm-accent, #f59e0b);
}

.mpm-team-logo-link {
    display: contents;
    cursor: pointer;
}
