/* ==========================================================================
   MODULE TIR - OPTIMISÉ POUR THÈME COZIWEB
   ========================================================================== */

#tir-app { 
    font-family: var(--bs-font-sans-serif); 
    max-width: 600px; 
    margin: 20px auto; 
    color: var(--bs-secondary); 
}

/* Cartes et Conteneurs */
.tir-card { 
    background: var(--bs-white); 
    border-radius: 12px; 
    box-shadow: var(--bs-shadow); 
    padding: 25px; 
    margin-bottom: 20px; 
    border: 1px solid var(--bs-gray); 
}

.tir-card h2 { 
    font-weight: 700; 
    text-transform: uppercase; 
    border-bottom: 3px solid var(--bs-primary); 
    padding-bottom: 10px; 
    margin-bottom: 25px; 
    font-size: 1.4rem; 
}

/* Boutons */
.tir-btn { 
    background: var(--bs-blue); 
    color: #fff; 
    border: none; 
    padding: 15px; 
    border-radius: 8px; 
    font-weight: 600; 
    text-transform: uppercase; 
    cursor: pointer; 
    transition: var(--bs-transition); 
    width: 100%; 
    margin-bottom: 10px;
}

.tir-btn:hover { 
    background: var(--bs-primary-dark); 
    transform: translateY(-2px);
}

.btn-sec { background: var(--bs-secondary); }
.btn-warn { background: var(--bs-orange); }
.btn-save { background: var(--bs-success); margin-top: 20px; }
.btn-cancel { background: transparent; color: var(--bs-secondary); border: 1px solid var(--bs-gray); }
.btn-back { margin-top: 20px; background: var(--bs-secondary); }

/* Formulaire */
.config-box { 
    background: var(--bs-gray-light); 
    padding: 15px; 
    border-radius: 8px; 
    border: 1px solid var(--bs-gray); 
    margin-bottom: 15px; 
}

.tir-label { 
    display: block; 
    font-weight: 700; 
    margin-bottom: 5px; 
    font-size: 0.75rem; 
    text-transform: uppercase; 
    color: var(--bs-gray-dark); 
}

#tir-app select, #tir-app input, #tir-app textarea { 
    width: 100%; 
    padding: 12px; 
    margin-bottom: 12px; 
    border: 1px solid var(--bs-gray); 
    border-radius: 6px; 
    font-family: inherit;
}

/* HUD Action (Sticky en haut sur mobile) */
.tir-hud { 
    position: sticky; 
    top: 10px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    background: var(--bs-secondary); 
    color: #fff; 
    padding: 15px 20px; 
    border-radius: 10px; 
    margin-bottom: 20px; 
    z-index: 100;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

#score-val { 
    font-size: 24px; 
    font-weight: 800; 
    color: var(--bs-primary); 
}

.small-meta { font-size: 0.75rem; opacity: 0.8; line-height: 1.2; }
.cyan { color: var(--bs-cyan); }

/* Exercices et Grille */
.tir-ex-box { 
    background: var(--bs-white); 
    border: 1px solid var(--bs-gray); 
    border-radius: 10px; 
    padding: 15px; 
    margin-bottom: 15px; 
}

.tir-ex-name { font-weight: 700; text-transform: uppercase; font-size: 1.1rem; }
.tir-badge { 
    background: var(--bs-primary); 
    color: var(--bs-secondary); 
    font-size: 0.7rem; 
    padding: 2px 10px; 
    border-radius: 20px; 
    font-weight: 800; 
}

.tir-grid { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 10px; 
    margin-top: 15px;
}

.tir-dot {
    width: 65px; 
    height: 65px; 
    border: 1px solid var(--bs-gray);
    background: var(--bs-white); 
    border-radius: 8px; 
    cursor: pointer;
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
    transition: var(--bs-transition);
}

.tir-dot .n { font-size: 1.2rem; font-weight: 800; }
.tir-dot .l { font-size: 0.6rem; text-transform: uppercase; opacity: 0.7; }

.tir-dot.is-hit { background: var(--bs-success) !important; color: #fff; border-color: var(--bs-success); }
.tir-dot.is-partial { background: var(--bs-orange) !important; color: #fff; border-color: var(--bs-orange); }
.tir-dot.is-miss { background: var(--bs-red) !important; color: #fff; border-color: var(--bs-red); }

/* Historique */
.history-item { 
    padding: 15px; 
    border-bottom: 1px solid var(--bs-gray); 
    position: relative; 
    background: #fff;
}
.history-main { display: flex; justify-content: space-between; font-weight: 700; }
.score-green { color: var(--bs-success); }
.history-meta { font-size: 0.8rem; color: #666; margin-top: 4px; }
.history-obs { 
    font-size: 0.8rem; 
    margin-top: 10px; 
    padding: 10px; 
    background: var(--bs-gray-light); 
    border-left: 4px solid var(--bs-primary); 
    font-style: italic; 
}
.delete-btn { 
    position: absolute; 
    top: 10px; 
    right: 10px; 
    background: none; 
    border: none; 
    color: var(--bs-red); 
    font-size: 1.4rem; 
}

/* Listes d'étapes (Bang/Clic) */
.tir-steps-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
    border-left: 3px solid var(--bs-primary);
    padding-left: 15px;
}
.tir-step-item { font-size: 0.85rem; margin-bottom: 5px; }
.tir-step-item::before { content: "→"; color: var(--bs-primary); margin-right: 8px; font-weight: bold; }

.tir-serie-row {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--bs-orange); /* Un rappel de la couleur Perroti */
}

.tir-serie-label {
    font-weight: bold;
    font-size: 0.9em;
    margin-bottom: 8px;
    color: #495057;
    text-transform: uppercase;
}

/* On s'assure que la grille dans la série ne s'étale pas trop */
.tir-serie-row .tir-grid {
    display: flex;
    justify-content: flex-start;
}