/* static/style.css */
:root {
    --bg-dark: #0b0708;
    --bg-sidebar: #480000;      /* Secondaire : Rouge foncé */
    --bg-topbar: #300005;
    --card-bg: #810000;         /* Primaire : Rouge vif distinct */
    --card-active-border: #120065; /* Tertiaire : Bleu électrique contrasté */
    --text-color: #ffffff;
    --font-main: 'Roboto', sans-serif;
    --accent-gold: #ffb703;
    --green-light: #2ec4b6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-color);
    font-family: var(--font-main);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: 60px;
}

/* --- BARRE DE NAVIGATION SUPÉRIEURE --- */
.topbar {
    background-color: var(--bg-topbar);
    height: 65px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 25px;
    border-bottom: 3px solid var(--card-active-border);
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}


.main-title {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.profile-pic {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid #fff;
    object-fit: cover;
}

.menu-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.lang-switcher {
    display: flex;
    gap: 6px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.25);
}

.lang-btn {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    padding: 7px 11px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
}

.lang-btn.active {
    background: var(--card-active-border);
    color: #fff;
}

.btn-menu {
    background-color: var(--card-bg);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
}

.btn-menu:hover {
    background-color: #b50000;
    transform: translateY(-1px);
}

.logout-btn {
    background-color: #222;
}

/* --- STRUCTURE PRINCIPALE --- */
.draft-layout {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* --- PANNEAU LATÉRAL GAUCHE --- */
.sidebar {
    width: 380px;
    background-color: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    border-right: 2px solid #1a0002;
    min-height: 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.sidebar-nav-inline {
    flex-direction: row;
    gap: 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.nav-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 22px 20px;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.sidebar-nav-inline .nav-btn {
    flex: 1;
    text-align: center;
    padding: 16px 10px;
    border-bottom: none;
    border-right: 1px solid rgba(0,0,0,0.2);
}

.sidebar-nav-inline .nav-btn:last-child {
    border-right: none;
}

.nav-btn:hover, .nav-btn.active {
    color: #fff;
    background-color: rgba(18, 0, 101, 0.4);
    border-left: 6px solid var(--card-active-border);
}

.timer-section {
    background-color: #2b0000;
    padding: 25px 20px;
    text-align: center;
    border-top: 3px solid var(--card-active-border);
    margin-top: auto;
}

.timer-section h2 {
    font-size: 1rem;
    letter-spacing: 2px;
    margin-bottom: 8px;
    color: rgba(255,255,255,0.6);
}

.timer-display {
    font-size: 2.5rem;
    font-weight: bold;
    font-family: monospace;
    color: #ff3344;
    text-shadow: 0 0 10px rgba(255,51,68,0.4);
}

/* --- ZONE DE CONTENU CENTRAL --- */
.draft-stage {
    flex: 1;
    position: relative;
    padding: 30px;
    overflow: hidden;
}

.sidebar-panels {
    flex: 1;
    overflow: hidden;
}

.sidebar-panel {
    height: 100%;
    overflow-y: auto;
    padding: 18px;
}

.sidebar-panel.hidden {
    display: none;
}

.panel-card {
    background: rgba(0,0,0,0.22);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 14px;
}

.panel-card h3 {
    margin-bottom: 10px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.panel-subtitle {
    color: rgba(255,255,255,0.65);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.kv-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.kv-item {
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    padding: 10px;
}

.kv-item .label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.55);
    margin-bottom: 4px;
}

.kv-item .value {
    font-size: 1rem;
    font-weight: 700;
}

.section-title {
    margin: 0 0 12px;
    font-size: 1.05rem;
}

.draft-container {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 50px;
    width: 100%;
    max-width: 950px;
}

/* --- ARCHITECTURE DES CARTES DE JOUEURS --- */
.card {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 30px 25px;
    width: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0,0,0,0.7);
    border: 2px solid transparent;
}

/* Carte centrale active */
.card.active-card {
    transform: scale(1.03);
    border-color: var(--card-active-border);
    box-shadow: 0 0 30px rgba(18, 0, 101, 0.6);
    position: relative;
}

/* Bordure verte d'encadrement en cas d'offre active */
.card.active-card.has-bidder #avatarFrame img {
    border: 4px solid var(--green-light);
    box-shadow: 0 0 15px var(--green-light);
}

/* File d'attente (à droite) */
.upcoming-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.column-title {
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.5);
    margin-bottom: 5px;
}

.card.locked-card {
    width: 250px;
    padding: 15px;
    opacity: 0.4;
    transform: scale(0.95);
    background-color: #330000;
}

