/* Estilos personalizados para Face Recognition */

:root {
  --primary-color: #1a56db;
  --primary-dark: #1e40af;
  --primary-light: #93c5fd;
  --accent-color: #f59e0b;
  --accent-light: #fcd34d;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --dark-color: #111827;
  --light-color: #f9fafb;
  --gray-color: #6b7280;
  --gray-light: #e5e7eb;
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Estilos base */
body {
  font-family: var(--font-family);
  background-color: #f8fafc;
  color: var(--dark-color);
  line-height: 1.5;
}

.navbar-brand {
  font-weight: 700;
  letter-spacing: 0.5px;
}

.navbar-nav .nav-link {
  font-size: 0.92rem;
}

/* Tarjetas con sombras y efectos */
.custom-card {
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.custom-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Botones personalizados */
.btn-custom-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  font-weight: 500;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
}

.btn-custom-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-custom-secondary {
  background-color: white;
  border: 1px solid var(--gray-color);
  color: var(--dark-color);
  font-weight: 500;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
}

.btn-custom-secondary:hover {
  background-color: var(--gray-light);
  transform: translateY(-2px);
}

/* Navbar mejorado - más estrecho */
.navbar-custom {
  background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
  padding: 0.2rem 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 10000;
}

.navbar-custom .navbar-brand {
  font-weight: 700;
  color: white;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

.navbar-custom .nav-link {
  color: rgba(255,255,255,0.9) !important;
  padding: 0.15rem 0.5rem;
  margin: 0 0.1rem;
  border-radius: 4px;
  font-size: 0.90rem;
  transition: all 0.3s ease;
}

@media (min-width: 992px) {
  .navbar-custom .nav-link {
    font-size: 0.92rem;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
  }
}

/* Estilos para enlaces de navegación - simplificados y elegantes */
.navbar-custom .nav-link {
  position: relative;
  color: rgba(255, 255, 255, 0.85) !important;
  transition: all 0.25s ease;
  padding: 0.5rem 1rem;
  margin: 0.15rem 0;
  border-radius: 6px; /* Esquinas más redondeadas */
}

/* Efecto hover sutil */
.navbar-custom .nav-link:hover {
  color: white !important;
  background-color: rgba(35, 64, 110, 0.15);
}

/* Estilos para el dropdown */
.dropdown-menu.my-dropdown {
  z-index: 1060;
  min-width: 12rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  border: 1px solid rgba(0,0,0,0.1);
  position: absolute;
}

@media (max-width: 991.98px) {
  .dropdown-menu.my-dropdown {
    z-index: 1100;
  }
}

/* Ensure dropdowns in tables are visible above table-responsive containers */
.table-responsive .dropdown {
  position: static;
}

.table-responsive .dropdown-menu {
  position: fixed;
  z-index: 1060;
}

/* Estilos para TomSelect - asegurar que esté por encima de todo */
.ts-wrapper {
  z-index: 9999 !important;
}

.ts-dropdown {
  z-index: 9999 !important;
  position: absolute !important;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15) !important;
}

/* Estilos adicionales para forzar que el dropdown esté por encima */
body .ts-dropdown {
  z-index: 99999 !important;
}

.modal .ts-wrapper {
  z-index: auto !important;
}
.modal .ts-dropdown {
  z-index: 1070 !important; 
}

/* Eliminar cualquier overflow que pueda estar cortando el dropdown */
.ts-wrapper.single .ts-control::after {
  z-index: 9999 !important;
}

/* Estilo para el enlace activo - elegante y minimalista */
.navbar-custom .nav-link.active {
  color: white !important;
  background-color: rgba(26, 86, 219, 0.25); /* Azul más sutil, basado en --primary-color (#1a56db) */
  font-weight: 500;
  position: relative;
  border-radius: 6px; /* Esquinas más redondeadas */
}

/* Borde fino para el elemento activo */
.navbar-custom .nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background-color: rgba(255, 255, 255, 0.4);
}

/* Estilo consistente para móvil y desktop */
@media (max-width: 991.98px) {
  .navbar-custom .nav-link.active {
    background-color: #2c4a7c; /* Mismo color que en desktop */
  }
}

.navbar-custom .nav-item.dropdown .dropdown-menu {
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 0.5rem;
}

