/* ============================================================
   Alba Match Tabs — Adaptive CSS
   Inherits theme font, respects dark/light mode automatically
   ============================================================ */

/* ── Adaptive tokens ──────────────────────────────────────── */
.alba-match-sections {
    --ab-bg:       rgba(0,0,0,0.06);
    --ab-surface:  rgba(0,0,0,0.10);
    --ab-border:   rgba(0,0,0,0.12);
    --ab-border2:  rgba(0,0,0,0.20);
    --ab-text:     inherit;
    --ab-muted:    rgba(128,128,128,0.9);
    --ab-accent:   #3b82f6;
    --ab-accent-t: rgba(59,130,246,0.12);
    --ab-gold:     #f59e0b;
    --ab-deep:     rgba(0,0,0,0.18);
    --ab-deep2:    rgba(0,0,0,0.08);
    --ab-pill-bg:  #1e3a5f;
    --ab-pill-txt: #93c5fd;
}

/* Dark mode overrides — auto-detect prefers-color-scheme */
@media (prefers-color-scheme: dark) {
    .alba-match-sections {
        --ab-bg:      rgba(255,255,255,0.04);
        --ab-surface: rgba(255,255,255,0.06);
        --ab-border:  rgba(255,255,255,0.09);
        --ab-border2: rgba(255,255,255,0.15);
        --ab-deep:    rgba(255,255,255,0.05);
        --ab-deep2:   rgba(255,255,255,0.03);
    }
}

/* Theme dark class fallbacks (popular WP themes) */
.dark .alba-match-sections,
.dark-mode .alba-match-sections,
[data-theme="dark"] .alba-match-sections,
body.dark .alba-match-sections,
body.dark-mode .alba-match-sections {
    --ab-bg:      rgba(255,255,255,0.04);
    --ab-surface: rgba(255,255,255,0.06);
    --ab-border:  rgba(255,255,255,0.09);
    --ab-border2: rgba(255,255,255,0.15);
    --ab-deep:    rgba(255,255,255,0.05);
    --ab-deep2:   rgba(255,255,255,0.03);
}

/* ── Base wrapper ─────────────────────────────────────────── */
.alba-match-sections {
    direction: rtl;
    /* Inherit everything from theme */
    font-family: inherit;
    font-size:   inherit;
    color:       inherit;
    margin: 0;
}

/* ================================================================
   TAB BAR
================================================================ */
.alba-tabs-nav {
    display: flex;
    background: var(--ab-bg);
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    border: 1px solid var(--ab-border);
    border-bottom: none;
    position: relative;
}

.alba-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 14px 10px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    /* Color inherits from theme */
    color: var(--ab-muted);
    font-size: .85em;       /* relative to theme font */
    font-weight: 700;
    font-family: inherit;   /* matches theme font */
    cursor: pointer;
    transition: color .2s, background .2s;
    white-space: nowrap;
    position: relative;
    outline: none;
    user-select: none;
    min-width: 0;
}

.alba-tab-btn:hover {
    color: currentColor;
    opacity: .85;
    background: var(--ab-surface);
}

.alba-tab-btn.alba-tab-active {
    color: var(--ab-accent);
    background: var(--ab-accent-t);
    border-bottom-color: var(--ab-accent);
}

/* Separator between tabs */
.alba-tab-btn + .alba-tab-btn::before {
    content: '';
    position: absolute;
    right: 0;
    top: 22%;
    height: 56%;
    width: 1px;
    background: var(--ab-border);
}

.alba-tab-icon  { font-size: 1em; line-height: 1; flex-shrink: 0; }
.alba-tab-label { font-weight: 700; }

/* ================================================================
   PANELS
================================================================ */
.alba-panels-wrap {
    background: var(--ab-bg);
    border: 1px solid var(--ab-border);
    border-top: none;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.alba-tab-panel       { display: none; }
.alba-panel-active    { display: block; animation: albaFadeUp .22s ease both; }
@keyframes albaFadeUp { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:translateY(0)} }

.alba-panel-content {
    padding: 20px 22px;
    font-family: inherit;
    font-size:   inherit;
    color:       inherit;
    line-height: inherit;
}

/* تاب التفاصيل: padding أكبر ومساحة أوسع */
.alba-panel-content.alba-details-panel,
.alba-section-body.alba-details-panel {
    padding: 28px 28px;
}

.alba-details-text * { font-family: inherit !important; }
.alba-details-text p:first-child { margin-top: 0; }
.alba-details-text p:last-child  { margin-bottom: 0; }
.alba-details-text { line-height: 1.8; font-size: 1em; }

/* ================================================================
   META CARD (watch link)
================================================================ */
.alba-content-meta {
    margin-top: 24px;
}

