/* Styles spécifiques pour le calculateur de seuil de rentabilité */

.input-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 30px;
    position: relative;
}

/* Séparateur visuel entre les sections */
.input-grid .input-card {
    margin-bottom: 8px;
}

.input-grid .input-card:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(to right, transparent, #dee2e6, transparent);
}

.input-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e5e5e5;
    position: relative;
    transition: all 0.3s ease;
}

.input-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

/* Bordure colorée distinctive pour chaque section */
.input-card.ca-section {
    border-left: 4px solid #27ae60;
}

.input-card.cv-section {
    border-left: 4px solid #e74c3c;
}

.input-card.cf-section {
    border-left: 4px solid #f39c12;
}

.input-card.ms-section {
    border-left: 4px solid #3498db;
}

.input-card h3 {
    font-size: 1.15rem;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.input-card h3 i {
    margin-right: 10px;
    font-size: 1.2rem;
}

/* Icônes colorées pour chaque section */
.input-card.ca-section h3 i {
    color: #27ae60;
    background: rgba(39, 174, 96, 0.1);
    padding: 8px;
    border-radius: 8px;
}

.input-card.cv-section h3 i {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
    padding: 8px;
    border-radius: 8px;
}

.input-card.cf-section h3 i {
    color: #f39c12;
    background: rgba(243, 156, 18, 0.1);
    padding: 8px;
    border-radius: 8px;
}

.input-card.ms-section h3 i {
    color: #3498db;
    background: rgba(52, 152, 219, 0.1);
    padding: 8px;
    border-radius: 8px;
}

/* Badge informatif */
.section-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-ca {
    background: rgba(39, 174, 96, 0.15);
    color: #27ae60;
}

.badge-cv {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
}

.badge-cf {
    background: rgba(243, 156, 18, 0.15);
    color: #f39c12;
}

.badge-ms {
    background: rgba(52, 152, 219, 0.15);
    color: #3498db;
}

/* Boutons radio stylisés */
.btn-group label.btn {
    font-size: 0.9rem;
    padding: 8px 15px;
}

.btn-check:checked + .btn-outline-primary {
    background-color: #3498db;
    border-color: #3498db;
}

/* Slider personnalisé */
.form-range {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
}

.form-range::-webkit-slider-thumb {
    background: #3498db;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
}

.form-range::-moz-range-thumb {
    background: #3498db;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
}

/* Charges fixes détaillées */
.cf-ligne .input-group input:first-child {
    flex: 2;
}

.cf-ligne .input-group input:nth-child(2) {
    flex: 1;
    max-width: 150px;
}

.cf-ligne .btn-outline-danger {
    padding: 0.375rem 0.75rem;
}

#cf_detail_container {
    max-height: 300px;
    overflow-y: auto;
}

/* Zone de résultats */
.results-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    margin: 30px 0;
}

.rentabilite-indicator {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.progress {
    border-radius: 20px;
    overflow: hidden;
    background: #e9ecef;
}

.progress-bar {
    font-size: 1.1rem;
    font-weight: 600;
    transition: width 0.6s ease, background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#status_message {
    font-weight: 600;
}

/* Grille de résultats */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.result-item {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.result-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 10px;
    font-weight: 500;
}

.result-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c3e50;
}

.result-value.text-success {
    color: #27ae60 !important;
}

.result-value.text-danger {
    color: #e74c3c !important;
}

/* Section suggestions */
.suggestions-section {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    border: 2px dashed #3498db;
}

.suggestions-section .card {
    border: 1px solid #e5e5e5;
    transition: transform 0.2s, box-shadow 0.2s;
}

.suggestions-section .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.suggestions-section .card-body {
    padding: 25px;
}

.suggestions-section .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
}

/* Alertes personnalisées */
.alert-info {
    background: #e8f4f8;
    border: 1px solid #b8e0f0;
    color: #0c5460;
}

/* Amélioration des récapitulatifs de section */
.ms-section .alert-info {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.05) 0%, rgba(52, 152, 219, 0.1) 100%);
    border: 1px solid rgba(52, 152, 219, 0.2);
}

