/**
 * ARC Highcharts - Styles principaux
 */

/* ==========================================================================
   Conteneur principal du bloc
   ========================================================================== */

.arc-hc-block {
    margin: 2rem 0;
    padding: 0;
    background: transparent;
}

.arc-hc-block.alignwide {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.arc-hc-block.alignfull {
    max-width: 100%;
}

/* ==========================================================================
   Conteneur du graphique
   ========================================================================== */

.arc-hc-container {
    width: 100%;
    min-height: 400px;
    background: transparent;
    position: relative;
}

/* Assurer que le SVG Highcharts est transparent */
.arc-hc-container .highcharts-background {
    fill: transparent !important;
}

.arc-hc-container .highcharts-container {
    background: transparent !important;
}

/* ==========================================================================
   État vide (éditeur seulement)
   ========================================================================== */

.arc-hc-empty-state {
    border: 2px dashed #dcdcdc;
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
    background: #f9f9f9;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.arc-hc-placeholder {
    max-width: 400px;
}

.arc-hc-placeholder .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    color: #0073aa;
    margin-bottom: 1rem;
}

.arc-hc-placeholder h3 {
    margin: 0.5rem 0;
    font-size: 1.5rem;
    color: #1e1e1e;
}

.arc-hc-placeholder p {
    margin: 0.5rem 0;
    color: #666;
    font-size: 1rem;
}

.arc-hc-type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #0073aa;
    color: white;
    border-radius: 4px;
    font-size: 0.875rem;
    margin-top: 1rem;
    text-transform: uppercase;
    font-weight: 600;
}

/* ==========================================================================
   Contrôles Bar Race
   ========================================================================== */

.arc-race-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f7f7f7;
    border-radius: 8px;
    flex-wrap: wrap;
}

.arc-race-play {
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.arc-race-play:hover {
    background: #005a87;
    transform: scale(1.05);
}

.arc-race-play:active {
    transform: scale(0.95);
}

.arc-race-play .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.arc-race-controls input[type="range"] {
    flex: 1;
    min-width: 200px;
    height: 8px;
    border-radius: 4px;
    background: #dcdcdc;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.arc-race-controls input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0073aa;
    cursor: pointer;
    transition: all 0.2s ease;
}

.arc-race-controls input[type="range"]::-webkit-slider-thumb:hover {
    background: #005a87;
    transform: scale(1.2);
}

.arc-race-controls input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0073aa;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.arc-race-controls input[type="range"]::-moz-range-thumb:hover {
    background: #005a87;
    transform: scale(1.2);
}

.arc-race-year {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1e1e1e;
    min-width: 60px;
    text-align: center;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .arc-hc-container {
        min-height: 350px;
        width: 100% !important;
        margin: 0 auto;
        padding: 0;
    }
    
    .arc-hc-block {
        padding: 0;
    }
    
    .arc-race-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .arc-race-controls input[type="range"] {
        width: 100%;
    }
    
    .arc-race-year {
        text-align: center;
        width: 100%;
    }
    
    /* Légende en bas sur mobile */
    .arc-hc-container .highcharts-legend {
        transform: translateY(0) !important;
    }
    
    /* Améliorer l'espacement des labels sur mobile */
    .arc-hc-container .highcharts-data-label {
        font-size: 11px !important;
    }
    
    /* Assurer que la légende est visible et bien espacée */
    .arc-hc-container .highcharts-legend-item {
        margin: 0 8px !important;
    }
}

@media (max-width: 480px) {
    .arc-hc-block {
        margin: 1rem 0;
    }
    
    .arc-hc-container {
        min-height: 320px;
        padding: 0;
    }
    
    .arc-race-play {
        width: 40px;
        height: 40px;
    }
    
    .arc-race-play .dashicons {
        font-size: 20px;
        width: 20px;
        height: 20px;
    }
    
    /* Labels encore plus petits sur très petits écrans */
    .arc-hc-container .highcharts-data-label {
        font-size: 10px !important;
    }
}

/* ==========================================================================
   Highcharts custom styling
   ========================================================================== */

/* Améliorer l'apparence des tooltips */
.arc-hc-container .highcharts-tooltip-box {
    fill: rgba(255, 255, 255, 0.95);
    stroke: #0073aa;
    stroke-width: 2;
}

.arc-hc-container .highcharts-tooltip text {
    fill: #1e1e1e;
}

/* Améliorer les labels de données - SANS ombre blanche */
.arc-hc-container .highcharts-data-label text {
    font-size: 16px !important;
    font-weight: bolder;
    text-shadow: none !important; /* Enlever l'ombre blanche */
}

/* Améliorer la légende */
.arc-hc-container .highcharts-legend-item text {
    font-size: 16px !important;
    fill: #1e1e1e !important;
}

.arc-hc-container .highcharts-legend-item:hover text {
    fill: #0073aa !important;
}

/* Améliorer les titres */
.arc-hc-container .highcharts-title {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.arc-hc-container .highcharts-subtitle {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* ==========================================================================
   Animation et interactions
   ========================================================================== */

.arc-hc-container .highcharts-point {
    transition: opacity 0.2s ease;
}

.arc-hc-container .highcharts-point:hover {
    opacity: 0.8;
}

/* Animation au chargement */
.arc-hc-block {
    animation: arcFadeIn 0.5s ease-in-out;
}

@keyframes arcFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Print styles
   ========================================================================== */

@media print {
    .arc-race-controls {
        display: none !important;
    }
    
    .arc-hc-block {
        page-break-inside: avoid;
    }
    
    .arc-hc-container {
        min-height: auto;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.arc-race-play:focus {
    outline: 3px solid #0073aa;
    outline-offset: 2px;
}

.arc-race-controls input[type="range"]:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .arc-hc-empty-state {
        border-color: #000;
        background: #fff;
    }
    
    .arc-race-controls {
        background: #fff;
        border: 2px solid #000;
    }
}

/* Dark mode support (si votre thème le supporte) */
@media (prefers-color-scheme: dark) {
    .arc-hc-empty-state {
        background: #1e1e1e;
        border-color: #444;
    }
    
    .arc-hc-placeholder h3 {
        color: #fff;
    }
    
    .arc-hc-placeholder p {
        color: #aaa;
    }
    
    .arc-race-controls {
        background: #2a2a2a;
    }
    
    .arc-race-year {
        color: #fff;
    }
}