.alba-meta-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    background: var(--ab-surface);
    border-radius: 12px;
    border: 1px solid var(--ab-border);
    font-size: 1em;
    transition: border-color .2s, background .2s;
}
.alba-meta-row:hover {
    border-color: var(--ab-accent);
    background: var(--ab-accent-t);
}

.alba-meta-icon  { font-size: 1.4em; flex-shrink: 0; }
.alba-meta-label { color: var(--ab-muted); font-weight: 700; flex-shrink: 0; }
.alba-meta-value { font-weight: 700; color: inherit; flex: 1; text-align: left; }
.alba-meta-value a {
    color: var(--ab-accent);
    text-decoration: none;
    font-size: 1em;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.alba-meta-value a:hover { text-decoration: underline; }

/* ================================================================
   LOADING PULSE
================================================================ */
.alba-loading-pulse {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 44px 0;
}
.alba-loading-pulse span {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--ab-accent);
    animation: albaPulse 1.1s ease-in-out infinite;
}
.alba-loading-pulse span:nth-child(2) { animation-delay: .18s; }
.alba-loading-pulse span:nth-child(3) { animation-delay: .36s; }
@keyframes albaPulse {
    0%,100% { transform: scale(.5); opacity: .3; }
    50%      { transform: scale(1);  opacity: 1;  }
}

/* ================================================================
   EMPTY STATE
================================================================ */
.alba-section-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 40px;
    color: var(--ab-muted);
    font-size: .85em;
    text-align: center;
}
.alba-empty-icon { font-size: 1.8em; opacity: .4; }

/* ================================================================
   EVENTS LIST
================================================================ */
.alba-events-list {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.alba-event-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 13px;
    border-radius: 8px;
    background: var(--ab-surface);
    border: 1px solid transparent;
    font-size: .84em;
    transition: border-color .15s;
}
.alba-event-item:hover { border-color: var(--ab-border2); }
.alba-ev-away { flex-direction: row-reverse; }

.alba-ev-icon { font-size: 1.1em; flex-shrink: 0; }

.alba-ev-body {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}
.alba-ev-away .alba-ev-body { flex-direction: row-reverse; }

.alba-ev-min {
    background: var(--ab-pill-bg);
    color: var(--ab-pill-txt);
    font-size: .78em;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.alba-ev-player { font-weight: 600; color: inherit; }

/* ================================================================
   LINEUP
================================================================ */
.alba-lineup-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 560px) { .alba-lineup-wrap { grid-template-columns: 1fr; } }

.alba-lineup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .78em;
    font-weight: 700;
    color: var(--ab-gold);
    text-transform: uppercase;
    letter-spacing: .5px;
    padding-bottom: 8px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--ab-border);
}

.alba-formation {
    background: var(--ab-pill-bg);
    color: var(--ab-pill-txt);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: .9em;
    font-weight: 700;
    letter-spacing: 1px;
}

.alba-player-list {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.alba-player-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 7px;
    font-size: .82em;
    background: var(--ab-surface);
    transition: background .15s;
}
.alba-player-row:hover       { background: var(--ab-deep); }
.alba-player-row.alba-player-sub { opacity: .6; }

.alba-player-num {
    background: var(--ab-pill-bg);
    color: var(--ab-pill-txt);
    font-size: .75em;
    font-weight: 700;
    width: 22px; height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alba-player-name { flex: 1; font-weight: 600; color: inherit; }

.alba-player-pos {
    font-size: .72em;
    font-weight: 700;
    color: var(--ab-muted);
    background: var(--ab-deep2);
    padding: 2px 5px;
    border-radius: 4px;
}

.alba-player-divider {
    font-size: .78em;
    color: var(--ab-muted);
    text-align: center;
    padding: 7px 0;
    border-top: 1px solid var(--ab-border);
    margin-top: 4px;
    font-weight: 600;
}

/* ================================================================
   RESPONSIVE
================================================================ */
@media (max-width: 480px) {
    .alba-tab-btn     { padding: 12px 8px; gap: 5px; }
    .alba-tab-icon    { font-size: .9em; }
    .alba-tab-label   { font-size: .78em; }
    .alba-panel-content { padding: 14px 15px; }
}

/* Lineup col (JS-rendered grid children) */
.alba-lineup-col { min-width: 0; }

/* Captain badge */
.alba-player-cap {
    font-size: .75em;
    font-weight: 700;
    color: var(--ab-gold);
    margin-right: 3px;
    flex-shrink: 0;
}

/* Coach row */
.alba-coach {
    margin-top: 10px;
    padding: 8px 10px;
    background: var(--ab-surface);
    border-radius: 7px;
    font-size: .8em;
    color: var(--ab-muted);
    font-weight: 600;
    border: 1px solid var(--ab-border);
    text-align: center;
}

/* Events — names layout */
.alba-ev-names {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}
.alba-ev-secondary {
    font-size: .78em;
    color: var(--ab-muted);
    font-weight: 500;
}
