/* Gradientes personalizados */
.bg-gradient {
  background: linear-gradient(135deg, #dbeafe 0%, #ffffff 50%, #ecfdf5 100%);
  min-height: 100vh;
}

.bg-primary-gradient {
  background: linear-gradient(135deg, #3b82f6 0%, #10b981 100%) !important;
}

/* Efectos de hover */
.project-item {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.project-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
  border-color: #10b981 !important;
}

/* Truncar texto */
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2; /* ✅ Propiedad estándar para compatibilidad */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Colores personalizados */
.text-primary {
  color: #3b82f6 !important;
}

.text-success {
  color: #10b981 !important;
}

.bg-primary {
  background-color: #3b82f6 !important;
}

.bg-success {
  background-color: #10b981 !important;
}

.border-primary {
  border-color: #3b82f6 !important;
}

.border-success {
  border-color: #10b981 !important;
}

.btn-primary {
  background-color: #3b82f6;
  border-color: #3b82f6;
}

.btn-primary:hover {
  background-color: #2563eb;
  border-color: #2563eb;
}

.btn-success {
  background-color: #10b981;
  border-color: #10b981;
}

.btn-success:hover {
  background-color: #059669;
  border-color: #059669;
}

/* Estilos para los sliders */
.form-range::-webkit-slider-thumb {
  background: #3b82f6;
}

.form-range::-moz-range-thumb {
  background: #3b82f6;
  border: none;
}

/* Animaciones suaves */
.transition-all {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Estilos para favoritos */
.favorite-btn {
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.favorite-btn:hover {
  background-color: rgba(255, 255, 255, 0.2) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
}

/* Responsive */
@media (max-width: 768px) {
  .display-4 {
    font-size: 2rem;
  }

  .project-item:hover {
    transform: none;
  }
}

/* Estilos para las cards */
.card {
  border-width: 2px;
}

.card-header.bg-primary-gradient {
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
  width: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: #3b82f6;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #2563eb;
}

/* Slider de doble rango optimizado */
.range-slider {
  position: relative;
  margin: 15px 0;
  height: 40px;
  /* ✅ Optimización de rendering */
  will-change: transform;
  transform: translateZ(0); /* Forzar aceleración por hardware */
}

/* Track base */
.range-slider::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  transform: translateY(-50%);
  z-index: 1;
}

/* Track activo (entre los valores) - optimizado */
.range-slider::before {
  content: '';
  position: absolute;
  top: 50%;
  height: 6px;
  background: linear-gradient(135deg, #3b82f6 0%, #10b981 100%);
  border-radius: 3px;
  transform: translateY(-50%);
  z-index: 2;
  left: 0%;
  width: 100%;
  /* ✅ Optimización de transiciones */
  transition: left 0.1s ease-out, width 0.1s ease-out;
  will-change: left, width;
}

.range-slider input[type="range"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  pointer-events: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  /* ✅ Optimización de performance */
  transform: translateZ(0);
  will-change: transform;
}

/* Webkit (Chrome, Safari) - optimizado */
.range-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  pointer-events: all;
  border: 3px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 3;
  /* ✅ Optimización de interacciones */
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, box-shadow;
}

.range-slider input[type="range"]::-webkit-slider-track {
  width: 100%;
  height: 20px;
  background: transparent;
  border-radius: 0;
  border: none;
}

/* Firefox - optimizado */
.range-slider input[type="range"]::-moz-range-thumb {
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  pointer-events: all;
  border: 3px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 3;
  /* ✅ Optimización de interacciones para Firefox */
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.range-slider input[type="range"]::-moz-range-track {
  width: 100%;
  height: 20px;
  background: transparent;
  border-radius: 0;
  border: none;
}

.range-slider input[type="range"]::-moz-focus-outer {
  border: 0;
}

/* Z-index optimizado para evitar conflictos */
.range-slider .range-start {
  z-index: 4;
}

.range-slider .range-end {
  z-index: 4; /* ✅ Mismo z-index para evitar problemas de orden */
}

/* Valores debajo del slider */
.range-values {
  text-align: center;
  margin-top: 10px;
  font-size: 0.875rem;
  color: #6b7280;
  font-weight: 500;
}

.range-values .value-start,
.range-values .value-end {
  color: #3b82f6;
  font-weight: 600;
}

/* Efectos hover optimizados */
.range-slider input[type="range"]::-webkit-slider-thumb:hover {
  background: #2563eb;
  transform: scale(1.05); /* ✅ Reducido para mejor performance */
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.range-slider input[type="range"]::-moz-range-thumb:hover {
  background: #2563eb;
  transform: scale(1.05); /* ✅ Reducido para mejor performance */
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* ✅ Estados activos para mejor feedback visual */
.range-slider input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(0.95);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
}

.range-slider input[type="range"]:active::-moz-range-thumb {
  transform: scale(0.95);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
}

/* Material Multi-Select Styles */
.material-filter-container {
  position: relative;
}

.material-filter-container .dropdown-menu {
  max-height: 400px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 2px solid #3b82f6;
}

.material-filter-container .form-check {
  margin-bottom: 0.5rem;
}

.material-filter-container .form-check-label {
  font-size: 0.9rem;
  cursor: pointer;
  padding-left: 0.25rem;
}

.material-filter-container .form-check-input:checked {
  background-color: #3b82f6;
  border-color: #3b82f6;
}

/* Chips de materiales seleccionados */
.selected-materials-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  min-height: 1.5rem;
}

.material-chip {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #3b82f6 0%, #10b981 100%);
  color: white;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  border: none;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
  transition: all 0.2s ease;
  max-width: 120px;
}

.material-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.material-chip .chip-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-chip .chip-remove {
  margin-left: 0.25rem;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  width: 1rem;
  height: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: white;
  cursor: pointer;
  transition: background-color 0.2s;
}

.material-chip .chip-remove:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Búsqueda dentro del dropdown */
.material-filter-container #materialSearch {
  border: 1px solid #3b82f6;
  border-radius: 6px;
}

.material-filter-container #materialSearch:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 0.2rem rgba(16, 185, 129, 0.25);
}

/* Botón dropdown personalizado */
.material-filter-container .dropdown-toggle {
  border: 2px solid #3b82f6;
  transition: all 0.3s ease;
}

.material-filter-container .dropdown-toggle:hover {
  border-color: #10b981;
  background-color: rgba(16, 185, 129, 0.1);
}

.material-filter-container .dropdown-toggle:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 0.2rem rgba(16, 185, 129, 0.25);
}

/* Scroll personalizado para el dropdown */
.material-filter-container .dropdown-menu::-webkit-scrollbar {
  width: 6px;
}

.material-filter-container .dropdown-menu::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

.material-filter-container .dropdown-menu::-webkit-scrollbar-thumb {
  background: #3b82f6;
  border-radius: 3px;
}

/* Animaciones para los chips */
@keyframes chipAppear {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.material-chip {
  animation: chipAppear 0.3s ease-out;
}

/* Estados hover para checkboxes */
.material-filter-container .form-check:hover {
  background-color: rgba(59, 130, 246, 0.05);
  border-radius: 4px;
  padding: 0.25rem;
  margin: 0.125rem 0;
}

/* Responsive */
@media (max-width: 768px) {
  .material-filter-container .dropdown-menu {
    min-width: 100% !important;
    max-width: 100%;
  }
  
  .selected-materials-chips {
    max-height: 60px;
    overflow-y: auto;
  }
  
  .material-chip {
    max-width: 100px;
    font-size: 0.7rem;
  }
}

/* ===== ESTILOS PARA PANTALLA DE LOGIN ===== */
.login-container {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.login-card {
  max-width: 450px;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border-radius: 0.75rem;
  overflow: hidden;
}

.login-header {
  background: linear-gradient(135deg, #3b82f6 0%, #10b981 100%);
  color: white;
  padding: 2rem;
  text-align: center;
}

.login-body {
  padding: 2.5rem;
}

.btn-microsoft {
  background: linear-gradient(135deg, #0078d7 0%, #106ebe 100%);
  border: none;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  transition: all 0.3s ease;
  width: 100%;
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  font-size: 1rem;
}

.btn-microsoft:hover {
  background: linear-gradient(135deg, #106ebe 0%, #0e5a9e 100%);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(16, 110, 190, 0.3);
  color: white;
  text-decoration: none;
}

.btn-microsoft:focus {
  box-shadow: 0 0 0 3px rgba(16, 110, 190, 0.3);
  color: white;
  text-decoration: none;
  outline: none;
}

.microsoft-icon {
  width: 20px;
  height: 20px;
  margin-right: 10px;
  vertical-align: middle;
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.5rem 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

.divider span {
  padding: 0 1rem;
  color: #6b7280;
  font-size: 0.875rem;
}

.form-control:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

.features-grid {
  margin-top: 3rem;
}

.feature-item {
  text-align: center;
  padding: 1.5rem;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
  height: 100%;
}

.feature-item:hover {
  transform: translateY(-2px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #3b82f6 0%, #10b981 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: white;
  font-size: 1.25rem;
}

/* Animaciones para la pantalla de login */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Responsive para login */
@media (max-width: 576px) {
  .login-container {
    padding: 1rem;
  }
  
  .login-header {
    padding: 1.5rem;
  }
  
  .login-body {
    padding: 1.5rem;
  }
  
  .features-grid {
    margin-top: 2rem;
  }
  
  .feature-item {
    padding: 1rem;
  }
}

/* Estilos para dropdown de usuario */
.dropdown-menu {
  border: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border-radius: 0.5rem;
  overflow: hidden;
}

.dropdown-header {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  font-weight: 600;
  color: #374151;
}

.dropdown-item:hover {
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
}

.dropdown-item.text-danger:hover {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

/* ===============================
   ESTILOS PARA materiales DESTACADOS
   =============================== */

/* Animación de entrada para materiales */
.equipment-item {
  transition: all 0.3s ease;
  animation: fadeInEquipment 0.4s ease-out;
}

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

/* materiales destacados */
.equipment-highlighted {
  animation: highlightPulse 2s ease-in-out infinite;
}

.equipment-highlighted .border {
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.equipment-highlighted:hover {
  transform: translateY(-2px);
}

@keyframes highlightPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

/* Icono de corona para materiales destacados */
.fa-crown {
  animation: crownShine 3s ease-in-out infinite;
}

@keyframes crownShine {
  0%, 100% {
    filter: drop-shadow(0 0 2px rgba(251, 191, 36, 0.5));
  }
  50% {
    filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.8));
  }
}

/* Badge de material destacado */
.equipment-item .badge {
  transition: all 0.3s ease;
}

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

/* Mejora visual para el fondo amarillo suave */
.bg-warning.bg-opacity-25 {
  background-color: rgba(251, 191, 36, 0.15) !important;
}

/* Efecto hover en botones de materiales */
.equipment-item .remove-equipment-btn {
  transition: all 0.2s ease;
  opacity: 0.7;
}

.equipment-item:hover .remove-equipment-btn {
  opacity: 1;
}

/* Responsive para materiales en móviles */
@media (max-width: 768px) {
  .equipment-item {
    margin-bottom: 0.5rem !important;
  }
  
  .equipment-text {
    font-size: 0.9rem;
  }
  
  .equipment-item .badge {
    font-size: 0.7rem;
  }
}