.cf-section .text-end strong {
    color: #f39c12;
    font-size: 1.1rem;
}

/* Indicateurs de statut */
.input-card .input-group-text {
    background: #f8f9fa;
    border-color: #dee2e6;
    font-weight: 500;
}

/* Tooltips informatifs */
.info-tooltip {
    display: inline-block;
    margin-left: 8px;
    color: #6c757d;
    cursor: help;
    font-size: 0.85rem;
}

.info-tooltip:hover {
    color: #3498db;
}

/* Bouton reset */
.btn-reset {
    background: #95a5a6;
    color: white;
    padding: 10px 30px;
    border: none;
    border-radius: 5px;
    font-weight: 500;
    transition: background 0.3s;
}

.btn-reset:hover {
    background: #7f8c8d;
    color: white;
}

/* Info section */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.info-item {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.info-item h4 {
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.info-item h4 i {
    color: #3498db;
}

.info-item p {
    color: #6c757d;
    line-height: 1.6;
    margin: 0;
}

/* Amélioration des inputs et contrôles */
.input-card .form-control,
.input-card .form-select {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background-color: #f8f9fa;
}

.input-card .form-control:focus,
.input-card .form-select:focus {
    background-color: white;
    border-color: #3498db;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.1);
}

/* Focus spécifique par section */
.ca-section .form-control:focus {
    border-color: #27ae60;
    box-shadow: 0 0 0 0.2rem rgba(39, 174, 96, 0.1);
}

.cv-section .form-control:focus {
    border-color: #e74c3c;
    box-shadow: 0 0 0 0.2rem rgba(231, 76, 60, 0.1);
}

.cf-section .form-control:focus {
    border-color: #f39c12;
    box-shadow: 0 0 0 0.2rem rgba(243, 156, 18, 0.1);
}

.ms-section .form-control:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.1);
}

/* Amélioration des boutons radio */
.input-card .btn-group {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    background: white;
}

/* Boutons d'ajout personnalisés par section */
.ca-section .btn-outline-primary {
    color: #27ae60;
    border-color: #27ae60;
}

.ca-section .btn-outline-primary:hover {
    background-color: #27ae60;
    border-color: #27ae60;
}

.cv-section .btn-outline-primary {
    color: #e74c3c;
    border-color: #e74c3c;
}

.cv-section .btn-outline-primary:hover {
    background-color: #e74c3c;
    border-color: #e74c3c;
}

.cf-section .btn-outline-primary {
    color: #f39c12;
    border-color: #f39c12;
}

.cf-section .btn-outline-primary:hover {
    background-color: #f39c12;
    border-color: #f39c12;
}

.ms-section .btn-outline-primary {
    color: #3498db;
    border-color: #3498db;
}

.ms-section .btn-outline-primary:hover {
    background-color: #3498db;
    border-color: #3498db;
}

/* Section info/help */
.section-help {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: -10px;
    margin-bottom: 15px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 8px;
    border-left: 3px solid #dee2e6;
    font-style: italic;
}

.section-help i {
    margin-right: 6px;
    opacity: 0.7;
}

/* Animation d'entrée */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-card {
    animation: slideIn 0.4s ease-out;
}

/* Effet de surbrillance au survol des badges */
.section-badge {
    transition: all 0.3s ease;
}

.input-card:hover .section-badge {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Numérotation visuelle des sections */
.input-card::before {
    content: attr(data-step);
    position: absolute;
    top: -12px;
    left: 24px;
    background: white;
    padding: 0 8px;
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 600;
    letter-spacing: 1px;
}

/* Responsive */
@media (max-width: 768px) {
    .input-grid {
        grid-template-columns: 1fr;
    }
    
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .suggestions-section .row {
        margin: 0;
    }
    
    .suggestions-section .col-md-4 {
        padding: 0;
    }
}

@media (max-width: 480px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .result-value {
        font-size: 1.2rem;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group label {
        width: 100%;
        border-radius: 5px !important;
        margin-bottom: 5px;
    }
}