/* ===================================
   FACTULITE - MAIN STYLES
   Estilos personalizados adicionales
   =================================== */

/* === BODY Y TIPOGRAFÍA === */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #f7f7f7 0%, #f2f2f2 100%);
  min-height: 100vh;
  color: #333;
  padding: 0;
}

/* === CONTAINER EXTENDIDO PARA LISTAS === */
/* Proporciona más ancho para tablas con muchas columnas */
@media (min-width: 1200px) {
  .list-container-wide {
    max-width: 1400px !important;
  }
}

@media (min-width: 1400px) {
  .list-container-wide {
    max-width: 1600px !important;
  }
}

@media (min-width: 1920px) {
  .list-container-wide {
    max-width: 1800px !important;
  }
}

/* Espaciado adicional en dispositivos grandes */
@media (min-width: 992px) {
  .container,
  .container-fluid {
    padding-left: 3rem !important;
    padding-right: 3rem !important;
  }
  
  main {
    padding-top: 2rem;
    padding-bottom: 2.5rem;
  }
  
  .container.my-4,
  .container.my-5 {
    margin-top: 0rem !important;
    margin-bottom: 2.5rem !important;
  }
}

/* === CARDS === */
.card {
  border: none !important;
  border-radius: 0.5rem !important;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
  margin-bottom: 1.5rem;
}

.login-card {
  background: #fff !important;
  backdrop-filter: blur(10px);
}

.main-card {
  background: #fff !important;
}

/* === FORMS === */
.form-control {
  border: 2px solid #ddd !important;
  border-radius: 0.375rem !important;
  transition: all 0.2s ease-in-out;
  font-size: 1rem;
}

.form-control:focus {
  border-color: #0d6efd !important;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1) !important;
}

.form-label {
  color: #666;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* === LOGO Y BRANDING === */
.logo-text {
  background: var(--bs-primary);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}

/* === BADGES === */
.status-badge {
  background: var(--bs-primary) !important;
  color: #fff !important;
  font-weight: 600;
}

/* === ALERTS === */
.alert-danger {
  background-color: rgba(239, 68, 68, 0.1) !important;
  border-color: #dc3545 !important;
  color: #dc3545 !important;
  border-radius: 0.375rem !important;
}

.dropdown-menu {
  border: none !important;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1) !important;
  border-radius: 0.375rem !important;
  backdrop-filter: blur(10px);
  z-index: 9999 !important;
  position: absolute !important;
}

.dropdown-item {
  transition: all 0.2s ease-in-out;
  color: #666 !important;
}

.dropdown-item:hover {
  background-color: var(--bs-primary) !important;
  color: #fff !important;
}

.dropdown-item.active {
  background-color: var(--bs-primary) !important;
  color: #fff !important;
}

.dropdown {
  position: relative !important;
  z-index: 1040 !important;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-card{
  animation: fadeInUp 0.6s ease-out;
}

/* === CLASES PERSONALIZADAS === */
.logo-text {
  background: var(--bs-primary);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}

.navbar-custom {
  background: var(--bs-primary) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 1.2rem;
  position: relative !important;
  z-index: 1030 !important;
}

.status-badge {
  background: var(--bs-primary) !important;
  color: #fff !important;
  font-weight: 600;
}

.btn-gradient {
  background: var(--bs-primary);
  border: none;
}

/* === NAVBAR CENTERING === */
.navbar-nav.me-auto {
  margin: 0 auto !important;
}

/* === SCROLLBAR PERSONALIZADO === */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f7f7f7;
}

::-webkit-scrollbar-thumb {
  background: var(--bs-primary);
  border-radius: 0.25rem;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--bs-primary);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .login-card {
    margin: 1rem;
  }
  
  .display-3 {
    font-size: 2.5rem !important;
  }
  
  .display-4 {
    font-size: 2rem !important;
  }
}

/* === UTILITIES === */
.text-muted {
  color: #999 !important;
}

.border-top {
  border-color: #ddd !important;
}

/* === SORTABLE HEADERS === */
.sortable-header {
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  user-select: none;
}

.sortable-header:hover {
  color: var(--bs-primary) !important;
}

.sortable-header:hover i {
  opacity: 1 !important;
}

th a {
  display: block;
  width: 100%;
  height: 100%;
}

th a:hover {
  background-color: rgba(13, 110, 253, 0.05);
}

/* === TABLE ENHANCEMENTS === */
.table thead th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  vertical-align: middle;
  position: relative;
}

.table tbody tr {
  transition: all 0.2s ease-in-out;
}

.table tbody tr:hover {
  background-color: rgba(13, 110, 253, 0.03) !important;
}

/* Efecto hover solo en desktop (evita problemas en móvil) */
@media (min-width: 992px) {
  .table tbody tr:hover {
    transform: scale(1.002);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  }
}

/* === TABLAS RESPONSIVE === */
/* En DESKTOP: sin scroll horizontal (tabla se ajusta) */
@media (min-width: 992px) {
  .table-responsive {
    overflow-x: visible !important;
  }
}

/* En MÓVIL: scroll horizontal habilitado */
@media (max-width: 991px) {
  .table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch; /* Smooth scroll en iOS */
    margin-bottom: 1rem;
  }
  
  /* Indicador visual de scroll */
  .table-responsive::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(to left, rgba(255,255,255,0.9), transparent);
    pointer-events: none;
  }
  
  /* Tabla tiene ancho mínimo en móvil */
  .table-responsive table {
    min-width: 800px; /* Ajustar según necesidad */
  }
  
  /* Reducir padding de celdas en móvil */
  .table-responsive .table td,
  .table-responsive .table th {
    padding: 0.5rem !important;
    font-size: 0.875rem;
    white-space: nowrap;
  }
}

/* === FILTER CARD === */
.card-header {
  background-color: #f8f9fa !important;
  border-bottom: 2px solid #e9ecef !important;
}

/* === BADGES IN TABLES === */
.table .badge {
  font-size: 0.75rem;
  padding: 0.35em 0.65em;
  font-weight: 600;
}
