/* ============================================
   INDICATEURS DÉTAILLÉS - CHARTE CLEARQUANT
   ============================================ */

/* Timeline verticale */
.decision-timeline {
    position: relative;
    padding: 1rem 0;
}

/* Ligne centrale de la timeline */
.decision-timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 40px;
    bottom: 40px;
    width: 3px;
    background: linear-gradient(to bottom, var(--color-green), var(--color-blue-steel));
    border-radius: 2px;
    z-index: 0; /* En arrière-plan, derrière les numéros */
}

/* Étape de la timeline */
.timeline-step {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 80px;
}

/* Numéro de l'étape (cercle) */
.step-number {
    position: absolute;
    left: 0;
    top: 0;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-title);
    font-size: 1.5rem;
    font-weight: 700;
    z-index: 10; /* Augmenté pour passer au-dessus de la ligne verticale */
    /* Double box-shadow : blanc opaque pour masquer la ligne + ombre portée */
    box-shadow: 0 0 0 8px var(--color-white), 0 4px 12px rgba(45, 64, 89, 0.2);
    background: var(--color-blue-steel);
    color: var(--color-white);
}

.step-number.validated {
    background: var(--color-green);
}

.step-number.warning {
    background: var(--color-red);
}


/* Carte de l'étape */
.step-card {
    background: var(--color-white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border-left: 4px solid var(--color-blue-steel);
    box-shadow: 0 2px 8px rgba(45, 64, 89, 0.08);
    transition: all 0.3s ease;
}

.step-card:hover {
    box-shadow: 0 4px 16px rgba(45, 64, 89, 0.12);
    transform: translateX(4px);
}

.step-card.validated {
    border-left-color: var(--color-green);
}

.step-card.warning {
    border-left-color: var(--color-red);
}

/* En-tête de l'étape */
.step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.step-title {
    font-family: var(--font-title);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--color-blue-steel);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.step-icon {
    font-size: 1.5rem;
}

.step-result {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--color-blue-grey);
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-blue-steel);
}

.step-result.success {
    background: #d1fae5;
    color: #065f46;
}

.step-result.warning {
    background: #fef3c7;
    color: #92400e;
}

/* Résumé de l'étape */
.step-summary {
    color: var(--color-grey-graphite);
    line-height: 1.7;
    margin-bottom: 1rem;
}

/* Bouton pour afficher les détails */
.toggle-details-btn {
    background: var(--color-white);
    border: 2px solid var(--color-blue-steel);
    color: var(--color-blue-steel);
    padding: 0.6rem 1.2rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-details-btn:hover {
    background: var(--color-blue-steel);
    color: var(--color-white);
}

.toggle-details-btn .arrow {
    transition: transform 0.3s ease;
    font-size: 1.1rem;
}

.toggle-details-btn.active .arrow {
    transform: rotate(90deg);
}

/* Conteneur des détails (expandable) */
.step-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    margin-top: 1rem;
}

.step-details.active {
    max-height: 5000px; /* Augmenté pour permettre l'affichage de toutes les étapes sur mobile */
}

/* Extension maximale augmentée sur mobile pour les détails des étapes */
@media (max-width: 768px) {
    .step-details.active {
        max-height: 8000px; /* Plus d'espace sur mobile pour le contenu vertical */
    }
}

/* Section de détail à l'intérieur */
.detail-section {
    background: var(--color-blue-grey);
    padding: 1.5rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1rem;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.section-subtitle {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-blue-steel);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================
   JAUGES VISUELLES
   ============================================ */

.gauge-container {
    background: var(--color-white);
    padding: 1.5rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1rem;
}

.gauge-label {
    font-weight: 600;
    color: var(--color-blue-steel);
    margin-bottom: 0.75rem;
    text-align: center;
}

.gauge-bar {
    width: 100%;
    height: 40px;
    background: linear-gradient(to right,
        var(--color-green) 0%,
        #90EE90 15%,
        #FFD700 35%,
        #D3D3D3 50%,
        #FFD700 65%,
        #90EE90 85%,
        var(--color-green) 100%);
    border-radius: 20px;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.gauge-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 50px;
    background: var(--color-blue-steel);
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.gauge-marker::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--color-blue-steel);
}

.gauge-value {
    text-align: center;
    margin-top: 0.5rem;
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--color-blue-steel);
}

/* Lignes de seuil sur la jauge horizontale */
.gauge-threshold-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--color-blue-steel);
    opacity: 0.6;
    z-index: 1;
    transition: opacity 0.3s ease;
}

.gauge-threshold-line:hover {
    opacity: 1;
}

/* Légende des seuils */
.gauge-thresholds-legend {
    display: flex;
    justify-content: space-between;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--color-blue-steel);
    font-weight: 600;
}

.gauge-thresholds-legend span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Jauge verticale (pour prix BTC) */
.gauge-vertical {
    display: flex;
    gap: 1rem;
    align-items: stretch;
}