/* --- ÉLÉMENTS INTERNES DES CARTES --- */
.card-badge img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.card-info h3 {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.sub-info {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.stats {
    font-size: 0.95rem;
    font-weight: bold;
    color: var(--accent-gold);
    margin-bottom: 20px;
    background: rgba(0,0,0,0.2);
    padding: 6px 12px;
    border-radius: 20px;
}

.price-section {
    margin-bottom: 20px;
}

.card-price {
    font-size: 2.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ecu-icon {
    width: 20px;
    height: 20px;
}

.bidder-name {
    font-size: 0.95rem;
    color: var(--green-light);
    font-weight: bold;
}

/* --- BOUTONS ET CONTROLES DE MISE --- */
.bid-controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-bid {
    background-color: var(--card-active-border);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-bid:hover {
    background-color: #1c0094;
    transform: translateY(-2px);
}

.manual-bid {
    display: flex;
    gap: 8px;
}

.manual-bid input {
    flex: 1;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 10px;
    color: white;
    border-radius: 6px;
    text-align: center;
}

.manual-bid button {
    background: #fff;
    color: #000;
    border: none;
    padding: 0 15px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
}

/* --- PAGES D'AUTHENTIFICATION --- */
.auth-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    background-color: var(--bg-sidebar);
    padding: 40px;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.auth-card h2 {
    margin-bottom: 25px;
    text-align: center;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}

.input-group label {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
}

.input-group input, .input-group select {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 12px;
    color: white;
    border-radius: 6px;
    font-size: 1rem;
}

.btn-submit {
    width: 100%;
    background-color: var(--card-active-border);
    color: white;
    border: none;
    padding: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
}

.btn-submit:hover {
    background-color: #1c0094;
}

.auth-switch {
    text-align: center;
    margin-top: 15px;
    font-size: 0.9rem;
}

.auth-switch a {
    color: var(--accent-gold);
}

/* --- ADMIN PANEL SPECIFIQUE --- */
.admin-grid-container {
    padding: 45px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 30px;
    overflow-y: auto;
    width: 100%;
}

.admin-card {
    background: #1c1113;
    border-radius: 8px;
    padding: 25px;
    border-top: 4px solid var(--card-bg);
}

.admin-card h2 {
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.control-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.btn-action {
    flex: 1;
    text-align: center;
    padding: 12px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 6px;
    color: white;
}

.start-btn { background: #2ec4b6; }
.pause-btn { background: #ff9f1c; }
.reset-btn { background: #e71d36; }

.io-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.btn-download {
    display: block;
    background: #333;
    color: white;
    padding: 10px;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    margin-bottom: 10px;
}

.btn-download:hover { background: #444; }

/* --- HISTORIQUE ET UTILS --- */
.history-log-box {
    width: 100%;
    max-width: 600px;
    background: rgba(0,0,0,0.4);
    padding: 20px;
    border-radius: 8px;
    height: 400px;
    display: flex;
    flex-direction: column;
}

.log-list {
    margin-top: 15px;
    overflow-y: auto;
    flex: 1;
}

.log-item {
    padding: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
}

.teams-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    width: 100%;
}

.teams-showcase.compact {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.streamer-team-card {
    background: #1c1113;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
}

.streamer-team-card h3 {
    border-bottom: 2px solid var(--card-bg);
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.team-player-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.team-player-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.95rem;
}

.team-empty {
    color: rgba(255, 255, 255, 0.65);
    font-style: italic;
    margin: 0;
}

.announcement-overlay,
.final-teams-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow: auto;
}

.announcement-card {
    width: min(560px, 95%);
    background: #170b0d;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 18px;
    padding: 28px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

.announcement-kicker {
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: var(--accent-gold);
    margin-bottom: 10px;
}

.announcement-card h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.announcement-card p {
    color: rgba(255,255,255,0.75);
}

.announcement-timer {
    margin-top: 18px;
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent-gold);
}

.final-teams-overlay {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
}

.final-teams-header {
    text-align: center;
    margin-bottom: 18px;
}

.final-teams-header h2 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.final-teams-grid {
    width: 100%;
}

.streamer-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 60px;
    background: rgba(20, 0, 2, 0.96);
    border-top: 2px solid var(--card-active-border);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 40;
    padding: 0 16px;
    overflow: hidden;
}

.streamer-banner-label {
    flex: 0 0 auto;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.55);
}

.streamer-banner-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    padding-bottom: 4px;
}

.streamer-pill {
    flex: 0 0 auto;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 8px 12px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.streamer-pill.active {
    background: rgba(255, 183, 3, 0.2);
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 1px rgba(255,183,3,0.35);
}

.pill-money {
    color: var(--accent-gold);
    font-weight: 700;
}

.pill-name {
    font-weight: 700;
}

.pill-tag {
    font-size: 0.78rem;
    opacity: 0.7;
}

.panel-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.player-block,
.history-row,
.team-summary-mini {
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 10px 12px;
}

.player-hdv-title {
    margin: 4px 0 8px;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.55);
}

.team-player-list.compact .team-player-item {
    font-size: 0.86rem;
}

.history-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.history-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.history-price {
    font-weight: 800;
    color: var(--accent-gold);
}

.muted {
    color: rgba(255,255,255,0.62);
}

.alert {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-weight: bold;
}
.alert.error { background-color: #e71d36; color: white; }
.alert.success { background-color: #2ec4b6; color: white; }

.badge { padding: 4px 8px; border-radius: 4px; font-size: 0.8rem; }
.badge.green { background: #2ec4b6; }
.badge.orange { background: #ff9f1c; }
.badge.red { background: #e71d36; }

.hidden { display: none !important; }