/**
 * Foostradamus Dashboard - Styles CSS
 * Mobile-first, thème sombre/clair
 */

/* ==================== Variables ==================== */
:root {
    /* Thème sombre (défaut) */
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --bg-hover: #1f2b4a;

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent-primary: #4ade80;
    --accent-secondary: #3b82f6;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --accent-success: #22c55e;

    --border-color: rgba(255, 255, 255, 0.1);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    --nav-height: 60px;
    --header-height: 56px;
}

/* Thème clair */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;

    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --border-color: rgba(0, 0, 0, 0.1);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* ==================== Reset & Base ==================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom));
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent-secondary);
    text-decoration: none;
}

/* ==================== Header ==================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-md);
    z-index: 100;
}

.header-title {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.header-title span {
    color: var(--accent-primary);
}

.header-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.btn-icon {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-hover);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: var(--accent-secondary);
}

/* ==================== Main Content ==================== */
.main {
    padding-top: var(--header-height);
    min-height: 100vh;
}

.page {
    display: none;
    padding: var(--spacing-md);
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

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

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
}

/* ==================== Cards ==================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.card-value {
    font-size: 2rem;
    font-weight: 700;
}

.card-value.positive {
    color: var(--accent-success);
}

.card-value.negative {
    color: var(--accent-danger);
}

/* ==================== Stats Grid ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    text-align: center;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==================== Match Cards ==================== */
.match-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.match-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.match-card.value-bet {
    border-left: 4px solid var(--accent-primary);
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.match-competition {
    font-weight: 500;
}

.match-time {
    background: var(--bg-hover);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.match-teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
}

.team {
    flex: 1;
    text-align: center;
}

.team-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: var(--spacing-xs);
}

.match-vs {
    font-weight: 700;
    color: var(--text-muted);
}

.match-odds {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

.odd {
    text-align: center;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    min-width: 50px;
}

.odd-label {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.odd-value {
    font-weight: 600;
    font-size: 0.9rem;
}

/* ==================== Pick Cards ==================== */
.pick-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-hover) 100%);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--accent-primary);
    position: relative;
    overflow: hidden;
}

.pick-card::before {
    content: 'VALUE BET';
    position: absolute;
    top: 10px;
    right: -30px;
    background: var(--accent-primary);
    color: var(--bg-primary);
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 40px;
    transform: rotate(45deg);
}

