/* ==================== Loan Simulator Custom Styles ==================== */

/* Custom Range Slider */
.custom-range {
    height: 8px;
    border-radius: 10px;
    background: linear-gradient(to right, #104042 0%, #104042 50%, #E5E7EB 50%, #E5E7EB 100%);
    outline: none;
    -webkit-appearance: none;
}

.custom-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #104042;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
}

.custom-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px #104042;
}

.custom-range::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #104042;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
}

.custom-range::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.5);
}

/* Loan Type Buttons - Nav Pills Style */
.nav-link-three {
    background: transparent;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    transition: all 0.4s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.nav-link-three:hover,
.nav-link-three.active {
    border-color: #6366F1;
    background: #6366F1;
}

.nav-link-three:hover .faq-text,
.nav-link-three.active .faq-text {
    color: #ffffff !important;
}

.nav-link-three:hover .ph,
.nav-link-three.active .ph {
    color: #ffffff !important;
}

.nav-link-three .ph {
    color: #6366F1;
    transition: all 0.4s ease;
}

/* Modal Animations */
.modal.fade .modal-dialog {
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.3s ease;
}

.modal.show .modal-dialog {
    transform: scale(1);
    opacity: 1;
}

/* ============================================
   FIX CRITIQUE - Modal au-dessus de TOUT
   ============================================ */

/* 1. BACKDROP - Caché par défaut, visible uniquement quand modal ouverte */
.modal-backdrop {
    display: none !important;
}

body.modal-open .modal-backdrop.show {
    display: block !important;
    z-index: 99998 !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    pointer-events: none !important; /* Permet de cliquer à travers */
}

/* 2. MODAL - Au-dessus de tout */
#simulationModal,
#simulationModal.show,
#simulationModal.fade {
    z-index: 99999 !important;
    pointer-events: auto !important;
}

#simulationModal .modal-dialog {
    z-index: 99999 !important;
    pointer-events: auto !important;
}

#simulationModal .modal-content {
    z-index: 99999 !important;
    background: white !important;
    pointer-events: auto !important;
}

/* 3. Permettre le scroll quand modal ouverte */
body.modal-open {
    overflow: auto !important;
    padding-right: 0 !important;
}

/* 4. Modal scrollable si contenu long */
#simulationModal .modal-dialog {
    max-height: 90vh;
    overflow-y: auto;
}

/* Preloader Animation in Modal */
.preloder-inline .animation-rotation {
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Shadow Enhancement */
.shadow-lg {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    /* Nav-faq en 2 colonnes sur mobile */
    .nav-pills.nav-faq {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        width: 100%;
    }
    
    .nav-pills.nav-faq .nav-item {
        width: 100%;
    }
    
    .nav-link-three {
        width: 100%;
        height: 100%;
    }
    
    /* Ajuster le padding pour mobile */
    .nav-link-three span {
        padding: 1rem 0.5rem !important;
    }
    
    /* Réduire la taille des icônes sur mobile */
    .nav-link-three .ph {
        font-size: 2rem !important;
    }
    
    /* Réduire la taille du texte sur mobile */
    .nav-link-three .faq-text {
        font-size: 0.875rem !important;
    }
}

/* Button Hover Effects */
.btn-main-600 {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-main-600:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-main-600:hover:before {
    width: 300px;
    height: 300px;
}

/* Info Box Animation */
.bg-neutral-10 {
    transition: all 0.3s ease;
}

.bg-neutral-10:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Result Cards Animation */
.modal-body .col-md-6 > div {
    transition: all 0.3s ease;
}

.modal-body .col-md-6 > div:hover {
    transform: translateX(5px);
}

/* Success Icon Animation */
@keyframes checkmark {
    0% {
        transform: scale(0) rotate(0deg);
    }
    50% {
        transform: scale(1.2) rotate(180deg);
    }
    100% {
        transform: scale(1) rotate(360deg);
    }
}

.modal.show .ph-check-circle {
    animation: checkmark 0.6s ease forwards;
}

/* Amount and Duration Display Badges */
.bg-main-100 {
    transition: all 0.3s ease;
}

.custom-range:active ~ .d-flex .bg-main-100,
.custom-range:focus ~ .d-flex .bg-main-100 {
    transform: scale(1.05);
}

/* Smooth Modal Transition */
#loading-state,
#result-state {
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#loading-state.hiding {
    opacity: 0;
    transform: scale(0.9);
}

#result-state.showing {
    opacity: 1;
    transform: scale(1);
}