/* =========================================
   EL SHAH • Estilos principales (v5.1)
   ========================================= */

/* 🔴 Botones personalizados */
.btn-shah {
  background-color: #d40000;
  color: #fff;
  border: none;
}
.btn-shah:hover {
  background-color: #b30000;
  color: #fff;
}

/* 🔴 Links activos en sidebar */
.sb-sidenav .nav-link.active {
  background-color: #d40000 !important;
  color: #fff !important;
}

/* 🔴 Encabezados y acentos */
h1, h2, h3, .fw-bold {
  color: #d40000;
}

/* =========================================
   NAVBAR SUPERIOR
   ========================================= */
.navbar-dark {
  background-color: #d40000 !important;
}

/* Barra superior compacta */
.sb-topnav.navbar.navbar-dark {
  position: relative !important;
  padding-top: 0.25rem !important;
  padding-bottom: 0.25rem !important;
  min-height: 42px !important;
  line-height: 1.1 !important;
}

/* Quitar espacio extra del body cuando se usa sb-nav-fixed */
body.sb-nav-fixed {
  padding-top: 0 !important;
}

/* Centrado del texto en el navbar */
.sb-topnav .navbar-brand,
.sb-topnav .navbar-nav .nav-link {
  display: flex;
  align-items: center;
  height: 100%;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* =========================================
   SIDEBAR
   ========================================= */
.sb-sidenav {
  background-color: #1d1f21 !important;
}
.sb-sidenav .nav-link {
  color: #ccc;
  font-size: 0.95rem;
}
.sb-sidenav .nav-link:hover {
  color: #fff;
}
.sb-sidenav-menu-heading {
  color: #999;
  font-size: 0.75rem;
  text-transform: uppercase;
  margin-top: 1rem;
}
.sb-sidenav-footer {
  background-color: #17191b;
  color: #aaa;
}

/* =========================================
   NAVBAR INFERIOR (BottomNav)
   ========================================= */
.navbar.fixed-bottom {
  background-color: #fff !important;
  border-top: 2px solid #d40000;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  height: 56px;
}

.navbar.fixed-bottom .nav-link {
  color: #555;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.25rem 0.5rem;
  transition: all 0.2s ease-in-out;
}

.navbar.fixed-bottom .nav-link.active {
  color: #d40000 !important;
  font-weight: 600;
}

.navbar.fixed-bottom .nav-link:hover {
  color: #b30000;
}

.navbar.fixed-bottom i {
  display: block;
}

/* =========================================
   AJUSTES DE ESPACIADO Y RESPONSIVE
   ========================================= */

/* Compactar el espacio entre header y contenido en escritorio */
@media (min-width: 992px) {
  main.container-fluid {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
  }

  h2, h3 {
    margin-top: 0.5rem !important;
    margin-bottom: 1rem !important;
  }
}

/* Ajustes para móviles */
@media (max-width: 991px) {
  .sb-topnav.navbar.navbar-dark {
    padding-top: 0.2rem !important;
    padding-bottom: 0.2rem !important;
    min-height: 40px !important;
  }

  .navbar.fixed-bottom {
    height: 54px;
  }
}

@media (min-width: 992px) {
  body.sb-nav-fixed main.container-fluid {
    margin-left: 200px; /* ancho del sidebar */
    padding-right: 12rem;
    transition: margin-left 0.3s ease, padding-right 0.3s ease;
  }

  /* Cuando el sidebar está colapsado */
  body.sb-nav-fixed.sb-sidenav-toggled main.container-fluid {
    margin-left: 0;
  }
}

.navbar-dark .navbar-brand {
  color: #fff !important;
  font-weight: 600;
}
.navbar-dark .navbar-brand:hover {
  color: #f5f5f5 !important;
}

/* =========================================
   🔻 Bottom Navigation Bar - Ajuste + Animación
   ========================================= */

#bottomNav .navbar {
  background-color: #fff !important;
  border-top: 2px solid #d40000;
  height: 56px;
  padding: 0.25rem 0;
}

#bottomNav .navbar-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 0;
}

#bottomNav .nav-item {
  flex: 1;
  text-align: center;
}

#bottomNav .nav-link {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  color: #555 !important;
  font-size: 0.8rem !important;
  line-height: 1.1 !important;
  transition: all 0.2s ease-in-out;
  position: relative;
}

#bottomNav .nav-link i {
  font-size: 1.2rem;
}

#bottomNav .nav-link span,
#bottomNav .nav-link small {
  display: block !important;
  font-size: 0.7rem !important;
  margin-top: 2px !important;
}

/* 🔴 Estado activo */
#bottomNav .nav-link.active {
  color: #d40000 !important;
  font-weight: 600;
}

/* ✨ Efecto de resalte animado */
#bottomNav .nav-link.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 24px;
  height: 3px;
  background: #d40000;
  border-radius: 2px;
  transform: translateX(-50%) scaleX(1);
  transition: transform 0.3s ease;
}

#bottomNav .nav-link:not(.active)::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 24px;
  height: 3px;
  background: transparent;
  transform: translateX(-50%) scaleX(0);
  transition: transform 0.3s ease;
}

#video {
  width: 100%;
  max-width: 380px;
  height: 280px;
  background-color: #000;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

#qr-reader {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 6px rgba(0, 0, 0, .2);
}

/* === Custom Toast Styles === */
#toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2000;
}

.custom-toast {
  display: flex;
  align-items: center;
  min-width: 280px;
  max-width: 360px;
  background: #fefefe;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  overflow: hidden;
  margin-bottom: 12px;
  border-left: 16px solid transparent;
  animation: slideIn 0.3s ease;
}

.custom-toast .toast-body {
  padding: 10px 15px;
  flex-grow: 1;
  color: #333;
}

.custom-toast .toast-title {
  font-weight: 600;
  margin-bottom: 3px;
}

.custom-toast .close-btn {
  border: none;
  background: none;
  color: #888;
  font-size: 18px;
  margin-right: 10px;
  cursor: pointer;
}

@keyframes slideIn {
  from {opacity: 0; transform: translateX(30px);}
  to {opacity: 1; transform: translateX(0);}
}

/* === Colores por tipo === */
.toast-error   { border-left-color: #e63946; }
.toast-info    { border-left-color: #1d72f3; }
.toast-success { border-left-color: #2a9d8f; }
.toast-warning { border-left-color: #f4a261; }

/* ===== 🎨 Chips de filtro (móvil) ===== */
.filtro-scroll::-webkit-scrollbar {
  height: 6px;
}
.filtro-scroll::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 10px;
}
.filtro-btn {
  transition: all 0.2s ease-in-out;
}
.filtro-btn.active {
  background-color: #d40000 !important; /* rojo corporativo */
  color: #fff !important;
  border-color: #d40000 !important;
  box-shadow: 0 0 6px rgba(212, 0, 0, 0.4);
}
