/* Estilos para la sección de manuales */
.manuales-container {
    width: calc(100% - 40px);
    padding: 20px;
}

.manuales-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.manuales-title {
    font-size: 2em;
    color: var(--azul);
    margin: 0;
    font-family: 'RobotoCondensed', sans-serif;
    font-weight: 700;
}

.manuales-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* Estilos para el input de archivos múltiples */
.file-upload-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    left: -9999px;
}

.file-input-label {
    background: var(--azul);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'RobotoCondensed', sans-serif;
    font-weight: 500;
}

.file-input-label:hover {
    background: #0837cc;
}

.file-input-label i {
    font-size: 16px;
}

.upload-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-family: 'RobotoCondensed', sans-serif;
    font-weight: 500;
}

.upload-btn:hover {
    background: #45a049;
}

.upload-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.export-btn {
    background: #ff9800;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-family: 'RobotoCondensed', sans-serif;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.export-btn:hover {
    background: #f57c00;
}

.export-btn i {
    font-size: 16px;
}

/* Estilos para estadísticas */
.stats-container {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
    border: 1px solid #e9ecef;
}

.stat-item {
    text-align: center;
    min-width: 120px;
}

.stat-number {
    display: block;
    color: var(--azul);
    font-size: 1.5em;
    font-weight: 700;
    font-family: 'RobotoCondensed', sans-serif;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
    font-family: 'RobotoCondensed', sans-serif;
    font-weight: 500;
}

/* Estilos para filtros */
.filtros-container {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.filtro-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filtro-group label {
    font-weight: bold;
    color: var(--azul);
    font-size: 0.9em;
    font-family: 'RobotoCondensed', sans-serif;
}

.filtro-group input {
    padding: 8px 12px;
    border: var(--borde);
    border-radius: 4px;
    min-width: 150px;
    font-family: 'RobotoCondensed', sans-serif;
}

.filtros-buttons {
    display: flex;
    gap: 10px;
    align-items: end;
}

.btn-filtro {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: bold;
    font-family: 'RobotoCondensed', sans-serif;
}

.btn-aplicar {
    background: var(--azul);
    color: white;
}

.btn-aplicar:hover {
    background: #0837cc;
}

.btn-limpiar {
    background: #f44336;
    color: white;
}

.btn-limpiar:hover {
    background: #d32f2f;
}

/* Estilos para tabla de manuales (administrador/técnico) */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.table thead {
    background: var(--azul);
    color: white;
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table tbody tr {
    transition: background-color 0.2s;
}

.table tbody tr:hover {
    background-color: #f5f5f5;
}

.table tbody tr.sortable-chosen {
    background-color: #e3f2fd;
}

.drag-handle {
    cursor: grab;
    text-align: center;
    color: var(--azul);
    font-size: 16px;
}

.drag-handle:active {
    cursor: grabbing;
}

.table input[type="text"] {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: transparent;
    transition: border-color 0.2s;
}

.table input[type="text"]:focus {
    outline: none;
    border-color: var(--azul);
    background: white;
}

.table button {
    background: var(--azul);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-family: 'RobotoCondensed', sans-serif;
    font-weight: 500;
}

.table button:hover {
    background: #0837cc;
}

/* Estilos para cards de manuales (cliente) */
.manuales-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.manual-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.manual-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.card-title {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--azul);
    margin-bottom: 10px;
    margin-top: 0;
}

.card-text {
    color: #666;
    margin: 5px 0;
    font-size: 0.9em;
}

/* Modal para visualizar manual - Sistema simplificado 
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}*/

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1;
}

.modal-viewer {
    position: relative;
    width: 95vw;
    height: 95vh;
    background: white;
    border-radius: 8px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header fijo */
.modal-header-fixed {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-title {
    margin: 0;
    font-size: 1.2em;
    color: var(--azul);
    font-family: 'RobotoCondensed', sans-serif;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2em;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #666;
}

/* Controles fijos */
.modal-controls-fixed {
    background: #f8f9fa;
    padding: 10px 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    flex-shrink: 0;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-controls button {
    background: var(--azul);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.9em;
    min-width: 35px;
}

.nav-controls button:hover:not(:disabled) {
    background: #0837cc;
}

.nav-controls button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.nav-controls span {
    font-weight: 500;
    color: var(--azul);
    font-family: 'RobotoCondensed', sans-serif;
    font-size: 0.9em;
}

.nav-controls input[type="number"] {
    width: 60px;
    padding: 6px 8px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9em;
}

.zoom-controls-fixed {
    display: flex;
    align-items: center;
    gap: 10px;
}

.zoom-controls-fixed button {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 1em;
    font-weight: bold;
    min-width: 35px;
}

.zoom-controls-fixed button:hover:not(:disabled) {
    background: #218838;
}

.zoom-controls-fixed button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.zoom-controls-fixed span {
    font-size: 0.9em;
    color: #28a745;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
}

/* Contenedor de imagen */
.image-container {
    flex: 1;
    overflow: auto;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.image-container img {
    display: block;
    width: auto;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    background: white;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
}

/* Notificaciones */
.notificacion {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-left: 4px solid rgba(255,255,255,0.3);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Estilos responsive 
@media (max-width: 1024px) {
    .zoom-controls-fixed {
        display: none;
    }
}*/

@media (max-width: 768px) {
    .manuales-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .manuales-actions {
        justify-content: center;
    }
    
    .filtros-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filtro-group input {
        min-width: auto;
        width: 100%;
    }
    
    .filtros-buttons {
        justify-content: center;
        margin-top: 10px;
    }
    
    .file-upload-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .table {
        font-size: 0.9em;
    }
    
    .table th,
    .table td {
        padding: 8px 6px;
    }
    
    .manuales-cards {
        grid-template-columns: 1fr;
    }
    
    /* Modal responsive */
    .modal-viewer {
        width: 98vw;
        height: 98vh;
    }
    
    .modal-header-fixed {
        padding: 10px 15px;
    }
    
    .modal-title {
        font-size: 1em;
    }
    
    .modal-close {
        font-size: 1.8em;
    }
    
    .modal-controls-fixed {
        padding: 8px 15px;
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-controls button {
        padding: 6px 10px;
        font-size: 0.8em;
        min-width: 30px;
    }
    
    .nav-controls span {
        font-size: 0.8em;
    }
    
    .nav-controls input[type="number"] {
        width: 50px;
        padding: 4px 6px;
        font-size: 0.8em;
    }
    
    .image-container {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .manuales-container {
        padding: 10px;
    }
    
    .manuales-title {
        font-size: 1.5em;
    }
    
    .file-input-label,
    .upload-btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    
    .table th,
    .table td {
        padding: 6px 4px;
        font-size: 0.8em;
    }
    
    .table input[type="text"] {
        font-size: 0.8em;
        padding: 4px 6px;
    }
}

/* Estados de carga */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9998;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--azul);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mensajes vacíos */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-state i {
    font-size: 3em;
    color: #ccc;
    margin-bottom: 20px;
}

.empty-state h3 {
    color: var(--azul);
    margin-bottom: 10px;
}

.empty-state p {
    color: #999;
    line-height: 1.5;
}