.pick-match {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.pick-prediction {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.pick-type {
    background: var(--accent-secondary);
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.pick-value {
    font-weight: 700;
    font-size: 1.1rem;
}

.pick-details {
    display: flex;
    justify-content: space-between;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

.pick-detail {
    text-align: center;
}

.pick-detail-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.pick-detail-value {
    font-weight: 600;
}

.pick-detail-value.high {
    color: var(--accent-success);
}

/* ==================== Home Page Modules ==================== */

/* Module 1: Résultats d'hier */
.module-yesterday .yesterday-summary {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.yesterday-list {
    max-height: 280px;
    overflow-y: auto;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item.won {
    border-left: 3px solid var(--accent-success);
}

.result-item.lost {
    border-left: 3px solid var(--accent-danger);
}

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

.result-match {
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-prediction {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.result-cote {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.result-icon {
    font-size: 1.2rem;
}

/* Module 2: Picks du jour */
.pick-mini {
    padding: 14px;
    margin-bottom: 10px;
    background: var(--bg-hover);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent-primary);
}

.pick-mini:last-child {
    margin-bottom: 0;
}

.pick-mini-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.pick-mini-competition {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pick-mini-time {
    font-size: 0.75rem;
    color: var(--accent-primary);
    font-weight: 600;
}

.pick-mini-match {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.pick-mini-prediction {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.pick-mini-type {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.pick-mini-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-primary);
}

.pick-mini-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.pick-mini-cote {
    font-size: 0.9rem;
    font-weight: 700;
}

.pick-mini-confiance {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.pick-mini-confiance.high {
    color: var(--accent-success);
    font-weight: 600;
}

/* Module Top Picks */
.module-top-picks {
    border: 1px solid rgba(250, 204, 21, 0.2);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(250, 204, 21, 0.03) 100%);
}

.top-picks-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: #facc15;
    background: rgba(250, 204, 21, 0.15);
    padding: 3px 10px;
    border-radius: 12px;
}

.top-pick-item {
    display: flex;
    gap: 12px;
    padding: 14px;
    margin-bottom: 10px;
    background: var(--bg-hover);
    border-radius: var(--radius-md);
    border-left: 3px solid #facc15;
    position: relative;
}

.top-pick-item:last-child { margin-bottom: 0; }
.top-pick-item.won { border-left-color: var(--accent-primary); }
.top-pick-item.lost { border-left-color: var(--accent-danger, #ef4444); opacity: 0.8; }

.top-pick-rank {
    font-size: 1.4rem;
    display: flex;
    align-items: flex-start;
    padding-top: 2px;
}

.top-pick-body { flex: 1; }

.top-pick-result {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
}

.top-pick-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.top-pick-competition {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.top-pick-time {
    font-size: 0.75rem;
    color: #facc15;
    font-weight: 600;
}

.top-pick-match {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 6px;
}

.top-pick-prediction {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
}

.top-pick-type {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.top-pick-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-primary);
}

.top-pick-meta {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
}

.top-pick-cote { color: var(--text-secondary); font-weight: 500; }
.top-pick-confiance { color: var(--accent-primary); }
.top-pick-confiance.high { color: #facc15; }

.top-pick-analyse {
    margin-top: 8px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
    font-style: italic;
}

/* Combi section */
.top-picks-combi { padding: 0 14px; }

.top-picks-combi-card {
    margin-top: 12px;
    padding: 12px 14px;
    background: rgba(250, 204, 21, 0.06);
    border: 1px solid rgba(250, 204, 21, 0.15);
    border-radius: var(--radius-md);
}

.combi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.combi-label {
    font-size: 0.85rem;
    font-weight: 600;
}

.combi-cote {
    font-size: 0.9rem;
    font-weight: 700;
    color: #facc15;
}

.combi-comment {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 8px;
    line-height: 1.4;
}

.combi-gains {
    display: flex;
    justify-content: space-around;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-top: 8px;
    border-top: 1px solid rgba(250, 204, 21, 0.1);
}

.combi-gains strong {
    color: var(--accent-primary);
}

/* Stats historiques */
.top-picks-stats { padding: 8px 14px; }

.top-picks-history {
    border-top: 1px solid var(--bg-hover);
    padding-top: 10px;
}

.history-main {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.history-details {
    display: flex;
    gap: 16px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.source-comparison {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed var(--bg-hover);
}

/* Module 3: Camembert */
.chart-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.chart-tab {
    padding: 8px 16px;
    border: none;
    background: var(--bg-hover);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
    font-weight: 500;
}

.chart-tab:hover {
    background: var(--bg-secondary);
}

.chart-tab.active {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.chart-container-home {
    height: 180px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chart-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 16px;
    font-size: 0.9rem;
}

.chart-stat-won {
    color: var(--accent-success);
    font-weight: 500;
}

.chart-stat-lost {
    color: var(--accent-danger);
    font-weight: 500;
}

/* ==================== Prediction Status ==================== */
.prediction-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.prediction-status.won {
    background: rgba(34, 197, 94, 0.2);
    color: var(--accent-success);
}

.prediction-status.lost {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-danger);
}

.prediction-status.pending {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-warning);
}

/* ==================== Charts ==================== */
.chart-container {
    position: relative;
    height: 250px;
    margin: var(--spacing-md) 0;
}

/* ==================== Tables ==================== */
.table-container {
    overflow-x: auto;
    margin: var(--spacing-md) 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

th, td {
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
}

tr:hover td {
    background: var(--bg-hover);
}

/* ==================== Navigation Bottom ==================== */
.nav-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
    flex: 1;
}

.nav-item:hover,
.nav-item.active {
    color: var(--accent-primary);
}

.nav-icon {
    font-size: 1.5rem;
    margin-bottom: 2px;
}

.nav-label {
    font-size: 0.65rem;
    font-weight: 500;
}

/* ==================== Login Page ==================== */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--spacing-xl);
    text-align: center;
}

.login-logo {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.login-subtitle {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
}

.pin-input {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.pin-digit {
    width: 50px;
    height: 60px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-primary);
    caret-color: var(--accent-primary);
}

.pin-digit:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.btn-primary {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    width: 100%;
    max-width: 250px;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.login-error {
    color: var(--accent-danger);
    margin-top: var(--spacing-md);
    font-size: 0.875rem;
}

/* ==================== Empty State ==================== */
.empty-state {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.empty-text {
    font-size: 0.9rem;
}

/* ==================== Loading ==================== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== Tabs ==================== */
.tabs {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-lg);
    overflow-x: auto;
    padding-bottom: var(--spacing-xs);
}

.tab {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.tab:hover {
    background: var(--bg-hover);
}

.tab.active {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

/* ==================== Badge ==================== */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-success { background: rgba(34, 197, 94, 0.2); color: var(--accent-success); }
.badge-danger { background: rgba(239, 68, 68, 0.2); color: var(--accent-danger); }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: var(--accent-warning); }
.badge-info { background: rgba(59, 130, 246, 0.2); color: var(--accent-secondary); }

/* ==================== Competition Filter Dropdown ==================== */
.competition-filter {
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.filter-dropdown {
    position: relative;
    width: 100%;
}

.filter-dropdown-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.filter-dropdown-btn:hover {
    border-color: var(--accent-secondary);
}

.filter-dropdown-btn.open {
    border-color: var(--accent-secondary);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.dropdown-label {
    flex: 1;
    text-align: left;
}

.dropdown-count {
    color: var(--text-muted);
    margin-right: var(--spacing-sm);
    font-size: 0.8rem;
}

.dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.filter-dropdown-btn.open .dropdown-arrow {
    transform: rotate(180deg);
}

.filter-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 2px solid var(--accent-secondary);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 50;
}

.filter-dropdown-menu.open {
    max-height: 400px;
    overflow-y: auto;
    opacity: 1;
}

.dropdown-option {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    transition: background 0.15s;
}

.dropdown-option:hover:not(.disabled) {
    background: var(--bg-hover);
}

.dropdown-option.active {
    background: var(--accent-secondary);
    color: white;
}

.dropdown-option.active .option-count {
    color: rgba(255, 255, 255, 0.8);
}

.dropdown-option.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.option-flag {
    font-size: 1rem;
    width: 24px;
    text-align: center;
}

.option-label {
    flex: 1;
    font-size: 0.85rem;
}

.option-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.dropdown-option.active .option-count {
    background: rgba(255, 255, 255, 0.2);
}

.dropdown-group {
    border-top: 1px solid var(--border-color);
}

.dropdown-group:first-of-type {
    border-top: none;
}

.dropdown-group-header {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 1;
}

/* ==================== Dropdown Mobile Optimizations ==================== */
@media (max-width: 480px) {
    .filter-dropdown-btn {
        padding: var(--spacing-sm);
        font-size: 0.85rem;
    }

    .dropdown-option {
        padding: var(--spacing-sm);
    }

    .option-label {
        font-size: 0.8rem;
    }

    .filter-dropdown-menu.open {
        max-height: 350px;
    }
}

/* Scrollbar styling for dropdown */
.filter-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.filter-dropdown-menu::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.filter-dropdown-menu::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

.filter-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ==================== League Filter Pills ==================== */
.filter-pills {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
}

.filter-pills::-webkit-scrollbar {
    display: none;
}

.league-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.league-pill:hover:not([disabled]) {
    border-color: var(--accent-secondary);
    color: var(--text-primary);
}

.league-pill.active {
    background: var(--accent-secondary);
    color: #fff;
    border-color: var(--accent-secondary);
}

.league-pill.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.league-pill .pill-flag {
    font-size: 0.85rem;
}

.league-pill .pill-count {
    font-size: 0.65rem;
    opacity: 0.7;
    margin-left: 2px;
}

.league-pill.active .pill-count {
    opacity: 0.9;
}

@media (max-width: 480px) {
    .league-pill {
        padding: 5px 10px;
        font-size: 0.7rem;
    }
}

/* ==================== League Section (in match list) ==================== */
.league-section {
    margin-bottom: var(--spacing-lg);
}

.league-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) 0;
    margin-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--accent-secondary);
}

.league-flag {
    font-size: 1.25rem;
}

.league-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.league-country {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.league-count {
    margin-left: auto;
    background: var(--bg-hover);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.league-matches {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* ==================== Period Sections ==================== */
.period-section {
    margin-bottom: var(--spacing-xl);
}

.period-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) 0;
    margin-bottom: var(--spacing-md);
    border-bottom: 3px solid var(--accent-primary);
    background: linear-gradient(90deg, rgba(74, 222, 128, 0.1) 0%, transparent 100%);
    padding-left: var(--spacing-sm);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

/* Big Matches Section */
.big-matches-section {
    margin-top: var(--spacing-xl);
}

.big-matches-header {
    border-bottom-color: var(--accent-warning);
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.15) 0%, transparent 100%);
}

.big-matches-header .period-label {
    color: var(--accent-warning);
}

.match-card.extended-match {
    border-left: 4px solid var(--accent-warning);
    opacity: 0.9;
}

.match-card.extended-match .match-time {
    background: var(--accent-warning);
    color: var(--bg-primary);
    font-weight: 600;
}

.period-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.period-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}


/* ==================== Match Predictions - Simplified Pills ==================== */
.match-predictions {
    margin-top: var(--spacing-sm);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.prediction-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--bg-hover);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    border-left: 3px solid var(--text-muted);
}

.prediction-pill.high {
    border-left-color: var(--accent-success);
}

.prediction-pill.medium {
    border-left-color: var(--accent-warning);
}

.prediction-pill.is-value {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.15) 0%, rgba(74, 222, 128, 0.05) 100%);
    border-left-color: var(--accent-primary);
}

.pill-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.pill-text {
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
}

.pill-cote {
    color: var(--accent-secondary);
    font-weight: 600;
}

.pill-conf {
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.prediction-pill.high .pill-conf {
    background: rgba(34, 197, 94, 0.2);
    color: var(--accent-success);
}

.prediction-pill.medium .pill-conf {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-warning);
}

.pill-value {
    background: var(--accent-primary);
    color: var(--bg-primary);
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

/* Legacy styles kept for compatibility */
.predictions-title {
    display: none;
}

.prediction-item,
.pred-header,
.pred-type,
.pred-choice,
.pred-cote,
.pred-conf,
.vb-badge,
.pred-analyse {
    display: none;
}

/* Commentaire d'analyse */
.match-analyse {
    margin-top: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent-secondary);
}

.analyse-text {
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--text-secondary);
    margin: 0;
    font-style: italic;
}

/* ==================== Responsive ==================== */
@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .main {
        max-width: 800px;
        margin: 0 auto;
    }

    .match-card {
        padding: var(--spacing-lg);
    }
}

/* ==================== Backtest Patterns ==================== */
.pattern-item {
    background: var(--bg-hover);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    border-left: 3px solid var(--accent-warning);
}

.pattern-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xs);
}

.pattern-type {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--accent-secondary);
}

.pattern-count {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-danger);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.pattern-desc {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.pattern-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
}

.pattern-adjust {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-warning);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.pattern-adjust.negative {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-danger);
}

.pattern-leagues {
    font-size: 1rem;
}

.backtest-info {
    padding: var(--spacing-md);
    text-align: center;
}

.backtest-info p {
    margin-bottom: var(--spacing-sm);
}

.backtest-info code {
    background: var(--bg-hover);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.85rem;
}

/* ==================== Utilities ==================== */
.text-success { color: var(--accent-success); }
.text-danger { color: var(--accent-danger); }
.text-warning { color: var(--accent-warning); }
.text-muted { color: var(--text-muted); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }

.hidden { display: none !important; }

/* ==================== Backtest Dashboard (Nouveau) ==================== */

/* Section 1: Résumé Global */
.bt-summary-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-hover) 100%);
}

