/* public/assets/css/style.css */

/* IMPORTATION DE LA POLICE ROBOTO VIA GOOGLE FONTS */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

:root {
    --bg-site: #FFFCF4;          /* Fond crème clair */
    --bg-card: #ffffff;          /* Fond des cartes blanc pur */
    --text-main: #212320;        /* Texte couleur encre noire */
    --text-muted: #6e736d;       /* Texte secondaire gris atténué */
    
    /* Couleurs principales de la charte */
    --color-purple: #4C0297;     /* Violet */
    --color-red: #D1271C;        /* Rouge */
    --color-border: #e6e4dc;     /* Bordures légères */
}

/* BASE DU SITE & RESET RESPONSIVE */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-site);
    color: var(--text-main);
    padding: 15px;
    line-height: 1.5;
}

main {
    max-width: 1100px;
    margin: 0 auto;
    padding-top: 10px;
}

h2 {
    font-size: 1.6em;
    font-weight: 700;
    margin-top: 20px;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--color-purple);
    padding-bottom: 6px;
    color: var(--color-purple);
}

/* =========================================================================
   COMPOSANT : LA BARRE DE NAVIGATION (NAVBAR)
   ========================================================================= */
.main-navbar {
    display: flex;
    flex-direction: column; /* Par défaut sur Mobile : empilé */
    gap: 15px;
    background-color: var(--bg-card);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid var(--color-border);
}

.nav-brand {
    font-size: 1.4em;
    font-weight: 700;
    color: var(--color-purple);
    text-decoration: none;
    text-align: center;
}

.nav-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    list-style: none;
}

.nav-tabs a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.95em;
    transition: all 0.2s;
}

.nav-tabs a:hover {
    background-color: #f4f2ea;
    color: var(--text-main);
}

.nav-tabs a.active {
    background-color: var(--color-purple);
    color: #ffffff;
}

.nav-user-zone {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.nav-user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    background: #f4f2ea;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.9em;
}

.nav-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.nav-fiflouz {
    color: var(--color-red);
}

.nav-logout {
    color: var(--color-red);
    font-size: 0.85em;
    text-decoration: none;
    font-weight: 500;
}

.btn-nav-discord {
    background-color: #5865f2; /* On garde la couleur officielle Discord pour le bouton */
    color: white;
    padding: 10px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9em;
}

