/* Match Auto Manager - Match Center Styles */

:root {
    --mam-primary: #10b981;
    --mam-primary-dark: #059669;
    --mam-primary-glow: rgba(16, 185, 129, 0.25);
    --mam-danger: #ef4444;
    --mam-warning: #f59e0b;
    --mam-bg-card: #ffffff;
    --mam-bg-surface: #f8fafc;
    --mam-border: #e2e8f0;
    --mam-text-main: #0f172a;
    --mam-text-muted: #64748b;
    --mam-home-color: #2563eb;
    --mam-away-color: #dc2626;
    --mam-radius: 14px;
    --mam-font: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Match Center Wrapper */
.mam-match-center {
    font-family: var(--mam-font);
    direction: rtl;
    text-align: right;
    margin: 20px 0 35px 0;
    background: var(--mam-bg-card);
    border: 1px solid var(--mam-border);
    border-radius: var(--mam-radius);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    color: var(--mam-text-main);
    box-sizing: border-box;
}

.mam-match-center * {
    box-sizing: border-box;
}

/* Hero Header Card */
.mam-hero-card {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    padding: 24px 20px 20px 20px;
    position: relative;
    border-bottom: 2px solid rgba(255, 255, 255, 0.08);
}

/* League Bar */
.mam-league-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.mam-league-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.mam-round-label {
    opacity: 0.8;
    font-size: 12px;
}

/* Status Pill */
.mam-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.12);
}

.mam-status-live, .mam-status-halftime {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.mam-status-finished, .mam-status-ended, .mam-status-ended_penalty {
    background: rgba(100, 116, 139, 0.25);
    color: #cbd5e1;
}

.mam-status-not_started, .mam-status-upcoming {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.mam-minute-badge {
    background: #ef4444;
    color: #ffffff;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 12px;
}

/* Pulse Dot Animation */
.mam-pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    animation: mamPulse 1.6s infinite;
}

@keyframes mamPulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Scoreboard */
.mam-scoreboard {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 15px;
    margin: 15px 0 25px 0;
}

.mam-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.mam-crest-wrapper {
    width: 85px;
    height: 85px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.mam-crest {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.mam-crest-placeholder {
    font-size: 38px;
}

.mam-team-name {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: #ffffff;
    line-height: 1.3;
}

/* Score Digits Center */
.mam-score-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 130px;
}

.mam-score-digits {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 44px;
    font-weight: 900;
    font-family: monospace, sans-serif;
    color: #ffffff;
    line-height: 1;
    background: rgba(0, 0, 0, 0.25);
    padding: 10px 22px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.mam-score-sep {
    opacity: 0.5;
    font-weight: 400;
}

.mam-time-box {
    text-align: center;
    background: rgba(0, 0, 0, 0.25);
    padding: 10px 22px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mam-kickoff-time {
    display: block;
    font-size: 26px;
    font-weight: 800;
    color: #38bdf8;
}

.mam-vs-label {
    font-size: 13px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 1px;
}

.mam-penalty-score {
    font-size: 13px;
    margin-top: 8px;
    color: #fca5a5;
    font-weight: 600;
}

.mam-btn-refresh {
    margin-top: 10px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 11px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.mam-btn-refresh:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* Quick Meta Chips */
.mam-meta-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.mam-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.07);
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12px;
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.mam-chip-label {
    opacity: 0.7;
}

.mam-chip-val {
    font-weight: 600;
    color: #ffffff;
}

/* Tab Navigation */
.mam-tabs-nav {
    display: flex;
    background: var(--mam-bg-surface);
    border-bottom: 1px solid var(--mam-border);
    overflow-x: auto;
    scrollbar-width: none;
}

.mam-tabs-nav::-webkit-scrollbar {
    display: none;
}

.mam-tab-btn {
    flex: 1;
    min-width: 120px;
    padding: 14px 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--mam-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.mam-tab-btn:hover {
    color: var(--mam-primary-dark);
    background: rgba(0, 0, 0, 0.02);
}

.mam-tab-btn.active {
    color: var(--mam-primary-dark);
    border-bottom-color: var(--mam-primary);
    background: var(--mam-bg-card);
    font-weight: 700;
}

.mam-tab-stream {
    color: #dc2626 !important;
}

/* Tabs Body */
.mam-tabs-body {
    padding: 24px;
    background: var(--mam-bg-card);
}

.mam-tab-pane {
    display: none;
    animation: mamFadeIn 0.3s ease;
}

.mam-tab-pane.active {
    display: block;
}

@keyframes mamFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Empty State */
.mam-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--mam-text-muted);
}

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

.mam-empty-state p {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 6px 0;
    color: var(--mam-text-main);
}

.mam-empty-sub {
    font-size: 13px;
    opacity: 0.8;
}

/* 1. TIMELINE STYLES */
.mam-timeline-wrapper {
    position: relative;
    max-width: 650px;
    margin: 0 auto;
    padding: 10px 0;
}

.mam-timeline-list {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}

.mam-timeline-list::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: 58px;
    width: 2px;
    background: var(--mam-border);
}

.mam-timeline-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    position: relative;
    gap: 15px;
}

.mam-time-tag {
    min-width: 44px;
    font-size: 13px;
    font-weight: 700;
    color: var(--mam-text-muted);
    text-align: left;
    direction: ltr;
    padding-top: 4px;
}

.mam-event-icon-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--mam-bg-surface);
    border: 2px solid var(--mam-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    z-index: 1;
    flex-shrink: 0;
}

