/* Amélioration responsivité des modals */

/* Styles généraux pour tous les modals */
.modal-card {
    margin: 10px;
    max-height: calc(100vh - 20px);
}

/* Responsive breakpoints pour les modals */
@media screen and (max-width: 768px) {
    .modal-card {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .modal-card-body {
        padding: 1rem !important;
        max-height: calc(100vh - 120px) !important;
    }
    
    .modal-card-head {
        padding: 1rem !important;
    }
    
    .modal-card-foot {
        padding: 1rem !important;
    }
    
    /* Stack buttons on mobile */
    .modal-card-foot .button {
        margin: 0.25rem 0;
        width: 100%;
    }
    
    .modal-card-foot {
        flex-direction: column;
    }
    
    /* Improve form fields on mobile */
    .field .label {
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
    }
    
    .input, .textarea, .select select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Improve select multiple on mobile */
    .select.is-multiple select {
        min-height: 120px !important;
    }
    
    /* Columns responsiveness */
    .columns.is-mobile .column {
        padding: 0.5rem;
    }
}

/* Tablet specific adjustments */
@media screen and (min-width: 769px) and (max-width: 1023px) {
    .modal-card {
        width: 90% !important;
        max-width: 700px !important;
    }
    
    .modal-card-body {
        max-height: 70vh !important;
    }
}

/* Desktop improvements */
@media screen and (min-width: 1024px) {
    .modal-card {
        max-width: 900px !important;
    }
    
    .modal-card-body {
        max-height: 80vh !important;
    }
}

/* Amélioration des champs de sélection multiple */
.select.is-multiple select optgroup {
    font-weight: bold;
    color: #3273dc;
    background-color: #f5f5f5;
}

.select.is-multiple select option {
    padding: 0.5rem;
    font-size: 0.875rem;
}

/* Animation pour l'ouverture des modals */
.modal.is-active .modal-card {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Amélioration du textarea avec TinyMCE */
.tox-tinymce {
    border-radius: 4px;
}

@media screen and (max-width: 768px) {
    .tox-tinymce {
        height: 200px !important;
    }
    
    .tox-editor-header {
        padding: 4px !important;
    }
    
    .tox-toolbar__group {
        margin: 2px !important;
    }
}

/* Amélioration des boutons sur mobile */
@media screen and (max-width: 768px) {
    .button {
        padding: 0.75rem 1rem;
        font-size: 1rem;
        height: auto;
        min-height: 44px; /* iOS touch target */
    }
    
    .button .icon {
        margin-right: 0.5rem;
    }
}

/* Amélioration des champs de fichier */
.file.has-name .file-cta,
.file.has-name .file-name {
    padding: 0.75rem 1rem;
}

@media screen and (max-width: 768px) {
    .file.has-name {
        display: block;
    }
    
    .file.has-name .file-cta {
        border-radius: 4px 4px 0 0;
    }
    
    .file.has-name .file-name {
        border-radius: 0 0 4px 4px;
        border-top: none;
    }
}

/* Amélioration des messages d'aide */
.help {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

@media screen and (max-width: 768px) {
    .help {
        font-size: 0.7rem;
    }
}