/* PDF Viewer Sidebar Styles */
.pdf-sidebar {
  position: fixed;
  top: 0;
  right: -50vw; /* Inicialmente oculta - mitad del viewport */
  width: 50vw; /* Mitad del ancho de la ventana */
  height: 100vh;
  background: white;
  box-shadow: -2px 0 10px rgba(0,0,0,0.1);
  z-index: 1050;
  transition: right 0.3s ease-in-out;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.pdf-sidebar.show {
  right: 0; /* Visible */
}

.pdf-sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.pdf-sidebar-overlay.show {
  opacity: 1;
  visibility: visible;
}

.pdf-sidebar-header {
  position: sticky;
  top: 0;
  background: white;
  border-bottom: 1px solid #dee2e6;
  padding: 1rem;
  z-index: 10;
  flex-shrink: 0;
}

.pdf-sidebar-content {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
}

.pdf-sidebar-footer {
  position: sticky;
  bottom: 0;
  background: white;
  border-top: 1px solid #dee2e6;
  padding: 0.75rem 1rem;
  z-index: 10;
  flex-shrink: 0;
  min-height: 60px; /* Mismo alto aproximado que el header */
}

.pdf-sidebar-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #6c757d;
  transition: color 0.2s ease;
}

.pdf-sidebar-close:hover {
  color: #dc3545;
}

/* Navigation buttons styling */
.pdf-sidebar-footer .btn {
  min-width: 100px;
  transition: all 0.2s ease;
}

.pdf-sidebar-footer .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pdf-sidebar-footer .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Table row selection styles */
.table tbody tr {
  transition: background-color 0.2s ease;
}

.table tbody tr:hover {
  background-color: rgba(0,123,255,0.1) !important;
}

.table tbody tr.table-active {
  background-color: rgba(0,123,255,0.2) !important;
  border-left: 4px solid #007bff;
}

.table tbody tr.table-active td {
  font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .pdf-sidebar {
    width: 100vw; /* En móviles ocupa toda la pantalla */
    right: -100vw;
  }
  
  .pdf-sidebar-footer .btn {
    min-width: 80px;
    font-size: 0.875rem;
  }
}

@media (max-width: 1200px) and (min-width: 769px) {
  .pdf-sidebar {
    width: 60vw; /* En tablets un poco más ancha */
    right: -60vw;
  }
}

/* Loading animation */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.pdf-viewer-container {
  animation: fadeIn 0.3s ease-in;
}
