/* ==========================================================================
   Estilos Específicos para Dividir PDF Pro (Workspace Avanzado)
   ========================================================================== */

/* Ajustes Base por si interfiere con unir-pdf.css */
.tool-page {
    /* Mantenemos fondo top */
}

/* ==========================================================================
   Estructura Dividida del Workspace (Izquierda: Controles / Derecha: Páginas)
   ========================================================================== */
.split-workspace {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    margin-top: 20px;
    animation: fadeIn 0.4s ease forwards;
}

@media (max-width: 900px) {
    .split-workspace {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Panel Lateral (Opciones)
   ========================================================================== */
.options-panel {
    background-color: #1a1a1a;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    height: fit-content;
    position: sticky;
    top: 100px;
    /* Para que baje al hacer scroll visualizando miles de páginas */
}

.panel-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.file-info-badge {
    display: inline-block;
    background-color: rgba(229, 9, 20, 0.15);
    color: var(--primary-color);
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 25px;
    border: 1px solid rgba(229, 9, 20, 0.3);
    word-break: break-all;
}

/* TABS Sistema */
.tabs-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.tab-btn {
    background-color: transparent;
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 15px;
    text-align: left;
    border-radius: 6px;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
}

.tab-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(229, 9, 20, 0.3);
}

.tab-content {
    background-color: #0f0f0f;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 30px;
    animation: fadeIn 0.3s;
}

.tab-desc {
    font-size: 0.85rem;
    color: #a0a0a0;
    line-height: 1.5;
    margin-bottom: 15px;
}

.tab-desc b {
    color: white;
}

.tab-desc.warning b {
    color: #ffcc00;
    /* Alerta visual */
}

.modern-input {
    width: 100%;
    background-color: #222;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color var(--transition-fast);
}

.modern-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.selection-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.btn-text {
    color: var(--primary-color);
    font-size: 0.85rem;
    text-decoration: underline;
    opacity: 0.8;
}

.btn-text:hover {
    opacity: 1;
}

.full-width {
    width: 100%;
    display: flex;
    justify-content: center;
}

.mt-10 {
    margin-top: 10px;
}

/* ==========================================================================
   Grilla Visual de Páginas
   ========================================================================== */
.pages-preview-area {
    background-color: #141414;
    border-radius: 12px;
    padding: 25px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.pages-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 20px;
}

/* Grilla responsive que se achica como un mosaico */
.pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
}

/* Tarjeta individual de Página */
.page-thumb {
    aspect-ratio: 1 / 1.414;
    /* Proporción A4 exacta */
    background-color: #2a2a2a;
    border: 2px solid transparent;
    /* Para el active/hover state */
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: transform var(--transition-fast), border-color 0.2s, background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.page-thumb:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.5);
    background-color: #333;
}

/* Estado de la tarjeta seleccionada (El checkbox visual tipo Galería) */
.page-thumb.selected {
    border-color: var(--primary-color);
    /* background-color: rgba(229, 9, 20, 0.1);  Decisión de diseño: quizá solo el borde */
}

/* La tarjeta genérica visual por dentro */
.page-thumb-inner {
    width: 100%;
    height: 100%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 6px;
    box-sizing: border-box;
}

.page-thumb-inner canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.page-number-big {
    font-size: 2rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.2s;
}

.page-thumb.selected .page-number-big {
    color: var(--primary-color);
}

/* Ticked Checkmark */
.check-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: var(--primary-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.page-thumb.selected .check-badge {
    opacity: 1;
    transform: scale(1);
}