﻿/* stage-button: el botón completo */
.stage-button {
    border-radius: 2rem;
    padding: 0.375rem 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* stage-badge: el número circular */
.stage-badge {
    margin-left: 10px;
    min-width: 22px;
    height: 22px;
    background-color: white;
    color: black;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.k-grid-norecords {
    display: flex !important;
    justify-content: center;
    align-items: center;
    height: 100%;
    min-height: 120px;
    text-align: center;
    font-style: italic;
    color: #888;
}

/* Ocultar input file para fotos */
#filesAttachPhoto {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Ocultar el wrapper de Kendo Upload */
#filesAttachPhoto.k-hidden,
.k-upload[id="filesAttachPhoto"],
.k-upload-sync[id^="filesAttachPhoto"],
.k-upload[aria-label*="filesAttachPhoto"],
.k-upload-sync {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Fila horizontal con scroll - ID genérico para todas las galerías de fotos */

div#photo-gallery {
    border-radius: 8px !important;
}

#photo-gallery .k-listview-content {
    display: flex;
    flex-wrap: nowrap;
    gap: .75rem;
    overflow-x: auto;
    padding: .25rem;
    scroll-snap-type: x mandatory;
    min-height: 116px;
}

/* Preview de fotos antes de guardar */
div#photo-gallery-preview {
    border-radius: 8px !important;
}

#photo-gallery-preview .k-listview-content {
    display: flex;
    flex-wrap: nowrap;
    gap: .75rem;
    overflow-x: auto;
    padding: .25rem;
    scroll-snap-type: x mandatory;
    min-height: 116px;
}

#articles-input-dynamic-form .k-disabled,
#articles-input-dynamic-form .k-state-disabled {
    border: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

#articles-input-dynamic-form {
    border: none !important;
}

/* ====== FOTOS / GALERÍA DE IMÁGENES ====== */

/* Contenedor de imagen individual */
.photo-item {
    width: 192px;
    height: 108px;
    border: 1px solid #ccc;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Imagen dentro del contenedor */
.photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

/* Acciones / Botones (aparecen al hover en el centro) */
.photo-actions {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    border-radius: 6px;
    z-index: 10;
}

.photo-item:hover .photo-actions {
    opacity: 1;
}

/* Botones de acción */
.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    padding: 0;
    cursor: pointer;
    background-color: #0d6efd;
    color: white;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.btn-icon.btn-delete {
    background-color: #dc3545;
}

.btn-icon.btn-delete:hover {
    background-color: #bb2d3b;
}

/* Compatibilidad: referenciador antiguo (foto-item) */
.foto-item {
    width: 120px;
    height: 100px;
    border: 1px solid #ccc;
    border-radius: 6px;
    overflow: visible;
    position: relative;
    display: inline-block;
    background-color: #f8f9fa;
    margin: 15px 5px 5px 5px;
}

.foto-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 6px;
    overflow: hidden;
}

.btn-view-action,
.btn-single-action {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
    padding: 8px 10px;
    font-size: 14px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    z-index: 2;
}

.btn-delete-action {
    position: absolute;
    top: -12px;
    right: -12px;
    padding: 4px 6px;
    font-size: 10px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    border: none;
    opacity: 1;
    pointer-events: auto;
    z-index: 3;
}

.foto-item:hover .btn-single-action,
.foto-item:hover .btn-view-action {
    opacity: 1;
    pointer-events: auto;
}

.foto-item:hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    pointer-events: none;
    z-index: 1;
}

/* Carrusel / Listview de imágenes cargadas */
.k-listview-content.photo-strip {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 0.25rem 0 0.5rem;
    scroll-snap-type: x mandatory;
}

.k-listview-item.photo-item-scroll {
    flex: 0 0 auto;
    width: 220px;
    scroll-snap-align: start;
}

@media (hover: none) {
    .photo-actions {
        opacity: 1;
    }
}