.bt-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.bt-summary-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    text-align: center;
}

.bt-summary-item.bt-best {
    border-left: 3px solid var(--accent-success);
}

.bt-summary-item.bt-worst {
    border-left: 3px solid var(--accent-danger);
}

.bt-summary-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.bt-summary-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

/* Section 2: Tableau Marchés */
.bt-market-table {
    width: 100%;
}

.bt-market-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-xs);
    border-radius: var(--radius-sm);
    align-items: center;
}

.bt-market-row.bt-market-header {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
}

.bt-market-row.bt-rentable {
    background: rgba(34, 197, 94, 0.08);
}

.bt-market-row.bt-neutre {
    background: rgba(245, 158, 11, 0.08);
}

.bt-market-row.bt-eviter {
    background: rgba(239, 68, 68, 0.08);
}

.bt-market-cell {
    font-size: 0.85rem;
}

.bt-market-name {
    font-weight: 600;
}

.bt-positive {
    color: var(--accent-success);
    font-weight: 600;
}

.bt-neutral {
    color: var(--accent-warning);
    font-weight: 600;
}

.bt-negative {
    color: var(--accent-danger);
    font-weight: 600;
}

.bt-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.bt-badge-success {
    background: rgba(34, 197, 94, 0.2);
    color: var(--accent-success);
}

