/* ==========================================================================
   Dropzone - Styles custom pour hastone_forms
   Ce fichier complète dropzone.min.css (styles de base de la lib)
   ========================================================================== */

/* Zone de drop : adaptation au style du formulaire */
.hastone-dropzone.dropzone {
    min-height: 180px;
    border: 2px dashed var(--blue, #00B0E6);
    border-radius: 1rem;
    background-color: #fafcfe;
    padding: 20px;
    transition: border-color 0.25s ease, background-color 0.25s ease;
    cursor: pointer;
}

.hastone-dropzone.dropzone:hover {
    border-color: var(--darkBlue, #00235B);
    background-color: #f0f7fc;
}

.hastone-dropzone.dropzone.dz-drag-hover {
    border-color: var(--darkBlue, #00235B);
    background-color: #e6f2fa;
    border-style: solid;
}

/* Message par défaut */
.hastone-dropzone .dz-message {
    margin: 1.5em 0;
    text-align: center;
}

.hastone-dropzone .dz-message .dz-button {
    background: none;
    border: none;
    color: #555 !important;
    font-size: 1.5rem;
    font-weight: 500;
    cursor: pointer;
    line-height: 1.6;
    padding: 0;
}

.hastone-dropzone .dz-message .dz-button::before {
    content: '';
    display: block;
    width: 48px;
    height: 48px;
    margin: 0 auto 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300B0E6' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='17 8 12 3 7 8'/%3E%3Cline x1='12' y1='3' x2='12' y2='15'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* Compteur de fichiers */
.hastone-dropzone-counter {
    font-size: 1.3rem;
    color: #888;
    text-align: right;
    margin-top: 6px;
}

.hastone-dropzone-counter .count-current {
    font-weight: 600;
    color: var(--blue, #00B0E6);
}

.hastone-dropzone-counter.is-max .count-current {
    color: #e74c3c;
}

/* Previews des fichiers : inline-flex column pour garder l'alignement
   horizontal des vignettes tout en empilant proprement
   miniature → message d'erreur → bouton supprimer. */
.hastone-dropzone .dz-preview {
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
    vertical-align: top;
    width: 120px;
    min-height: 80px;
    margin: 10px;
}

.hastone-dropzone .dz-preview .dz-image {
    flex: 0 0 auto;
    float: none;
    align-self: center;
    border-radius: 8px;
    width: 100px;
    height: 100px;
}

.hastone-dropzone .dz-preview .dz-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Icone pour les fichiers non-image (PDF) */
.hastone-dropzone .dz-preview.dz-file-preview .dz-image {
    background: linear-gradient(to bottom, #f0f0f0, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Bouton de suppression custom */
.hastone-dropzone .dz-preview .dz-remove-btn {
    display: block;
    position: relative;
    z-index: 50;
    width: 100%;
    margin-top: 5px;
    padding: 4px 6px;
    font-size: 1.1rem;
    line-height: 1.2;
    text-align: center;
    color: #e74c3c !important;
    background: #fff;
    border: 1px solid #e74c3c;
    border-radius: 4px;
    cursor: pointer;
    pointer-events: auto;
    transition: background-color 0.2s, color 0.2s;
}

.hastone-dropzone .dz-preview .dz-remove-btn:hover {
    background-color: #e74c3c;
    color: #fff !important;
}

/* Barre de progression (masquée car pas d'upload AJAX) */
.hastone-dropzone .dz-preview .dz-progress {
    display: none;
}

/* Marks succès/erreur : centrés sur la vignette de 100×100 (et non sur
   le preview entier, qui est plus haut depuis qu'il empile message +
   bouton sous l'image). */
.hastone-dropzone .dz-preview .dz-success-mark,
.hastone-dropzone .dz-preview .dz-error-mark {
    top: 50px;
    left: 50%;
    margin-left: -23px;
    margin-top: -23px;
}

.hastone-dropzone .dz-preview .dz-success-mark svg,
.hastone-dropzone .dz-preview .dz-error-mark svg {
    width: 46px;
    height: 46px;
}

/* Message d'erreur : sorti du positionnement absolu pour s'insérer dans
   le flux normal du preview, entre l'aperçu et le bouton supprimer.
   Évite le débordement hors de la dropzone et le recouvrement du bouton. */
.hastone-dropzone .dz-preview .dz-error-message {
    position: static;
    display: none;
    width: 100%;
    margin-top: 5px;
    padding: 4px 6px;
    font-size: 1rem;
    line-height: 1.3;
    color: #fff;
    background: #e74c3c;
    border-radius: 4px;
    white-space: normal;
    word-break: break-word;
    pointer-events: none;
}

.hastone-dropzone .dz-preview .dz-error-message::after {
    display: none;
}

/* Toujours visible quand le fichier est en erreur, pas seulement au hover */
.hastone-dropzone .dz-preview.dz-error .dz-error-message {
    display: block;
    opacity: 1;
}

/* Détails du fichier : contenus dans la zone de la vignette */
.hastone-dropzone .dz-preview .dz-details {
    font-size: 1rem;
    padding: 4px 6px;
    min-width: 100%;
    max-width: 100%;
    max-height: 100px;
    overflow: hidden;
    pointer-events: none;
}

.hastone-dropzone .dz-preview .dz-details .dz-size {
    font-size: 1rem;
    margin-bottom: 2px;
}

.hastone-dropzone .dz-preview .dz-details .dz-size span {
    padding: 0 2px;
    font-size: 0.9rem;
}

.hastone-dropzone .dz-preview .dz-details .dz-filename {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

.hastone-dropzone .dz-preview .dz-details .dz-filename span {
    padding: 0 2px;
    font-size: 0.9rem;
}

/* ======= Responsive / Mobile ======= */
@media screen and (max-width: 767px) {
    .hastone-dropzone.dropzone {
        min-height: 140px;
        padding: 15px 10px;
    }

    .hastone-dropzone .dz-message .dz-button {
        font-size: 1.4rem;
    }

    .hastone-dropzone .dz-message .dz-button::before {
        width: 40px;
        height: 40px;
    }

    .hastone-dropzone .dz-preview {
        margin: 8px 5px;
    }

    .hastone-dropzone .dz-preview .dz-image {
        width: 80px;
        height: 80px;
    }

    .hastone-dropzone .dz-preview .dz-details {
        font-size: 1.1rem;
    }

    .hastone-dropzone .dz-preview .dz-error-message {
        top: 90px;
        width: 120px;
        font-size: 1.1rem;
    }
}