.gauge-vertical-bar {
    width: 60px;
    min-height: 200px;
    background: linear-gradient(to bottom,
        var(--color-green) 0%,
        #90EE90 15%,
        #FFD700 35%,
        #D3D3D3 50%,
        #FFD700 65%,
        #90EE90 85%,
        var(--color-green) 100%);
    border-radius: 30px;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.gauge-vertical-marker {
    position: absolute;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 4px;
    background: var(--color-blue-steel);
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.gauge-vertical-marker::before {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid var(--color-blue-steel);
}

/* Lignes de seuil sur la jauge verticale */
.gauge-vertical-threshold-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--color-blue-steel);
    opacity: 0.6;
    z-index: 1;
    transition: opacity 0.3s ease;
}

.gauge-vertical-threshold-line:hover {
    opacity: 1;
}

.gauge-vertical-labels {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--color-grey-graphite);
}

.gauge-vertical-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================
   INDICATEURS INDIVIDUELS
   ============================================ */

.indicator-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--color-white);
    border-radius: var(--border-radius-sm);
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.indicator-row:hover {
    box-shadow: 0 2px 8px rgba(45, 64, 89, 0.1);
    transform: translateX(4px);
}

.indicator-icon {
    font-size: 1.8rem;
    min-width: 40px;
    text-align: center;
}

.indicator-content {
    flex: 1;
}

.indicator-name {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--color-blue-steel);
    margin-bottom: 0.25rem;
}

.indicator-value {
    font-family: var(--font-mono);
    color: var(--color-grey-graphite);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.indicator-explanation {
    color: var(--color-grey-graphite);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Badge d'impact */
.impact-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.impact-badge.amplifier {
    background: #d1fae5;
    color: #065f46;
}

.impact-badge.brake {
    background: #fee2e2;
    color: #991b1b;
}

.impact-badge.neutral {
    background: var(--color-blue-grey);
    color: var(--color-grey-graphite);
}

/* Barre de progression pour visualiser l'impact */
.impact-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.impact-fill {
    height: 100%;
    transition: width 0.5s ease;
}

.impact-fill.amplifier {
    background: linear-gradient(to right, var(--color-green), #059669);
}

.impact-fill.brake {
    background: linear-gradient(to right, var(--color-red), #dc2626);
}

.impact-fill.neutral {
    background: linear-gradient(to right, #9ca3af, #6b7280);
}

/* ============================================
   SECTIONS SPÉCIFIQUES
   ============================================ */

/* Box d'information */
.info-box-detailed {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    padding: 1.25rem 1.5rem;
    border-radius: var(--border-radius-sm);
    margin-top: 1.5rem;
}

.info-box-detailed.warning {
    background: #fef3c7;
    border-left-color: #f59e0b;
}

.info-box-detailed.danger {
    background: #fee2e2;
    border-left-color: var(--color-red);
}

.info-box-title {
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
}

.info-box-detailed.warning .info-box-title {
    color: #92400e;
}

.info-box-detailed.danger .info-box-title {
    color: #991b1b;
}

.info-box-text {
    color: #1e3a8a;
    line-height: 1.7;
}

.info-box-detailed.warning .info-box-text {
    color: #78350f;
}

.info-box-detailed.danger .info-box-text {
    color: #7f1d1d;
}

/* Trade exécuté */
.trade-executed {
    background: linear-gradient(135deg, var(--color-green), #059669);
    color: var(--color-white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-top: 1.5rem;
    position: relative;
    z-index: 10;
}

.trade-executed h4 {
    font-family: var(--font-title);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trade-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.trade-detail-item {
    text-align: center;
}

.trade-detail-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.25rem;
}

.trade-detail-value {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 700;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    /* Masquer la ligne verticale sur mobile */
    .decision-timeline::before {
        display: none;
    }

    /* Réorganiser les étapes sans padding gauche */
    .timeline-step {
        padding-left: 0;
        padding-top: 2rem;
        padding-bottom: 2rem;
        position: relative;
    }

    /* Premier élément sans padding-top */
    .timeline-step:first-child {
        padding-top: 0;
    }

    /* Centrer le numéro d'étape comme séparateur */
    .step-number {
        position: relative;
        left: auto;
        top: auto;
        margin: 0 auto 1.5rem;
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    /* Ajouter une ligne horizontale de séparation */
    .timeline-step:not(:first-child)::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 80%;
        height: 2px;
        background: linear-gradient(to right, transparent, var(--color-blue-steel), transparent);
        opacity: 0.3;
    }

    .step-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .gauge-vertical {
        flex-direction: column;
    }

    .gauge-vertical-bar {
        width: 100%;
        min-height: 60px;
    }

    .gauge-vertical-labels {
        flex-direction: row;
    }

    .trade-details {
        grid-template-columns: 1fr;
    }

    .indicator-row {
        flex-direction: column;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes pulse-marker {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 4px 16px rgba(45, 64, 89, 0.5);
    }
}

.gauge-marker,
.gauge-vertical-marker {
    animation: pulse-marker 2s ease-in-out infinite;
}
