/* Modal de configuration de voyage - Version moderne et compacte */
.voyage-config-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.2s ease-out;
    overflow-y: auto; /* Permet le scroll sur la modal elle-même */
    padding: 20px 0; /* Ajoute un padding pour éviter que le contenu touche les bords */
}

.voyage-config-modal.show {
    display: flex;
}

.voyage-config-modal .modal-content {
    background-color: #fff;
    margin: auto; /* Centre la modal horizontalement */
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 480px;
    max-height: none; /* Supprime la limite de hauteur pour permettre le scroll */
    min-height: 50vh; /* Hauteur minimum pour éviter que la modal soit trop petite */
    overflow: visible; /* Permet au contenu de déborder naturellement */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    animation: slideInUp 0.3s ease-out;
    position: relative;
}

.voyage-config-modal .modal-header {
    background: linear-gradient(135deg, #ffbc50  0%, #ffb747 100%);
    color: white;
    padding: 20px 24px;
    border-radius: 12px 12px 0 0;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.voyage-config-modal .modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: white;
}

.voyage-config-modal .modal-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    font-size: 20px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.voyage-config-modal .modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.voyage-config-modal .modal-body {
    padding: 24px;
}

/* Steps avec design moderne et compact */
.voyage-config-modal .config-step {
    margin-bottom: 24px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.voyage-config-modal .config-step:last-of-type {
    margin-bottom: 0;
}

.voyage-config-modal .config-step h3 {
    color: #334155;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
}

.voyage-config-modal .config-step h3:before {
    content: '';
    width: 3px;
    height: 16px;
    background: linear-gradient(135deg, #ffbc50  0%, #ffb747 100%);
    border-radius: 2px;
    margin-right: 10px;
}

/* Sélecteurs modernes */
.voyage-config-modal select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background-color: #fff;
    transition: all 0.2s ease;
}

.voyage-config-modal select:focus {
    outline: none;
    border-color: #ffbc50 ;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Configuration des voyageurs - Design compact */
.travelers-config {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.traveler-type {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.traveler-type:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.traveler-type label {
    font-weight: 500;
    color: #475569;
    font-size: 14px;
}

/* Compteurs modernes et compacts */
.counter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.counter-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #ffbc50 ;
    background: white;
    color: #ffbc50 ;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.counter-btn:hover {
    background: #ffbc50 ;
    color: white;
    transform: scale(1.05);
}

.counter-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.counter-value {
    font-size: 16px;
    font-weight: 600;
    color: #334155;
    min-width: 24px;
    text-align: center;
}

/* Date selector moderne */
.date-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.date-selector input[type="date"] {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.date-selector input[type="date"]:hover {
    border-color: #9ca3af;
}

.date-selector input[type="date"]:focus {
    outline: none;
    border-color: #ffbc50 ;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.date-help {
    font-size: 12px;
    color: #64748b;
    margin: 0;
    font-style: italic;
}

/* Récapitulatif moderne et compact */
.config-summary {
    background: #f1f5f9;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    margin-top: 16px;
}

.config-summary.collapsed {
    background: #f8fafc;
}

.summary-header {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.summary-header:hover {
    background: #f8fafc;
}

.summary-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.summary-toggle {
    background: none;
    border: none;
    color: #ffbc50 ;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.summary-toggle:hover {
    background: rgba(102, 126, 234, 0.1);
}

.summary-content {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.summary-line:last-child:not(.total) {
    margin-bottom: 8px;
}

.summary-line.total {
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
    font-weight: 600;
    font-size: 14px;
    color: #334155;
}

.summary-line span:first-child {
    color: #64748b;
    font-weight: 500;
}

.summary-line span:last-child {
    color: #334155;
    font-weight: 600;
}

.summary-line.total span:last-child {
    color: #ffbc50 ;
    font-size: 16px;
}

/* Footer moderne et compact */
.voyage-config-modal .modal-footer {
    padding: 16px 24px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.voyage-modal-footer .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #94a3b8;
}

.voyage-modal-footer .btn-primary:disabled:hover {
    background: #94a3b8;
    transform: none;
}

/* Boutons modernes */
.voyage-config-modal .btn-secondary,
.voyage-config-modal .btn-primary {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    flex: 1;
}

.voyage-config-modal .btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #d1d5db;
}

.voyage-config-modal .btn-secondary:hover {
    background: #e2e8f0;
    border-color: #9ca3af;
}

.voyage-config-modal .btn-primary {
    background: linear-gradient(135deg, #ffbc50  0%, #ffb747 100%);
    color: white;
}

.voyage-config-modal .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Responsive design moderne */
@media (max-width: 768px) {
    .voyage-config-modal {
        padding: 10px 0; /* Réduit le padding sur mobile */
    }
    
    .voyage-config-modal .modal-content {
        width: 95%;
        max-width: none;
        margin: 10px auto; /* Centre la modal */
        max-height: none; /* Supprime la limite de hauteur */
        min-height: 0; /* Permet à la modal de rétrécir si nécessaire */
    }

    .voyage-config-modal .modal-header,
    .voyage-config-modal .modal-body,
    .voyage-config-modal .modal-footer {
        padding: 16px;
    }

    .voyage-config-modal .modal-header h2 {
        font-size: 18px;
    }

    .travelers-config {
        gap: 10px;
    }

    .traveler-type {
        padding: 10px 12px;
    }

    .voyage-config-modal .modal-footer {
        padding: 12px 16px;
    }

    .summary-line {
        font-size: 12px;
    }

    .summary-line.total {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .voyage-config-modal {
        padding: 5px 0; /* Réduit encore plus le padding sur très petit écran */
    }
    
    .voyage-config-modal .modal-content {
        width: 98%;
        max-height: none; /* Supprime la limite de hauteur */
        min-height: 0; /* Permet à la modal de rétrécir si nécessaire */
        border-radius: 8px; /* Garde un peu de border-radius pour l'esthétique */
        margin: 5px auto; /* Centre la modal */
    }

    .voyage-config-modal .modal-header,
    .voyage-config-modal .modal-body {
        padding: 12px;
    }
}
