/* css/pages/exercises.css */

/* --- 1. LAYOUT GLOBAL (Identique Play) --- */
.main-scroll-area {
    overflow: hidden !important;
    height: calc(100vh - var(--header-height));
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
}

.container {
    height: 100%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-wrapper {
    display: grid;
    grid-template-columns: auto 360px;
    gap: 80px; /* Espace aéré comme demandé */

    max-height: 100%;
    width: 100%;
    max-width: 1600px;

    align-items: center;
    justify-content: center;

    padding: 20px;
    box-sizing: border-box;
}

/* --- 2. ZONE ECHIQUIER --- */
.board-area {
    display: flex;
    justify-content: center;
    align-items: center;
}

.board-container {
    height: calc(100vh - var(--header-height) - 100px);
    width: calc(100vh - var(--header-height) - 100px);
    max-height: 720px;
    max-width: 720px;
    aspect-ratio: 1 / 1;
    position: relative;
    display: flex;
}

/* Utilise les styles de board.css pour l'intérieur,
   ici on gère juste le conteneur externe */
.board {
    width: 100% !important;
    height: 100% !important;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border-radius: 4px;
}

/* --- 3. PANNEAU DROIT --- */
.info-panel {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;

    height: calc(100vh - var(--header-height) - 100px);
    max-height: 720px;

    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

/* Header Stats */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}
.stat-box:first-child { border-right: 1px solid rgba(255,255,255,0.05); }

.label { font-size: 0.75rem; text-transform: uppercase; color: #94a3b8; font-weight: 700; margin-bottom: 4px; }
.value { font-size: 1.5rem; font-weight: 800; color: #fff; }
.value.fire { color: #fb923c; text-shadow: 0 0 15px rgba(251, 146, 60, 0.3); }

/* Info Puzzle Actif */
.active-puzzle-info {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    text-align: center;
}

.panel-title {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    color: #fff;
    text-transform: uppercase;
    font-weight: 800;
}

.panel-desc {
    margin: 0;
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Liste Scrollable */
.puzzle-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

/* Cartes Exercice */
.puzzle-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.puzzle-card:hover { background: rgba(255,255,255,0.08); transform: translateX(4px); }

.puzzle-card.active {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.1) 0%, transparent 100%);
    border-color: rgba(56, 189, 248, 0.3);
    border-left-color: #38bdf8;
}

.pc-icon { font-size: 1.2rem; }
.pc-info { flex: 1; display: flex; flex-direction: column; }
.pc-title { color: #f1f5f9; font-weight: 600; font-size: 0.95rem; }
.pc-elo { font-size: 0.8rem; color: #94a3b8; margin-top: 2px; }
.pc-elo.easy { color: #4ade80; }
.pc-elo.medium { color: #facc15; }
.pc-elo.hard { color: #f87171; }
.pc-status { color: #38bdf8; font-weight: bold; }

/* Footer */
.sidebar-footer {
    padding: 20px;
    background: rgba(0,0,0,0.2);
    border-top: 1px solid rgba(255,255,255,0.05);
}

.btn-full { width: 100%; display: block; }

/* RESPONSIVE */
@media (max-width: 950px) {
    .main-scroll-area { overflow-y: auto !important; height: auto; display: block; }
    .game-wrapper { grid-template-columns: 1fr; height: auto; display: block; gap: 30px; }
    .board-container { width: 100%; height: auto; aspect-ratio: 1/1; margin-bottom: 20px; max-height: 60vh; }
    .info-panel { height: auto; min-height: 400px; }
    .puzzle-list { max-height: 400px; }
}