.bt-badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-warning);
}

.bt-badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-danger);
}

/* Section 3: Graphique Erreurs */
.bt-errors-chart {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.bt-error-bar {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    gap: var(--spacing-sm);
    align-items: center;
}

.bt-error-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bt-error-bar-container {
    height: 20px;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.bt-error-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-danger) 0%, #f87171 100%);
    border-radius: var(--radius-sm);
    transition: width 0.5s ease;
}

.bt-error-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 40px;
    text-align: right;
}

/* Section 4: Ajustements */
.bt-adjustments {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.bt-adjust-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.bt-adjust-condition {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.bt-adjust-action {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-warning);
    background: rgba(245, 158, 11, 0.15);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

/* Section 5: Recommandations */
.bt-recommendations {
    border: 1px solid var(--accent-primary);
}

.bt-reco-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.bt-reco-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.bt-reco-item.bt-reco-do {
    background: rgba(34, 197, 94, 0.08);
}

.bt-reco-item.bt-reco-dont {
    background: rgba(239, 68, 68, 0.08);
}

.bt-reco-icon {
    flex-shrink: 0;
    font-size: 1rem;
}

/* Section 6: Patterns count */
.bt-patterns-count {
    background: var(--accent-secondary);
    color: white;
    padding: 2px 10px;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
}

/* ==================== Backtest Responsive ==================== */
@media (max-width: 480px) {
    .bt-summary-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-sm);
    }

    .bt-summary-value {
        font-size: 1rem;
    }

    .bt-market-row {
        grid-template-columns: 1fr 0.8fr 0.8fr 1fr;
        gap: var(--spacing-xs);
        padding: var(--spacing-xs);
    }

    .bt-market-cell {
        font-size: 0.75rem;
    }

    .bt-badge {
        font-size: 0.55rem;
        padding: 2px 5px;
    }

    .bt-error-bar {
        grid-template-columns: 1fr 1.5fr auto;
    }

    .bt-error-label {
        font-size: 0.65rem;
    }

    .bt-error-bar-container {
        height: 16px;
    }

    .bt-adjust-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .bt-reco-item {
        font-size: 0.8rem;
    }
}