.navbar-custom .dropdown-item {
  padding: 0.25rem 0.75rem;
  font-size: 1rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.navbar-custom .dropdown-item:hover {
  background-color: var(--primary-light);
  color: var(--primary-dark);
}

/* Tablas mejoradas */
.table-custom {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.table-custom thead {
  background-color: var(--primary-color);
  color: white;
}

.table-custom th {
  font-weight: 600;
  padding: 1rem;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.table-custom td {
  padding: 1rem;
  vertical-align: middle;
}

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

.table-custom tbody tr:hover {
  background-color: rgba(147, 197, 253, 0.1);
}

/* Tabla elegante pero compacta */
.table-elegant {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.table-elegant thead {
  background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
  color: white;
}

.table-elegant th {
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  border-bottom: none;
}

.table,
.table th,
.table td,
.table-elegant,
.table-elegant th,
.table-elegant td {
  padding-top: 0.23rem !important;
  padding-bottom: 0.23rem !important;
  padding-left: 0.55rem !important;
  padding-right: 0.55rem !important;
  font-size: 1.04rem;
  line-height: 1.25;
  vertical-align: middle;
}

.table th,
.table-elegant th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.83rem;
  letter-spacing: 0.03em;
  border-bottom-width: 1.5px;
  border-bottom-color: var(--gray-light);
}

.table td,
.table-elegant td {
  border-top-width: 1px;
  border-top-color: var(--gray-light);
}

.table tbody tr,
.table-elegant tbody tr {
  min-height: 26px;
  height: 30px;
  transition: background 0.2s;
}

.table tbody tr:hover,
.table-elegant tbody tr:hover {
  background-color: rgba(147, 197, 253, 0.07);
}

.table td img,
.table-elegant td img {
  max-height: 39px !important;
  max-width: 39px !important;
  margin: 1px !important;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* Botones de acción compactos en tablas */
.table .btn-action,
.table-elegant .btn-action,
.btn-table-action,
.btn.btn-sm.btn-primary {
  padding: 0.27rem 0.62rem !important;
  font-size: 1.01rem !important;
  line-height: 1.18 !important;
  min-height: 1.85rem !important;
  border-radius: 0.34rem !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.table th,
.table-elegant th {
  background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
  color: #fff;
  border-bottom: none;
}

.table-striped > tbody > tr:nth-of-type(odd) {
  background-color: #f6f8fa;
}


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

.table-elegant tbody tr:hover {
  background-color: rgba(147, 197, 253, 0.1);
}

/* Animaciones para badges y alertas */
.badge {
  transition: all 0.3s ease;
}

.badge:hover {
  transform: scale(1.1);
}

/* Footer personalizado */
.footer-custom {
  background-color: var(--dark-color);
  color: rgba(255,255,255,0.9);
  padding: 0.6rem 0 0.4rem 0;
  margin-top: 1.5rem;
  font-size: 0.98rem;
  border-top: 2px solid var(--primary-light);
  box-shadow: 0 -2px 12px 0 rgba(0,0,0,0.04);
}

.footer-custom a {
  color: var(--primary-light);
  transition: all 0.3s ease;
}

.footer-custom a:hover {
  color: white;
  text-decoration: none;
}

/* Paginación personalizada */
.pagination-custom .page-link {
  color: var(--primary-color);
  border: none;
  margin: 0 0.2rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.pagination-custom .page-item.active .page-link {
  background-color: var(--primary-color);
  color: white;
}

.pagination-custom .page-link:hover {
  background-color: var(--primary-light);
  color: var(--primary-dark);
  transform: translateY(-2px);
}

/* Cards personalizadas para cámaras */
.camera-card {
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.3s ease;
  border: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.camera-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.camera-card .card-header {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  font-weight: 600;
  border-bottom: none;
  padding: 1rem;
}

.camera-card .card-body {
  padding: 1.5rem;
}

/* Efectos para imágenes */
.img-hover-zoom {
  overflow: hidden;
  border-radius: 8px;
}

.img-hover-zoom img {
  transition: transform 0.5s ease;
}

.img-hover-zoom:hover img {
  transform: scale(1.1);
}

/* Alertas personalizadas */
.alert-custom {
  border: none;
  border-radius: 8px;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.alert-custom.alert-success {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
}

.alert-custom.alert-danger {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--danger-color);
}

.alert-custom.alert-warning {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--warning-color);
}

.alert-custom.alert-info {
  background-color: rgba(26, 86, 219, 0.1);
  color: var(--primary-color);
}

.alert-icon {
  margin-right: 1rem;
  font-size: 1.5rem;
}

/* Animaciones para entradas y salidas */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

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

/* Sistema de breadcrumbs minimalista */
.breadcrumb-minimal {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--dark-color);
  padding: 0.3rem 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.breadcrumb-minimal a {
  color: var(--primary-color);
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
  margin-right: 1.5rem;
}

.breadcrumb-minimal a:hover {
  color: var(--primary-dark);
}

.breadcrumb-minimal a:after {
  content: '/';
  position: absolute;
  right: -1rem;
  color: var(--gray-color);
  opacity: 0.7;
}

.breadcrumb-minimal .current {
  color: var(--gray-color);
  font-weight: 400;
}

/* Loader personalizado */
.loader {
  width: 30px;
  height: 30px;
  border: 3px solid var(--primary-light);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive table with horizontal scroll for mobile */
.table-responsive {
	overflow-x: auto;
	overflow-y: visible;
	-webkit-overflow-scrolling: touch;
	position: static;
}

/* Mobile-specific table scroll improvements */
@media (max-width: 991.98px) {
	.table-responsive {
		overflow-x: auto !important;
		-webkit-overflow-scrolling: touch;
		margin-bottom: 1rem;
	}
	
	.table-responsive::-webkit-scrollbar {
		height: 8px;
	}
	
	.table-responsive::-webkit-scrollbar-track {
		background: #f1f1f1;
		border-radius: 4px;
	}
	
	.table-responsive::-webkit-scrollbar-thumb {
		background: var(--primary-color);
		border-radius: 4px;
	}
	
	.table-responsive::-webkit-scrollbar-thumb:hover {
		background: var(--primary-dark);
	}
	
	.table-responsive table {
		min-width: 800px;
	}
}