/* RESPONSIVE NAVBAR (Version Ordinateur) */
@media (min-width: 768px) {
    .main-navbar {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    .nav-brand { text-align: left; }
    body { padding: 25px; }
}

/* =========================================================================
   COMPOSANT : GRILLE DE PARIS & CARTES
   ========================================================================= */
.bet-container {
    display: grid;
    grid-template-columns: 1fr; /* 1 colonne sur mobile */
    gap: 20px;
}

@media (min-width: 640px) {
    .bet-container { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
}

.bet-card {
    background-color: var(--bg-card);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid var(--color-border);
}

.bet-target-date {
    font-size: 1.25em;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 15px;
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 8px;
}

/* LES 3 ONGLETS / BOUTONS DE SÉLECTION DE PARI */
.bet-tabs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.bet-tab-btn {
    background: #fcfbfa;
    border: 1px solid var(--color-border);
    color: var(--text-main);
    padding: 12px 15px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-family: 'Roboto', sans-serif;
    transition: all 0.2s;
}
.bet-tab-btn:hover {
    background: #f4f2ea;
}

.bet-tab-btn.selected {
    background: rgba(76, 2, 151, 0.06);
    border: 2px solid var(--color-purple);
}

.bet-tab-btn .tab-cote {
    background: #f4f2ea;
    color: var(--color-red);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 1em;
}
.bet-tab-btn.selected .tab-cote {
    background: var(--color-red);
    color: white;
}

/* ZONE DE FORMULAIRE ET MISES */
.wager-section {
    background: #fcfbfa;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid var(--color-border);
}
.wager-row {
    display: flex;
    gap: 10px;
}

input[type="number"], .btn-submit {
    padding: 12px;
    border-radius: 4px;
    border: 1px solid var(--color-border);
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 0.95em;
    outline: none;
}
input[type="number"] {
    flex: 1;
    text-align: center;
    background: #ffffff;
    color: var(--text-main)!important;
}
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.btn-submit {
    background-color: var(--color-purple);
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    min-width: 90px;
}
.btn-submit:hover {
    background-color: #3b0175;
}
.potential-gain {
    font-size: 0.85em;
    color: var(--color-red);
    margin-top: 10px;
    font-weight: 700;
}

/* =========================================================================
   COMPOSANTS : LISTES DE TICKETS ET LEADERBOARD
   ========================================================================= */
.ticket-list { display: flex; flex-direction: column; gap: 12px; }
.ticket-card {
    background-color: var(--bg-card); border-radius: 6px; padding: 15px;
    display: flex; flex-direction: column; gap: 12px;
    border: 1px solid var(--color-border); box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
@media (min-width: 500px) {
    .ticket-card { flex-direction: row; justify-content: space-between; align-items: center; }
}
.ticket-details { display: flex; flex-direction: column; gap: 4px; }
.ticket-target-date { font-weight: 700; font-size: 1.1em; color:var(--text-main)}
.ticket-choice { font-size: 0.95em; color: var(--text-muted); }
.ticket-choice strong { color: var(--text-main); }
.ticket-meta { font-size: 0.85em; color: var(--text-muted); }
.ticket-financials { display: flex; flex-direction: row; justify-content: space-between; align-items: center; gap: 10px; }
@media (min-width: 500px) {
    .ticket-financials { flex-direction: column; align-items: flex-end; text-align: right; }
}
.ticket-wager { font-size: 0.85em; color: var(--text-muted); }
.ticket-payout { font-weight: 700; font-size: 1.1em; color: var(--color-red); }

/* BADGES TICKETS */
.status-badge { display: inline-block; padding: 4px 8px; border-radius: 4px; font-size: 0.75em; font-weight: 700; text-transform: uppercase; }
.status-pending { background: #f4f2ea; color: var(--text-main); border: 1px solid var(--color-border); }
.status-won { background: rgba(59, 165, 93, 0.1); color: #3ba55d; border: 1px solid #3ba55d; }
.status-lost { background: rgba(209, 39, 28, 0.1); color: var(--color-red); border: 1px solid var(--color-red); }

/* CLASSEMENT (TABLEAU) */
.leaderboard-table {
    width: 100%; border-collapse: collapse; margin-top: 15px;
    background-color: var(--bg-card); border-radius: 8px; overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04); border: 1px solid var(--color-border);
}
.leaderboard-table th { background-color: #fcfbfa; color: var(--text-muted); text-align: left; padding: 12px 15px; font-size: 0.85em; text-transform: uppercase; border-bottom: 1px solid var(--color-border); }
.leaderboard-table td { padding: 12px 15px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.col-rank { width: 60px; text-align: center; }
.col-player { display: flex; align-items: center; gap: 10px; }
.col-money { text-align: right; font-weight: 700; color: var(--color-red); }
.leaderboard-avatar { width: 28px; height: 28px; border-radius: 50%; background: #f4f2ea; }
.rank-badge { display: inline-block; width: 24px; height: 24px; line-height: 24px; border-radius: 50%; text-align: center; font-size: 0.85em; font-weight: 700; }
.rank-1 { background: rgba(250,168,26,0.15); color: #faa81a; }
.rank-2 { background: #f4f2ea; color: var(--text-muted); }
.rank-3 { background: rgba(230,126,34,0.15); color: #e67e22; }
.current-user-row td { background-color: rgba(76, 2, 151, 0.04) !important; font-weight: 500; }

/* DESIGN COMPTE À REBOURS ET JAUGE LIVE */
.spec-live-card {
    align-items: flex-start !important; /* Aligne le contenu en haut pour la jauge */
}

.ticket-countdown {
    font-size: 0.9em;
    font-weight: 700;
    color: var(--color-red);
    background: rgba(209, 39, 28, 0.05);
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 2px;
    margin-bottom: 8px;
    border: 1px solid rgba(209, 39, 28, 0.15);
}

/* Structure de la jauge */
.live-gauge-container {
    margin-top: 15px;
    width: 100%;
    max-width: 450px;
}

.gauge-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    margin-bottom: 5px;
}

.gauge-bar-bg {
    position: relative;
    height: 12px;
    background: #e6e4dc;
    border-radius: 10px;
    overflow: visible; /* Permet aux marqueurs de dépasser légèrement */
}

.gauge-bar-fill {
    height: 100%;
    background: var(--color-purple);
    border-radius: 10px;
    transition: width 0.5s ease-in-out;
}

/* Les petits traits repères pour les bornes */
.gauge-marker {
    position: absolute;
    top: -2px;
    width: 3px;
    height: 16px;
    background: var(--text-main);
    z-index: 2;
}
.gauge-marker.marker-min { background: var(--color-purple); }
.gauge-marker.marker-max { background: var(--color-red); }

.gauge-legend {
    position: relative;
    height: 15px;
    font-size: 0.75em;
    color: var(--text-muted);
    margin-top: 2px;
}
.gauge-legend span {
    position: absolute;
    transform: translateX(-50%);
}
/* AJUSTEMENTS POUR L'ÉCHELLE COMPACTE */
.gauge-legend {
    position: relative;
    height: 35px; /* On augmente la hauteur pour laisser respirer le texte sous la jauge */
    color: var(--text-muted);
    margin-top: 5px;
}

.gauge-legend span {
    position: absolute;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 0.72em;
    font-weight: 500;
}

/* Différenciation visuelle entre les objectifs et les bornes de l'échelle */
.gauge-legend .legend-scale-val {
    color: #a3a8a2;
    font-weight: 300;
    top: 18px; /* Un poil plus bas pour éviter les télescopages */
}

.gauge-legend .legend-marker-val {
    color: var(--text-main);
    font-weight: 700;
    top: 4px;
}

.bet-card.closed {
    opacity: 0.6;
    filter: grayscale(1);
    pointer-events: none; /* Empêche les clics sur toute la carte */
    background-color: #e0e0e0;
}
.bet-card.closed .bet-tab-btn,
.bet-card.closed .btn-submit,
.bet-card.closed .amount-input {
    cursor: not-allowed;
}
#myChart {
    touch-action: none; /* Empêche le scroll mobile/tactile sur le graphique */
}
.live-stats-bar {
            background: var(--bg-card);
            padding: 15px;
            border-radius: 8px;
            display: flex;
            justify-content: space-around;
            border: 1px solid var(--color-border);
            margin-bottom: 20px;
            font-family: 'Roboto', sans-serif;
        }
        .stat-item { text-align: center; }
        .stat-value { font-size: 1.2em; font-weight: bold; color: var(--color-purple); }
        .stat-label { font-size: 0.8em; color: var(--text-muted); text-transform: uppercase; }