/* Unified Upload — dashboard component */

#unified-upload {
    width: 100%;
}

/* Zona decorativa: la UI bonita que ve el usuario */
.du-decor {
    align-items: center;
    background: #f8faf9;
    border: 2px dashed #cbd8d3;
    border-radius: 12px;
    color: #4d5b56;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 1.6rem 1rem;
    position: relative;
    text-align: center;
    transition: background .15s, border-color .15s, color .15s;
    width: 100%;
}

.du-decor:hover,
.du-decor:focus,
.du-decor.is-dragover {
    background: #eef4f1;
    border-color: #246b55;
    color: #1f4a3c;
    outline: none;
}

.du-decor__icon {
    align-items: center;
    background: #ffffff;
    border: 1px solid #d4e0db;
    border-radius: 50%;
    color: #246b55;
    display: inline-flex;
    height: 56px;
    justify-content: center;
    margin-bottom: 0.3rem;
    width: 56px;
}

.du-decor__title {
    color: #24312d;
    font-size: 1rem;
    font-weight: 700;
}

.du-decor__hint {
    color: #6a7873;
    font-size: 0.9rem;
}

.du-decor__formats {
    color: #8a9991;
    font-size: 0.78rem;
    margin-top: 0.4rem;
}

/* Mount: contenedor sobre el que se invoca jquery.uploadFile. OJO: el
   plugin NO inyecta dentro de .du-mount, sino que inserta sus elementos
   (.ajax-upload-dragdrop, statusbar, etc.) como HERMANOS, hijos directos
   de #unified-upload, y ademas oculta el propio .du-mount con this.hide().
   Por eso las reglas que ocultan/estilizan el plugin se escopan a
   #unified-upload y NO a .du-mount (de lo contrario no harian match y la
   caja nativa "Drag & Drop Files" quedaria visible). */
.du-mount {
    display: block;
    margin: 0;
    width: 100%;
}

#unified-upload .ajax-upload-dragdrop {
    border: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    position: absolute !important;
    width: 0 !important;
}

#unified-upload .ajax-file-upload {
    height: 0 !important;
    margin: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    width: 0 !important;
}

/* Statusbar del plugin durante la subida (progreso + Abort). Se ve como una
   tarjeta limpia debajo de la zona decorativa, dentro de #unified-upload. */
#unified-upload .ajax-file-upload-statusbar {
    background: #ffffff !important;
    border: 1px solid #dce5e1 !important;
    border-radius: 8px !important;
    margin: 0.55rem 0 0 !important;
    padding: 0.6rem 0.75rem !important;
    width: 100% !important;
}

#unified-upload .ajax-file-upload-filename {
    color: #24312d !important;
    display: block !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    margin: 0 0 0.45rem !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

#unified-upload .ajax-file-upload-progress {
    background: #eef4f1 !important;
    border: 0 !important;
    border-radius: 999px !important;
    display: block !important;
    height: 8px !important;
    margin: 0 0 0.55rem !important;
    overflow: hidden !important;
    padding: 0 !important;
    width: 100% !important;
}

#unified-upload .ajax-file-upload-bar {
    background: #246b55 !important;
    border-radius: 999px !important;
    height: 8px !important;
}

/* Botones de la statusbar (Abort / Cancel / Done) como pills limpias.
   OJO: no forzar `display` — el plugin oculta los botones que no aplican
   (Cancel/Done/Delete) con `display:none` inline; un !important los
   revelaria todos. Dejamos que el inline del plugin controle visibilidad. */
#unified-upload .ajax-file-upload-red,
#unified-upload .ajax-file-upload-green {
    border: 0 !important;
    border-radius: 999px !important;
    box-shadow: none !important;
    cursor: pointer !important;
    font-family: inherit !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    margin: 0 0.4rem 0 0 !important;
    padding: 0.4rem 0.9rem !important;
    text-decoration: none !important;
    text-shadow: none !important;
    transition: background .15s, color .15s !important;
    vertical-align: middle !important;
}

#unified-upload .ajax-file-upload-red {
    background: #fdecec !important;
    border: 1px solid #eebcbc !important;
    color: #b14242 !important;
}

#unified-upload .ajax-file-upload-red:hover,
#unified-upload .ajax-file-upload-red:focus {
    background: #f6d2d2 !important;
    border-color: #e3a3a3 !important;
    color: #8f2f2f !important;
}