.mam-timeline-item.event-goal .mam-event-icon-circle {
    border-color: #10b981;
    background: #ecfdf5;
}

.mam-timeline-item.event-yellow-card .mam-event-icon-circle {
    border-color: #f59e0b;
    background: #fffbeb;
}

.mam-timeline-item.event-red-card .mam-event-icon-circle {
    border-color: #ef4444;
    background: #fef2f2;
}

.mam-event-content {
    background: var(--mam-bg-surface);
    border: 1px solid var(--mam-border);
    border-radius: 10px;
    padding: 10px 14px;
    flex-grow: 1;
    position: relative;
}

.mam-event-title {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--mam-text-muted);
    margin-bottom: 2px;
}

.mam-event-player {
    display: block;
    font-size: 15px;
    color: var(--mam-text-main);
}

.mam-event-sub-player {
    display: block;
    font-size: 12px;
    color: var(--mam-text-muted);
    margin-top: 3px;
}

.mam-event-team-pill {
    display: inline-block;
    margin-top: 6px;
    font-size: 11px;
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

/* 2. LINEUPS STYLES */
.mam-formations-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 15px;
    background: var(--mam-bg-surface);
    border: 1px solid var(--mam-border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    align-items: center;
}

.mam-form-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mam-form-home {
    text-align: right;
}

.mam-form-away {
    text-align: left;
}

.mam-form-team {
    font-size: 16px;
    font-weight: 800;
    color: var(--mam-text-main);
}

.mam-form-tactic {
    font-size: 13px;
    color: var(--mam-text-muted);
}

.mam-coach {
    font-size: 12px;
    color: var(--mam-text-muted);
    opacity: 0.9;
}

.mam-form-vs {
    font-weight: 800;
    font-size: 14px;
    color: var(--mam-text-muted);
    padding: 0 10px;
}

.mam-starting-xi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.mam-team-column {
    background: var(--mam-bg-surface);
    border: 1px solid var(--mam-border);
    border-radius: 12px;
    padding: 18px;
}

.mam-col-heading {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 14px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--mam-border);
    color: var(--mam-text-main);
}

.mam-bench-heading {
    font-size: 14px;
    font-weight: 700;
    margin: 20px 0 10px 0;
    padding-top: 10px;
    border-top: 1px dashed var(--mam-border);
    color: var(--mam-text-muted);
}

.mam-player-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mam-player-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.mam-player-item:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

.mam-player-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.mam-shirt-num {
    width: 26px;
    height: 26px;
    background: var(--mam-bg-card);
    border: 1px solid var(--mam-border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--mam-text-muted);
    flex-shrink: 0;
}

.mam-player-name {
    flex-grow: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--mam-text-main);
}

.mam-pos-pill {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
}

.mam-pos-g { background: #fef3c7; color: #b45309; }
.mam-pos-d { background: #dbeafe; color: #1d4ed8; }
.mam-pos-m { background: #e0e7ff; color: #4338ca; }
.mam-pos-f { background: #fee2e2; color: #b91c1c; }

/* 3. STATISTICS STYLES */
.mam-stats-wrapper {
    max-width: 700px;
    margin: 0 auto;
}

.mam-stats-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--mam-border);
    font-weight: 700;
}

.mam-stat-team-title.mam-team-home {
    text-align: right;
    color: var(--mam-home-color);
}

.mam-stat-team-title.mam-team-away {
    text-align: left;
    color: var(--mam-away-color);
}

.mam-stat-row {
    margin-bottom: 18px;
}

.mam-stat-values {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 14px;
}

.mam-stat-label {
    font-weight: 600;
    color: var(--mam-text-muted);
}

.mam-stat-num {
    font-weight: 700;
    font-size: 15px;
    min-width: 35px;
}

.mam-val-home {
    text-align: right;
    color: var(--mam-home-color);
}

.mam-val-away {
    text-align: left;
    color: var(--mam-away-color);
}

.mam-stat-progress {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    display: flex;
    overflow: hidden;
    gap: 2px;
}

.mam-bar-home {
    background: var(--mam-home-color);
    border-radius: 4px 0 0 4px;
    transition: width 0.4s ease;
}

.mam-bar-away {
    background: var(--mam-away-color);
    border-radius: 0 4px 4px 0;
    transition: width 0.4s ease;
}

/* 4. MATCH INFO GRID */
.mam-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

.mam-info-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--mam-bg-surface);
    border: 1px solid var(--mam-border);
    border-radius: 10px;
    padding: 14px 16px;
}

.mam-card-icon {
    font-size: 26px;
}

.mam-card-meta {
    display: flex;
    flex-direction: column;
}

.mam-card-title {
    font-size: 12px;
    color: var(--mam-text-muted);
    font-weight: 600;
    margin-bottom: 2px;
}

.mam-card-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--mam-text-main);
}

/* 5. STREAM CONTAINER */
.mam-stream-container {
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
    .mam-scoreboard {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .mam-score-center {
        order: -1;
    }

    .mam-starting-xi-grid {
        grid-template-columns: 1fr;
    }

    .mam-tabs-nav {
        justify-content: flex-start;
    }

    .mam-tab-btn {
        padding: 12px 14px;
        font-size: 13px;
    }

    .mam-info-grid {
        grid-template-columns: 1fr;
    }
}
