/* In app/static/css/components.css */
.sortable-ghost {
    opacity: 0.5;
    background-color: #cfe2ff; /* A light blue, for example */
}
.sortable-chosen {
    /* You can add styles for the item actively being chosen, e.g., slightly darker background */
    /* background-color: #b8d6ff; */
}
.sortable-drag {
    /* This class is applied to the item being dragged, usually not needed if ghost is styled */
}
.drag-handle { /* Ensure the handle itself can be styled if needed, e.g. for consistent height/padding */
    /* Add any specific styling for the handle element itself if required */
}
.drag-handle:hover {
    cursor: grab;
}
.drag-handle:active {
    cursor: grabbing;
}

/* Ajout à app/static/css/components.css ou créer un nouveau fichier proforma-builder.css */

/* Layout à deux colonnes pour le Proforma Builder sur desktop */
@media (min-width: 1024px) {
    .proforma-builder-container {
        display: flex;
        height: calc(100vh - 200px); /* Ajuster selon votre layout */
        min-height: 600px;
    }
    
    .proforma-form-column {
        width: 50%;
        overflow-y: auto;
        padding-right: 1.5rem;
        border-right: 1px solid #e5e7eb;
    }
    
    .proforma-preview-column {
        width: 50%;
        padding-left: 1.5rem;
        position: sticky;
        top: 0;
        height: 100%;
    }
    
    .proforma-preview-content {
        height: calc(100vh - 300px);
        overflow-y: auto;
        border: 1px solid #e5e7eb;
        border-radius: 0.375rem;
        padding: 1rem;
        background-color: #ffffff;
        box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    }
}

/* Responsive design pour mobile */
@media (max-width: 1023px) {
    .proforma-builder-container {
        display: block;
    }
    
    .proforma-form-column {
        width: 100%;
        padding-right: 0;
        border-right: none;
    }
    
    .proforma-preview-column {
        display: none; /* Caché sur mobile, accessible via modal */
    }
}

/* Style pour les champs d'entreprise (lecture seule) */
.company-info-readonly {
    background-color: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    padding: 1rem;
}

.company-info-readonly .company-field {
    display: flex;
    margin-bottom: 0.5rem;
}

.company-info-readonly .company-field:last-child {
    margin-bottom: 0;
}

.company-info-readonly .field-label {
    font-weight: 600;
    min-width: 100px;
    color: #374151;
}

.company-info-readonly .field-value {
    color: #6b7280;
}

/* Animation pour le bouton de prévisualisation mobile */
.mobile-preview-button {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 40;
    background-color: #3b82f6;
    color: white;
    padding: 0.75rem;
    border-radius: 50%;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease-in-out;
}

.mobile-preview-button:hover {
    background-color: #2563eb;
    transform: scale(1.05);
}

/* Style pour les lignes du tableau */
.ligne-item {
    transition: background-color 0.2s ease-in-out;
}

.ligne-item:hover {
    background-color: #f9fafb;
}

/* Style pour la section des totaux */
.totals-section {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-top: 1rem;
}

.total-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.total-line:last-child {
    margin-bottom: 0;
    border-top: 1px solid #d1d5db;
    padding-top: 0.5rem;
    font-weight: 700;
    font-size: 1.125rem;
}

/* Animation de chargement pour l'aperçu */
.preview-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.preview-loading svg {
    animation: spin 1s linear infinite;
}

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

/* Style pour les messages de statut */
.status-message {
    border-radius: 0.375rem;
    padding: 1rem;
    margin-top: 1rem;
}

.status-message.success {
    background-color: #d1fae5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.status-message.error {
    background-color: #fee2e2;
    border: 1px solid #fca5a5;
    color: #dc2626;
}

/* Navigation par étapes */
.step-navigation {
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.step-button {
    padding-bottom: 0.5rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease-in-out;
}

.step-button.active {
    font-weight: 700;
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.step-button:hover:not(.active) {
    color: #374151;
}

/* Style pour les sections du formulaire */
.form-section {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.form-section h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #111827;
}

/* Style pour le modal de prévisualisation mobile */
.mobile-preview-modal {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 1rem;
}

.mobile-preview-content {
    background-color: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 28rem;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.mobile-preview-header {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.mobile-preview-body {
    padding: 1rem;
}

/* Dans votre fichier main.css */
[x-cloak] { 
    display: none !important; 
}

/* S'assurer que la modale est correctement positionnée */
.fixed.inset-0 {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

/* Style pour la modale */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease;
}

.modal-panel {
    transition: all 0.3s ease;
    transform: translateY(0);
    opacity: 1;
}