/* ============================================================
   BASE MOBILE-FIRST (smartphone)
   ============================================================ */

.at-dashboard-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0px;
    box-sizing: border-box;
}

.at-dashboard-wrapper > * {
    min-width: 0;
}

.at-stats-grid-main + .at-stats-grid-main {
    margin-top: 15px;
}

/* Empêche les cartes de forcer la largeur */
.at-stats-grid-main,
.at-stats-grid-main > *,
.at-stat-card {
    min-width: 0;
}

/* Espace entre les deux lignes */
.at-stats-grid-main + .at-stats-grid-main {
    margin-top: 20px;
}

/* ============================================================
   Pavé numérique
   ============================================================ */
/* Style du Pavé Tactile Score */
.at-score-picker {
    position: fixed;
    bottom: -100%; /* Caché par défaut */
    left: 0;
    width: 100%;
    background: #f8f9fa;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.2);
    transition: bottom 0.3s ease;
    z-index: 9999;
    padding: 15px;
    border-radius: 20px 20px 0 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    box-sizing: border-box;
}

.at-score-picker.active {
    bottom: 0; /* On l'affiche */
}

/* Couleurs des boutons */
.at-btn-score {
    height: 60px;
    border: none;
    border-radius: 10px;
    font-weight: bold;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-yellow { background-color: #FFD700; color: #000; }
.btn-red    { background-color: #FF0000; color: #fff; }
.btn-blue   { background-color: #0000FF; color: #fff; }
.btn-black  { background-color: #000000; color: #fff; }
.btn-white  { background-color: #FFFFFF; color: #000; border: 1px solid #ccc; }
.btn-miss   { background-color: #CCCCCC; color: #000; }

/* Overlay pour fermer en cliquant à côté */
.at-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    z-index: 9998;
}
.at-overlay.active { display: block; }

.at-volley-total {
    font-weight: bold;
    color: #007bff;
    font-size: 1.1rem;
    text-align: center;
}

.at-volley-number {
    font-weight: bold;
    color: #666;
    background: #f0f0f0;
    text-align: center;
    border-radius: 5px;
}

/* Version mobile : 1 colonne */
@media (max-width: 480px) {
    .at-stats-grid-main {
        grid-template-columns: 1fr;
    }

    .at-stat-card {
        padding: 10px;
    }
}

/* ============================================================
   Progress bar
   ============================================================ */
.at-progress {
    margin-bottom: 30px;
}

.at-progress h3 {
    margin-bottom: 10px;
    font-size: 20px;
    font-weight: 600;
    color: #111827;
}

.at-progress-bar {
    height: 14px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    display: flex;
	width: 100%;
    height: 10px;
    border-radius: 999px;
}

/* Progression */
.at-progress-wrapper {
    margin-bottom: 25px;
}

.at-progress-label {
    font-weight: 600;
    margin-bottom: 6px;
}

.at-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1f77b4, #2ca02c);
    width: 0%;
    transition: width 0.2s ease-out;
}


/* Cartes */
.at-card-container {
    background: #ffffff;
    padding: 25px;
    border-radius: 30px;
    border: 1px solid #eef0f2;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    width: 100%;
    box-sizing: border-box;
}

/* Titres */
.at-zone-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f3f4f6;
}
.at-radio-group {
	text-align: center;
}
/* ============================================================
   FORMULAIRE — MOBILE FIRST
   ============================================================ */

.at-form-row-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.at-form-row {
    display: flex;
    flex-direction: column;
    width: 100%;
	margin:10px 0 10px 0;
}

.at-form-row label {
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 14px;
    color: #374151;
}

.at-form input,
.at-form select,
.at-form textarea {
    padding: 10px 12px;
    border-radius: 15px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    font-size: 15px;
    width: 100%;
    box-sizing: border-box;
}

/* Bouton */
.at-submit-btn {
    background: #1f77b4;
    color: white;
    padding: 14px 35px;
    border-radius: 15px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.at-submit-btn:hover {
    background: #155a85;
    transform: translateY(-2px);
}

/* ============================================================
   TABLEAUX — WRAPPERS RESPONSIVE
   ============================================================ */

.at-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
	border-radius: 30px;
}

.at-table-wrapper table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
	text-align: center;
}

/* Tableau volées */
#at-volley-table th,
#at-volley-table td {
    padding: 10px;
    text-align: center;
	vertical-align: center;
	border: 1px solid #eaeaea; 
}

#at-volley-table th {
    background: #f3f4f6;
    font-weight: 600;
}

#at-volley-table tr:nth-child(even) {
    background: #fafafa;
}

#at-volley-table tr:hover {
    background: #eef2f7;
}

#at-score-table th, 
#at-score-table td {
	border: 1px solid #eaeaea;
}

#at-score-breakdown {
	border-radius: 30px;
	border: 1px solid #eaeaea;
}

#at-volley-builder {
	border-radius: 30px;
	border-top: 1px solid #eaeaea;
	border-bottom: 1px solid #eaeaea;
	margin: 20px 0 0 0;
}

/* Selects flèches */
select.at-arrow {
    padding: 8px 10px;
    border-radius: 20px;
    border: 1px solid #d1d5db;
    background-color: #ffffff;
    width: 60px; /* MOBILE */
    height: 42px;
    appearance: none;
    text-align: center;
    font-weight: 700;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 10px;
	margin: 0 auto;
}

/* Couleurs JS */
.at-arrow-val-X, .at-arrow-val-10, .at-arrow-val-9 { color: #d97706; }
.at-arrow-val-8, .at-arrow-val-7 { color: #dc2626; }

/* ============================================================
   STATS
   ============================================================ */

.at-stat-card {
    background: #fdf9f9;
    padding: 15px;
    border-radius: 30px;
    text-align: center;
    box-shadow: 0 5px 6px rgba(0,0,0,0.05);
    font-weight: 600;
}

.at-stat-card span {
    display: block;
    font-size: 22px;
    font-weight: 700;
    margin-top: 5px;
}

/* Grilles stats */
.at-stats-grid-main,
.at-stats-grid-secondary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    width: 100%;
	margin: 10px 0px 10px 0px;
}

/* ============================================================
   CHARTS RESPONSIVE
   ============================================================ */

canvas {
    width: 100% !important;
    height: auto !important;
}

/* ============================================================
   TABLETTE (min-width: 600px)
   ============================================================ */

@media (min-width: 600px) {

    .at-form-row-group {
        flex-direction: row;
    }

    .at-card-container {
        margin: 0 auto;
        width: 100%;
    }

    .at-stats-grid-main {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================================
   DESKTOP (min-width: 1024px)
   ============================================================ */

@media (min-width: 1024px) {

    .at-dashboard-wrapper {
        grid-template-columns: 65% 33%;
        grid-template-areas:
            "zone1 zone2"
            "zone1 zone4"
            "zone3 zone3";
    }

    .at-zone-1 { grid-area: zone1; }
    .at-zone-2 { grid-area: zone2; }
    .at-zone-3 { grid-area: zone3; }
    .at-zone-4 { grid-area: zone4; }

    .at-stats-grid-main {
        grid-template-columns: repeat(4, 1fr);
		
    }

    select.at-arrow {
        width: 80px; /* Version desktop */
    }
}
