/* Styles pour le module Monitoring des Athlètes */

.athlete-monitoring-module {
    width: 100%;
    height: fit-content;
    min-height: 0;
    padding: 0;
    background: var(--bg-primary);
    overflow: visible;
    border-radius: 8px 8px 0 0;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.athlete-monitoring-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    padding: 0.375rem 0.75rem;
    border-bottom: none;
    min-height: 2.25rem;
}

.athlete-monitoring-header .section-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
}

.athlete-monitoring-header .subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.2;
}

.athlete-monitoring-content {
    height: auto;
    overflow-y: visible;
    padding: 1rem;
}

.monitoring-interface {
    padding: 1rem;
}

.connection-status-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1rem;
    font-size: 13px;
    color: var(--text-secondary);
}

.connection-status-compact .status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #6c757d;
}

.connection-status-compact .status-indicator.connected {
    background: #28a745;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.5);
}

.connection-status-compact .status-indicator.error {
    background: #dc3545;
    box-shadow: 0 0 8px rgba(220, 53, 69, 0.5);
}

.athlete-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 1.5rem;
    height: auto;
}

.athlete-panel,
.events-panel,
.athlete-details-panel,
.no-selection-panel {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.athlete-panel h3,
.events-panel h3,
.athlete-details-panel h3,
.no-selection-panel h3 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Grille des athlètes */
.athletes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.athlete-card {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.athlete-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.athlete-card.selected {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.athlete-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.athlete-bib {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.8rem;
}

.athlete-status {
    font-size: 1.2rem;
}

.athlete-name {
    margin: 0.5rem 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
}

.athlete-category {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.athlete-last-shot {
    margin: 0.5rem 0 0 0;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Statuts */
.status-active {
    color: var(--success-color);
}

.status-standby {
    color: var(--warning-color);
}

.status-finished {
    color: var(--error-color);
}

.status-offline {
    color: var(--text-muted);
}

/* Événements temps réel */
.events-list {
    /* Pas de hauteur max, défilement naturel */
}

.event-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.event-row {
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
    border-left: 3px solid transparent;
    transition: background 0.15s ease;
    line-height: 1.4;
}

.event-row:hover {
    background: var(--bg-secondary);
}

.event-row.shot_detected {
    border-left-color: #f48771;
}

.event-row.race_event {
    border-left-color: #4ec9b0;
}

.event-row.target_state_change {
    border-left-color: #569cd6;
}

.event-row .event-time {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-right: 0.5rem;
}

.event-row strong {
    color: var(--text-primary);
    margin-right: 0.5rem;
}

/* Détails de l'athlète */
.athlete-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-item label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-item span {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 600;
}

.athlete-actions {
    display: flex;
    gap: 0.5rem;
}

/* Panneau sans sélection */
.no-selection-content {
    text-align: center;
    color: var(--text-secondary);
}

.selection-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.selection-stats .stat {
    text-align: center;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.selection-stats .stat strong {
    display: block;
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.selection-stats .stat label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Données vides */
.no-data {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 2rem;
}

/* Container d'erreur */
.error-container {
    text-align: center;
    padding: 2rem;
    color: var(--error-color);
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Actions de monitoring */
.monitoring-actions {
    display: flex;
    gap: 0.5rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .athlete-panels {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }
    
    .athletes-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    .athlete-monitoring-module {
        padding: 0.5rem;
    }
    
    .athlete-monitoring-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .athletes-grid {
        grid-template-columns: 1fr;
    }
    
    .athlete-stats {
        grid-template-columns: 1fr;
    }
    
    .selection-stats {
        grid-template-columns: 1fr;
    }
    
    .athlete-actions {
        flex-direction: column;
    }
}

/* Styles pour les maillots d'athlètes */
.athlete-jersey {
    position: relative;
    width: 70px;
    height: 85px;
    margin: 0 auto 4px auto; /* Réduction de l'espace sous le maillot */
    cursor: pointer;
    transition: all 0.3s ease;
}

.athlete-jersey svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: all 0.3s ease;
}

.athlete-jersey:hover svg {
    transform: scale(1.1);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.athlete-jersey.selected svg {
    transform: scale(1.05);
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3));
}

.athlete-jersey .jersey-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    font-size: 16px;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 10;
}

.athlete-jersey.selected .jersey-number {
    font-size: 18px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
}

.athlete-name {
    text-align: center;
    font-size: 11px;
    font-weight: 400;
    color: var(--text-primary);
    margin-top: 0; /* Suppression de l'espace au-dessus */
    line-height: 1.1;
    width: 100%;
    padding: 0 2px;
}

.athlete-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 6px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
    width: 90px;
    margin: 0 auto;
}

.athlete-item:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

.athlete-item.selected {
    background-color: rgba(0, 123, 255, 0.2);
}

/* Grille spécifique pour les athlètes */
#bibGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 16px;
    align-items: start;
    justify-items: center;
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

/* Mode sombre */
body.dark-mode .athlete-monitoring-module {
    background: #1A1A1A !important;
    border-color: #444 !important;
}

body.dark-mode .athlete-monitoring-header {
    background: #1A1A1A !important;
}

