/*
 * AulaCore drop zone (aulacore-dropzone.js): a compact file zone, 38 px high unless the view sets data-height.
 * Admin layouts load it through dist/css/layered/dropzone.css (layer "vendor"); the public theme links it as is.
 * Its two icons are Lucide symbols (cloud-upload, file; ISC License, Lucide Contributors) inlined as masks, painted
 * in the text colour, so the sheet needs neither an icon font nor the sprite's version.
 * Colours come from the AulaCore tokens, with the public theme's values as fallbacks.
 */
.dropify-wrapper {
    position: relative;
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    height: 38px;
    padding: 0 5px;
    overflow: hidden;
    font-family: Roboto, sans-serif;
    line-height: 36px;
    color: inherit;
    text-align: center;
    background-color: var(--ss-field-bg, #fff);
    border: 1px solid var(--ss-field-border, #ccc);
    cursor: pointer;
    transition: border-color .15s linear;
}
.dropify-wrapper.has-error {
    border-color: var(--ss-danger, #f34141);
}
.dropify-wrapper.ac-touch-fallback {
    height: auto;
}

/* The native input covers the zone: a click opens the file dialog and a dropped file lands on it. */
.dropify-wrapper input {
    position: absolute;
    inset: 0;
    z-index: 5;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}
.dropify-wrapper.disabled input {
    cursor: not-allowed;
}

/* Empty zone: icon and "Arrastre un archivo aquí...". */
.dropify-wrapper .dropify-message {
    position: relative;
    top: 50%;
    overflow: hidden;
    font-size: 11pt;
    white-space: nowrap;
    text-overflow: ellipsis;
    transform: translateY(-50%);
}
.dropify-wrapper .dropify-message p {
    margin: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.dropify-wrapper .dropify-message p.dropify-error {
    display: none;
    font-weight: 700;
    color: var(--ss-danger, #f34141);
}
.dropify-wrapper.has-error .dropify-message .dropify-error {
    display: block;
}
/* A rejected file: the zone says so in its one line, instead of the prompt. */
.dropify-wrapper.has-error .dropify-message p:not(.dropify-error) {
    display: none;
}
.dropify-wrapper.disabled .dropify-message {
    text-decoration: line-through;
    opacity: .5;
}
.dropify-wrapper.ac-touch-fallback .dropify-message {
    padding: 0;
    transform: none;
}
.dropify-wrapper.ac-touch-fallback.has-preview .dropify-message {
    display: none;
}
.dropify-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    font-style: normal;
    vertical-align: -.125em;
    background-color: currentColor;
    -webkit-mask: var(--dropify-icon) center / contain no-repeat;
    mask: var(--dropify-icon) center / contain no-repeat;
}
.dropify-icon--upload {
    --dropify-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 13v8'/%3E%3Cpath d='M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242'/%3E%3Cpath d='m8 17 4-4 4 4'/%3E%3C/svg%3E");
}
.dropify-icon--file {
    --dropify-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z'/%3E%3Cpath d='M14 2v4a2 2 0 0 0 2 2h4'/%3E%3C/svg%3E");
}
.ac-dropi18 {
    margin-right: 5px;
    font-size: 18px;
    vertical-align: text-bottom;
}

/* "Quitar": shown with a file, visible while the pointer is over the zone. */
.dropify-wrapper .dropify-clear {
    position: absolute;
    top: 2px;
    right: 2px;
    z-index: 7;
    display: none;
    padding: 0 8px;
    font-family: inherit;
    font-size: 10px;
    color: #fff;
    text-transform: uppercase;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .6);
    opacity: 0;
    cursor: pointer;
    transition: opacity .15s linear, background-color .15s linear;
}
.dropify-wrapper.has-preview .dropify-clear {
    display: block;
}
.dropify-wrapper:hover .dropify-clear,
.dropify-wrapper .dropify-clear:focus-visible {
    opacity: 1;
}
.dropify-wrapper .dropify-clear:hover {
    background: rgba(255, 255, 255, .2);
}
.dropify-wrapper.ac-touch-fallback .dropify-clear {
    top: auto;
    bottom: 23px;
    color: var(--ss-text-secondary, #777);
    border-color: rgba(119, 119, 119, .7);
    opacity: 1;
}

/* Preview: the image (or the file icon and its extension) under an overlay with the file name. */
.dropify-wrapper .dropify-preview {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: none;
    box-sizing: border-box;
    padding: 4px;
    overflow: hidden;
    text-align: center;
    background-color: var(--ss-field-bg, #fff);
}
.dropify-wrapper.has-preview .dropify-preview {
    display: block;
}
.dropify-wrapper .dropify-render {
    display: block;
    height: 100%;
}
.dropify-wrapper .dropify-render img {
    position: relative;
    top: 50%;
    display: block;
    margin: 0 auto;
    max-width: 100%;
    max-height: 100%;
    background-color: #fff;
    transform: translateY(-50%);
}
.dropify-wrapper .dropify-render .dropify-font-file {
    position: absolute;
    top: 50%;
    left: 50%;
    font-size: 70px;
    color: var(--bs-alert-bg, var(--ss-primary, #777));
    transform: translate(-50%, -50%);
}
.dropify-wrapper .dropify-render .dropify-extension {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 42px;
    margin-top: 10px;
    overflow: hidden;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: -.03em;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-transform: uppercase;
    transform: translate(-50%, -50%);
}
.dropify-wrapper .dropify-infos {
    position: absolute;
    inset: 0;
    z-index: 3;
    background: rgba(0, 0, 0, .7);
    opacity: 0;
    transition: opacity .15s linear;
}
.dropify-wrapper:hover .dropify-infos {
    opacity: 1;
}
.dropify-wrapper .dropify-infos-inner {
    position: absolute;
    top: 50%;
    box-sizing: border-box;
    width: 100%;
    padding: 0 20px;
    transform: translateY(-50%);
}
.dropify-wrapper .dropify-infos-inner p {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-weight: 700;
    line-height: 25px;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.dropify-wrapper .dropify-filename .ac-file-icon {
    margin-right: 2px;
}
.dropify-wrapper .dropify-infos-inner p.dropify-infos-message {
    margin-top: -24px;
    padding-top: 13px;
    font-size: 11px;
    opacity: .5;
}
.dropify-wrapper .dropify-infos-inner p.dropify-infos-message::before {
    position: absolute;
    top: 0;
    left: 50%;
    width: 30px;
    height: 2px;
    content: "";
    background: #fff;
    transform: translateX(-50%);
}
.dropify-wrapper.disabled .dropify-infos-message {
    display: none;
}

/* Touch screens: the preview and its name sit in the flow, below each other, without the hover overlay. */
.dropify-wrapper.ac-touch-fallback .dropify-preview {
    position: relative;
    padding: 0;
}
.dropify-wrapper.ac-touch-fallback .dropify-render {
    position: relative;
    height: auto;
}
.dropify-wrapper.ac-touch-fallback .dropify-render img,
.dropify-wrapper.ac-touch-fallback .dropify-render .dropify-font-file {
    position: relative;
    top: 0;
    left: 0;
    transform: none;
}
.dropify-wrapper.ac-touch-fallback .dropify-render .dropify-font-file {
    margin: 30px 0;
}
.dropify-wrapper.ac-touch-fallback .dropify-infos {
    position: relative;
    background: none;
    opacity: 1;
}
.dropify-wrapper.ac-touch-fallback .dropify-infos-inner {
    position: relative;
    top: 0;
    padding: 5px 90px 5px 0;
    transform: none;
}
.dropify-wrapper.ac-touch-fallback .dropify-infos-inner p {
    color: var(--ss-text-secondary, #777);
    text-align: left;
}
.dropify-wrapper.ac-touch-fallback .dropify-infos-inner p.dropify-infos-message {
    margin-top: 0;
    padding-top: 0;
    opacity: 1;
}
.dropify-wrapper.ac-touch-fallback .dropify-infos-inner p.dropify-infos-message::before {
    display: none;
}

/* Reading an image for the preview. */
.dropify-wrapper .dropify-loader {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 9;
    display: none;
}
.dropify-wrapper.is-loading .dropify-loader {
    display: block;
}
.dropify-wrapper .dropify-loader::after {
    position: relative;
    display: block;
    width: 20px;
    height: 20px;
    content: "";
    border: 1px solid var(--ss-field-border, #ccc);
    border-right-color: var(--ss-primary, #777);
    border-bottom-color: var(--ss-primary, #777);
    border-radius: 50%;
    animation: aulacore-dropzone-spin .6s linear infinite;
}
@keyframes aulacore-dropzone-spin {
    from { transform: rotate(-360deg); }
    to { transform: rotate(0deg); }
}

/* Rejected file (size or extension): the reasons over the zone for a few seconds, and while the pointer is on it. */
.dropify-wrapper .dropify-errors-container {
    position: absolute;
    inset: 0;
    z-index: 3;
    text-align: left;
    background: var(--ss-danger, #f34141);
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s linear .15s, opacity .15s linear;
}
.dropify-wrapper .dropify-errors-container.visible,
.dropify-wrapper.has-error:hover .dropify-errors-container {
    visibility: visible;
    opacity: 1;
    transition-delay: 0s;
}
.dropify-wrapper .dropify-errors-container ul {
    position: absolute;
    top: 50%;
    left: 0;
    margin: 0;
    padding: 0 20px;
    line-height: 1.4;
    transform: translateY(-50%);
}
.dropify-wrapper .dropify-errors-container li {
    margin-left: 20px;
    font-weight: 700;
    color: #fff;
}
.dropify-wrapper ~ .dropify-errors-container ul {
    margin: 15px 0;
    padding: 0;
}
.dropify-wrapper ~ .dropify-errors-container li {
    margin-left: 20px;
    font-weight: 700;
    color: var(--ss-danger, #f34141);
}