@media (min-width: 768px) {
    .bt-summary-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .bt-summary-value {
        font-size: 1.5rem;
    }

    .bt-error-bar {
        grid-template-columns: 150px 1fr auto;
    }

    .bt-error-label {
        text-align: left;
    }
}

/* ==================== Learning Status ==================== */
.learning-status-card {
    background: var(--bg-card);
    border-left: 3px solid var(--text-muted);
    padding: var(--spacing-sm) var(--spacing-md);
}

.learning-status-card.active {
    border-left-color: var(--accent-success);
}

.learning-status-grid {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.learning-status-indicator {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-weight: 600;
    font-size: 0.85rem;
}

.learning-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.learning-status-card.active .learning-dot {
    background: var(--accent-success);
    box-shadow: 0 0 6px var(--accent-success);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.learning-status-info {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==================== Bets History ==================== */
.history-summary {
    margin-bottom: var(--spacing-sm);
}

.history-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-sm);
    text-align: center;
}

.history-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.history-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.history-filters {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
}

.filter-pill {
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-pill:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.filter-pill.active {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
}

.filter-pill.filter-won.active {
    background: var(--accent-success);
    border-color: var(--accent-success);
}

.filter-pill.filter-lost.active {
    background: var(--accent-danger);
    border-color: var(--accent-danger);
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.history-table thead th {
    text-align: left;
    padding: 6px 8px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
}

.history-table tbody tr {
    border-bottom: 1px solid var(--bg-hover);
    transition: background 0.15s;
}

.history-table tbody tr:hover {
    background: var(--bg-hover);
}

.history-table tbody tr.bet-won {
    border-left: 3px solid var(--accent-success);
}

.history-table tbody tr.bet-lost {
    border-left: 3px solid var(--accent-danger);
}

.history-table td {
    padding: 8px;
    vertical-align: middle;
}

.col-date {
    color: var(--text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
}

.col-match {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.match-teams-short {
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--text-primary);
}

.match-score {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
}

.col-pred {
    font-size: 0.75rem;
    white-space: nowrap;
}

.col-cote {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--accent-secondary);
}

.col-result {
    display: flex;
    align-items: center;
    gap: 4px;
}

.result-badge {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.result-badge.won {
    background: rgba(34, 197, 94, 0.2);
    color: var(--accent-success);
}

.result-badge.lost {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-danger);
}

.result-gain {
    font-size: 0.75rem;
    font-weight: 600;
}

.bet-won-text { color: var(--accent-success); }
.bet-lost-text { color: var(--accent-danger); }

@media (max-width: 480px) {
    .history-table {
        font-size: 0.72rem;
    }

    .history-table td, .history-table th {
        padding: 6px 4px;
    }

    .match-teams-short {
        font-size: 0.72rem;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* ==================== Toast Notifications ==================== */
#toast-container {
    position: fixed;
    top: calc(var(--header-height) + var(--spacing-md));
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    pointer-events: none;
    width: calc(100% - var(--spacing-lg) * 2);
    max-width: 400px;
}

.toast {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    pointer-events: auto;
    border-left: 3px solid var(--accent-secondary);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success { border-left-color: var(--accent-success); }
.toast-error { border-left-color: var(--accent-danger); }
.toast-warning { border-left-color: var(--accent-warning); }

.toast-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.toast-success .toast-icon { color: var(--accent-success); }
.toast-error .toast-icon { color: var(--accent-danger); }
.toast-warning .toast-icon { color: var(--accent-warning); }
.toast-info .toast-icon { color: var(--accent-secondary); }

.toast-message {
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* ==================== Navigation Améliorée ==================== */
@media (max-width: 380px) {
    .nav-bottom {
        height: calc(var(--nav-height) + 4px);
    }

    .nav-icon {
        font-size: 1.25rem;
    }

    .nav-label {
        font-size: 0.55rem;
    }

    .nav-item {
        padding: var(--spacing-xs);
    }
}

/* ==================== Amélioration Lisibilité Mobile ==================== */
@media (max-width: 360px) {
    .page-title {
        font-size: 1.25rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .card-title {
        font-size: 0.9rem;
    }

    .team-name {
        font-size: 0.8rem;
    }

    .match-competition {
        font-size: 0.7rem;
    }
}

/* ==================== Pull to Refresh Indicator ==================== */
.ptr-indicator {
    position: fixed;
    top: var(--header-height);
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    background: var(--accent-primary);
    color: var(--bg-primary);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    transition: transform 0.3s ease;
    z-index: 99;
}

.ptr-indicator.visible {
    transform: translateX(-50%) translateY(0);
}

/* ==================== Loading Skeleton ==================== */
.skeleton {
    background: linear-gradient(90deg,
        var(--bg-hover) 25%,
        var(--bg-card) 50%,
        var(--bg-hover) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1em;
    width: 100%;
    margin-bottom: var(--spacing-xs);
}

.skeleton-text:last-child {
    width: 60%;
}

/* ==================== Active States Touch ==================== */
.btn-icon:active,
.tab:active,
.league-btn:active,
.nav-item:active {
    transform: scale(0.95);
}

.match-card:active {
    transform: scale(0.98);
}

/* ==================== Classements / Standings ==================== */
.standings-filter {
    margin-bottom: var(--spacing-md);
}

.standings-select {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--spacing-md) center;
    padding-right: 40px;
}

.standings-select:focus {
    outline: none;
    border-color: var(--accent-secondary);
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.standings-table th,
.standings-table td {
    padding: var(--spacing-sm) var(--spacing-xs);
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.standings-table th {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
}

.standings-table .col-pos {
    width: 30px;
    font-weight: 700;
}

.standings-table .col-team {
    text-align: left;
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.standings-table .col-stat {
    width: 28px;
}

.standings-table .col-pts {
    width: 35px;
    font-weight: 700;
    color: var(--accent-primary);
}

.standings-table .col-forme {
    width: 80px;
}

/* Zone colors */
.standings-table tr.zone-cl {
    background: rgba(34, 197, 94, 0.1);
}

.standings-table tr.zone-cl .col-pos {
    color: var(--accent-success);
}

.standings-table tr.zone-el {
    background: rgba(59, 130, 246, 0.1);
}

.standings-table tr.zone-el .col-pos {
    color: var(--accent-secondary);
}

.standings-table tr.zone-ecl {
    background: rgba(139, 92, 246, 0.1);
}

.standings-table tr.zone-ecl .col-pos {
    color: #8b5cf6;
}

.standings-table tr.zone-rel {
    background: rgba(239, 68, 68, 0.1);
}

.standings-table tr.zone-rel .col-pos {
    color: var(--accent-danger);
}

/* Forme badges */
.forme-badge {
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 700;
    margin: 0 1px;
}

.forme-badge.forme-v {
    background: var(--accent-success);
    color: white;
}

.forme-badge.forme-n {
    background: var(--accent-warning);
    color: white;
}

.forme-badge.forme-d {
    background: var(--accent-danger);
    color: white;
}

/* Hide columns on mobile */
@media (max-width: 600px) {
    .standings-table .hide-mobile {
        display: none;
    }

    .standings-table .col-team {
        max-width: 100px;
    }

    .standings-table th,
    .standings-table td {
        padding: var(--spacing-xs);
    }

    .standings-table {
        font-size: 0.75rem;
    }
}

/* ==================== Stats League Table ==================== */

.stats-league-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-top: var(--spacing-md);
}

.stats-league-table th,
.stats-league-table td {
    padding: var(--spacing-sm) var(--spacing-sm);
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.stats-league-table th {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-league-table .col-league {
    text-align: left;
    font-weight: 500;
    white-space: nowrap;
}

.stats-league-table .col-stat {
    font-variant-numeric: tabular-nums;
}

.stats-league-table tbody tr:hover {
    background: var(--bg-hover);
}

@media (max-width: 600px) {
    .stats-league-table {
        font-size: 0.78rem;
    }

    .stats-league-table th,
    .stats-league-table td {
        padding: var(--spacing-xs) var(--spacing-xs);
    }
}


/* ── Sous-onglets (Matchs / WC26) ───────────────────────────────────────── */

.sub-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding: 4px;
    background: var(--bg-secondary);
    border-radius: 10px;
}

.sub-tab {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.sub-tab.active {
    background: var(--accent-primary);
    color: #fff;
}

/* ── WC2026 ─────────────────────────────────────────────────────────────── */

.wc-countdown-card {
    background: linear-gradient(135deg, #1a3a6b 0%, #0d2044 100%);
    color: white;
    text-align: center;
}

.wc-countdown {
    padding: var(--spacing-md) 0 var(--spacing-sm);
}

.wc-countdown-number {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1;
    color: #f0c040;
}

.wc-countdown-label {
    font-size: 0.9rem;
    opacity: 0.85;
    margin-top: 4px;
}

.wc-countdown-date {
    font-size: 0.78rem;
    opacity: 0.6;
    margin-top: 2px;
}

.wc-data-status {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    padding: var(--spacing-sm) 0 var(--spacing-xs);
}

.wc-stat-pill {
    background: rgba(255,255,255,0.15);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 0.78rem;
}

/* Milestones */
.wc-milestone {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border-color);
}

.wc-milestone:last-child { border-bottom: none; }

.wc-milestone-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.wc-milestone-body { flex: 1; }

.wc-milestone-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.wc-milestone-title {
    font-weight: 600;
    font-size: 0.92rem;
    margin-bottom: 3px;
}

.wc-milestone-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.wc-milestone-tasks {
    margin-top: 6px;
    padding-left: 0;
    list-style: none;
}

.wc-milestone-tasks li {
    font-size: 0.78rem;
    color: var(--text-muted);
    padding: 1px 0;
}

.wc-milestone-tasks li::before { content: "→ "; }

/* Statuts */
.wc-milestone.done .wc-milestone-title { color: var(--success-color); }
.wc-milestone.urgent .wc-milestone-title { color: #f0a030; }
.wc-milestone.upcoming .wc-milestone-title { color: var(--text-primary); }
.wc-milestone.start .wc-milestone-title { color: #f0c040; font-size: 1rem; }

.wc-milestone-badge {
    font-size: 0.68rem;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: 6px;
    vertical-align: middle;
}

.badge-done { background: var(--success-color); color: white; }
.badge-urgent { background: #f0a030; color: white; }
.badge-soon { background: #4a90d9; color: white; }

/* Groupes */
.wc-groups-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.wc-group-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: var(--spacing-sm);
}

.wc-group-header {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.wc-group-team {
    font-size: 0.78rem;
    padding: 2px 0;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.wc-group-team:last-child { border-bottom: none; }

.wc-group-team.host { font-weight: 600; color: #f0c040; }

@media (max-width: 400px) {
    .wc-groups-grid { grid-template-columns: 1fr; }
    .wc-countdown-number { font-size: 2.8rem; }
}