#unified-upload .ajax-file-upload-green {
    background: #eaf3ee !important;
    border: 1px solid #bfe0cd !important;
    color: #246b55 !important;
}

/* Lista de archivos clasificados */
.du-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin: 0.8rem 0 0;
}

.du-list[hidden] {
    display: none;
}

.du-item {
    align-items: center;
    background: #ffffff;
    border: 1px solid #dce5e1;
    border-radius: 8px;
    display: flex;
    gap: 0.6rem;
    padding: 0.55rem 0.7rem;
    transition: border-color .15s, box-shadow .15s;
}

.du-item:hover {
    border-color: #bcd0c8;
    box-shadow: 0 2px 8px rgba(36, 107, 85, 0.08);
}

.du-item__icon {
    align-items: center;
    background: #eef4f1;
    border-radius: 6px;
    color: #246b55;
    display: inline-flex;
    flex: 0 0 auto;
    height: 32px;
    justify-content: center;
    width: 32px;
}

.du-item--video .du-item__icon { background: #fdf2e9; color: #b56a1c; }
.du-item--document .du-item__icon { background: #f0f4fb; color: #2d6f9f; }

/* Miniatura real de imagen dentro del item (vista previa) */
.du-item__icon--img {
    background: transparent;
    overflow: hidden;
    padding: 0;
}

/* Enlace clicable que abre la imagen a tamano completo (fancybox) */
.du-item__preview {
    cursor: pointer;
    display: block;
    height: 100%;
    width: 100%;
}

.du-item__preview:hover {
    opacity: 0.85;
}

.du-item__thumb {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.du-item__name {
    color: #24312d;
    flex: 1;
    font-size: 0.92rem;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.du-item__tag {
    background: #eef4f1;
    border-radius: 999px;
    color: #246b55;
    flex: 0 0 auto;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.5rem;
    text-transform: uppercase;
}

.du-item__tag--video { background: #fdf2e9; color: #b56a1c; }
.du-item__tag--document { background: #f0f4fb; color: #2d6f9f; }

/* Boton de quitar: circulo rojo siempre visible (no solo en hover) para que
   se lea claramente como "remove" si el usuario se arrepiente de un archivo. */
.du-item__remove {
    align-items: center !important;
    background: #fdecec !important;
    border: 1px solid #eebcbc !important;
    border-radius: 50% !important;
    color: #b14242 !important;
    cursor: pointer;
    display: inline-flex !important;
    flex: 0 0 auto;
    font-size: 1.15rem !important;
    height: 28px !important;
    justify-content: center !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    transition: background .15s, color .15s, transform .1s;
    width: 28px !important;
}

.du-item__remove:hover,
.du-item__remove:focus {
    background: #f1bcbc !important;
    color: #8f2f2f !important;
    outline: none !important;
    transform: scale(1.08);
}

/* Archivos YA cargados (existing) — grid de tarjetas */
.du-existing {
    margin: 1rem 0 0;
}

.du-existing__title {
    color: #4d5b56;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin: 0 0 0.5rem;
    text-transform: uppercase;
}

.du-existing__grid {
    display: grid;
    gap: 0.6rem;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.du-existing__card {
    background: #ffffff;
    border: 1px solid #dce5e1;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.du-existing__media {
    align-items: center;
    background: #eef4f1;
    display: flex;
    height: 110px;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.du-existing__media img,
.du-existing__media video {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.du-existing__media .du-existing__icon {
    color: #246b55;
}

.du-existing__doc-icon { color: #2d6f9f; }

.du-existing__name {
    color: #24312d;
    font-size: 0.82rem;
    font-weight: 600;
    overflow: hidden;
    padding: 0.4rem 0.55rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.du-existing__actions {
    align-items: center;
    border-top: 1px solid #eef2f0;
    display: flex;
    gap: 0;
    justify-content: stretch;
}

.du-existing__actions a {
    color: #246b55 !important;
    flex: 1;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    padding: 0.4rem 0.5rem !important;
    text-align: center;
    text-decoration: none !important;
}

.du-existing__actions a + a {
    border-left: 1px solid #eef2f0;
}

.du-existing__actions a.du-existing__delete {
    color: #b14242 !important;
}

.du-existing__actions a:hover {
    background: #eef4f1;
}

.du-existing__actions a.du-existing__delete:hover {
    background: #fdecec;
}
