/* ========================================================================== */
/* PENDIENTES - Monitoreo > Outdoor Static > Pendientes                      */
/* IMPORTANTE: Este archivo depende de shared-components.css                 */
/* ========================================================================== */

/* Eliminar padding del main-content para esta página */
.main-content:has(.pendientes-container) {
    padding: 0 !important;
}

.pendientes-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 95px);
    width: 100%;
    overflow: hidden;
}

/* ========================================================================== */
/* CONTENEDOR SUPERIOR - FILTROS                                             */
/* ========================================================================== */

.filters-container {
    flex: 0 0 auto;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 0.5rem 1.5rem;
    border-bottom: 1px solid #444444;
    background-color: #333333;
    flex-wrap: wrap;
    position: relative;
    z-index: 10;
}

/* Modo claro - Row de filtros blanco */
:root.light-mode .filters-container {
    background-color: #ffffff;
}

.filters-group-wrapper {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
    flex: 1;
    padding-left: 1rem;
    padding-right: 1rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 500;
    color: #ffffff;
    white-space: nowrap;
}

/* Modo claro - Labels con texto oscuro */
:root.light-mode .filter-group label {
    color: #1c1c1e;
}

/* Selects del topbar - colores fijos (override de shared-components.css) */
.filters-container .modern-select {
    padding: 0.5rem 1rem;
    border: 1px solid #444444;
    border-radius: 8px;
    background-color: #3a3a3a;
    color: #ffffff;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.filters-container .modern-select:hover {
    border-color: var(--primary-color);
}

.filters-container .modern-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(240, 116, 0, 0.1);
}

/* Modo claro - Selects con fondo blanco y texto oscuro */
:root.light-mode .filters-container .modern-select {
    background-color: #ffffff;
    color: #1c1c1e;
    border: 1px solid #d1d1d6;
}

:root.light-mode .filters-container .modern-select:hover {
    border-color: var(--primary-color);
    background-color: #f5f5f7;
}

:root.light-mode .filters-container .modern-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(240, 116, 0, 0.1);
    background-color: #ffffff;
}

/* Usa clase compartida btn-primary-gradient */
.btn-cargar-items {
    position: relative;
    z-index: 100;
    pointer-events: auto;
}

/* Label de progreso alineado a la derecha */
.progress-label {
    margin-left: auto;
    padding-right: 1.2rem;
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
}

/* Modo claro - Progress label con texto oscuro */
:root.light-mode .progress-label {
    color: #1c1c1e;
}

/* ========================================================================== */
/* CONTENEDOR MEDIO - ITEMS                                                  */
/* ========================================================================== */

.items-container {
    flex: 3 1 0;
    min-height: 0;
    overflow-y: auto;
    padding: 0.5rem 0;
    background-color: var(--bg-primary);
}

/* Usa clase compartida selectable-item */
.collection-item {
    margin: 0 0 0.5rem 0;
}

/* Estilos para items procesados/asignados */
.selectable-item.processed {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    opacity: 0.9;
}

.selectable-item.processed:hover {
    opacity: 1;
}

/* Usa clase compartida selectable-item-text */
.item-text {
}

/* Usa clase compartida empty-message */
.empty-message {
    height: 100%;
}

/* ========================================================================== */
/* CONTENEDOR INFERIOR - DOS COLUMNAS                                        */
/* ========================================================================== */

.bottom-container {
    flex: 7 1 0;
    min-height: 0;
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0;
    background-color: var(--bg-primary);
    overflow: hidden;
}

/* column-left, column-right - Override para 50/50 */
.pendientes-container .column-left,
.pendientes-container .column-right {
    flex: 1;
}

.image-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: var(--bg-primary);
    border-radius: 6px;
    padding: 0.5rem;
}

.recorte-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

/* Usa clase compartida no-image-placeholder */
.no-image-placeholder {
}

/* ========================================================================== */
/* DATOS TABULACIÓN - SEGUNDA COLUMNA                                        */
/* ========================================================================== */

.tabulacion-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    overflow-y: auto;
    min-height: 0;
    background-color: var(--bg-primary);
    border-radius: 6px;
}

.tabulacion-buttons {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    padding-top: 1rem;
    margin-top: auto;
}

/* Usa clase compartida btn-primary-gradient */
.btn-asignar-items {
}

/* Usa clase compartida btn-blue-gradient */
.btn-sin-publicidad {
}

/* Usa clase compartida btn-secondary-gradient */
.btn-refresh {
}

/* Estilo para item resaltado en dropdowns durante navegación con teclado */
.datalist-item.highlighted {
    background-color: var(--primary-color) !important;
    color: white !important;
}

/* ========================================================================== */
/* MODAL INFORMATIVO - Clases base en shared-components.css                 */
/* ========================================================================== */

/* Usa clases compartidas: modal-overlay, modal-content, modal-header, modal-body, modal-footer */

/* Botón específico de modal */
.btn-modal-close {
    border-radius: 8px;
}

/* ========================================================================== */
/* MODAL DE ZOOM DE IMAGEN                                                   */
/* ========================================================================== */

.zoom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 11000;
    backdrop-filter: blur(8px);
}

.zoom-modal-content {
    position: relative;
    width: 95%;
    height: 95%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.zoom-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 2001;
}

.zoom-modal-close:hover {
    background: rgba(240, 116, 0, 0.8);
    border-color: var(--primary-color);
    transform: rotate(90deg);
}

.zoom-controls {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.7);
    padding: 1rem 2rem;
    border-radius: 50px;
    z-index: 2001;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.zoom-btn {
    background: var(--primary-gradient);
    border: none;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.zoom-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(240, 116, 0, 0.5);
}

.zoom-btn:active {
    transform: scale(0.95);
}

.zoom-btn span {
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-reset-btn {
    padding: 0.5rem 1.5rem;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.zoom-reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(240, 116, 0, 0.3);
}

.zoom-reset-btn:active {
    transform: translateY(0);
}

.zoom-level {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
}

.zoom-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 2rem;
}

.zoom-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.2s ease;
    cursor: grab;
}

.zoom-image:active {
    cursor: grabbing;
}

/* ========================================================================== */
/* RESPONSIVE                                                                 */
/* ========================================================================== */

@media (max-width: 768px) {
    /* Permitir scroll en el contenedor principal */
    .pendientes-container {
        height: auto;
        min-height: calc(100vh - 95px);
        overflow-y: auto;
    }

    .filters-container {
        min-height: 80px;
        padding: 0.75rem 1rem;
        gap: 1rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .filters-group-wrapper {
        width: 100%;
        flex-direction: column;
        gap: 1rem;
    }

    .filter-group {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .modern-select {
        width: 100%;
        min-width: unset;
    }

    .btn-cargar-items,
    .btn-solo-pendientes {
        width: 100%;
    }

    .progress-label {
        margin-left: 0;
        width: 100%;
    }

    /* Items container - permitir tamaño natural */
    .items-container {
        flex: none;
        max-height: 200px;
        overflow-y: auto;
    }

    /* Bottom container - sin flex, height auto */
    .bottom-container {
        flex: none;
        flex-direction: column;
        gap: 1rem;
        overflow: visible;
    }

    .column-left,
    .column-right {
        width: 100%;
        flex: none;
        overflow: visible;
    }

    /* Contenedor de imagen/video - aspect ratio 16:9 */
    .image-body {
        flex: none;
        height: auto;
        aspect-ratio: 16 / 9;
        min-height: 300px;
        padding: 0;
    }

    /* Ajustar imagen/video para mantener proporción */
    .recorte-image {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
    }

    .form-group-vertical {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .form-group-vertical label {
        min-width: unset;
    }

    .tabulacion-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .btn-asignar-items,
    .btn-sin-publicidad,
    .btn-refresh {
        width: 100%;
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
    }

    .zoom-controls {
        padding: 0.75rem 1.5rem;
        gap: 0.75rem;
    }

    .zoom-btn {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }

    .zoom-reset-btn {
        padding: 0.5rem 1.2rem;
        font-size: 0.95rem;
    }

    .zoom-level {
        font-size: 1rem;
        min-width: 50px;
    }
}

@media (max-width: 480px) {
    .pendientes-container {
        height: auto;
        min-height: calc(100vh - 95px);
        overflow-y: auto;
    }

    .filters-container {
        padding: 0.5rem;
    }

    .items-container {
        padding: 0.5rem 0;
        flex: none;
        max-height: 180px;
    }

    .collection-item {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .bottom-container {
        padding: 0.5rem 0;
        flex: none;
        overflow: visible;
    }

    .column-left,
    .column-right {
        flex: none;
        overflow: visible;
    }

    /* Aspect ratio para móviles */
    .image-body {
        flex: none;
        height: auto;
        aspect-ratio: 16 / 9;
        min-height: 250px;
        padding: 0;
    }

    .recorte-image {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
    }

    .zoom-controls {
        padding: 0.5rem 1rem;
        gap: 0.5rem;
        bottom: 1rem;
    }

    .zoom-btn {
        width: 35px;
        height: 35px;
        font-size: 1.1rem;
    }

    .zoom-reset-btn {
        padding: 0.4rem 1rem;
        font-size: 0.85rem;
    }

    .zoom-level {
        font-size: 0.9rem;
        min-width: 45px;
    }

    .zoom-modal-close {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
        top: 0.5rem;
        right: 0.5rem;
    }

    .zoom-image-container {
        padding: 1rem;
    }
}
