/* ============================================================================
   ESTILOS PARA LA PÁGINA DE GESTIÓN DE PRODUCTOS
   ============================================================================ */

/* ========== TEMA OSCURO ========== */
body.tema-oscuro {
  background-color: #1a1a1a;
  color: #e0e0e0;
}

body.tema-oscuro .card {
  background-color: #2d2d2d;
  color: #e0e0e0;
}

body.tema-oscuro .form-control,
body.tema-oscuro .form-select {
  background-color: #3a3a3a;
  color: #e0e0e0;
  border-color: #555;
}

body.tema-oscuro .form-control:focus,
body.tema-oscuro .form-select:focus {
  background-color: #454545;
  color: #e0e0e0;
  border-color: var(--rosa-claro);
}

body.tema-oscuro .titulo-rosa {
  color: #ff8fb3 !important;
}

body.tema-oscuro .text-muted {
  color: #b0b0b0 !important;
}

body.tema-oscuro .bg-light {
  background-color: #2d2d2d !important;
}

body.tema-oscuro .alert-success {
  background-color: #1e4620;
  border-color: #2d5f2f;
  color: #a0e0a0;
}

body.tema-oscuro .alert-danger {
  background-color: #4a1e1e;
  border-color: #6a2a2a;
  color: #e0a0a0;
}

body.tema-oscuro .alert-info {
  background-color: #1e3a4a;
  border-color: #2a4f6a;
  color: #a0d0e0;
}

body.tema-oscuro .alert-warning {
  background-color: #4a3a1e;
  border-color: #6a5a2a;
  color: #e0d0a0;
}

/* ========== HEADER PERSONALIZADO ========== */
.header {
  text-align: center;
  margin-bottom: 30px;
}

.bienvenida {
  font-size: 1.2rem;
  color: #666;
  margin-top: 10px;
}

body.tema-oscuro .bienvenida {
  color: #b0b0b0;
}

.controles-tema {
  margin-top: 15px;
}

.btn-tema {
  background: linear-gradient(135deg, var(--rosa-claro), var(--rosa-fuerte));
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-tema:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* ========== MENSAJES ========== */
.mensaje-container {
  margin-bottom: 20px;
  border-radius: 15px;
  font-weight: 500;
}

.mensaje-container.d-none {
  display: none !important;
}

/* ========== FORMULARIO ========== */
.form-label {
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.form-control,
.form-select {
  border-radius: 10px;
  padding: 10px 15px;
  border: 2px solid #e0e0e0;
  transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--rosa-claro);
  box-shadow: 0 0 0 0.2rem rgba(255, 95, 163, 0.25);
}

.form-control.is-invalid {
  border-color: #dc3545;
}

.invalid-feedback {
  display: block;
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 5px;
}

.contador-caracteres {
  font-size: 0.85rem;
  color: #6c757d;
  margin-top: 5px;
  display: block;
}

/* ========== TARJETAS DE PRODUCTOS ========== */
.tarjeta-producto {
  border-radius: 20px;
  transition: all 0.3s ease;
  cursor: pointer;
  border: 2px solid transparent;
}

.tarjeta-producto:hover {
  border-color: var(--rosa-claro);
  box-shadow: 0 10px 25px rgba(0,0,0,0.15) !important;
}

.tarjeta-producto img {
  height: 200px;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.tarjeta-producto:hover img {
  transform: scale(1.05);
}

.tarjeta-producto .card-footer {
  padding: 15px;
}

/* ========== FILTROS ========== */
.seccion-filtros .row {
  align-items: end;
}

.input-busqueda,
.select-filtro {
  border-radius: 10px;
  border: 2px solid #e0e0e0;
  padding: 10px 15px;
}

.input-busqueda:focus,
.select-filtro:focus {
  border-color: var(--rosa-claro);
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(255, 95, 163, 0.25);
}

/* ========== SPINNER ========== */
#loadingSpinner {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.spinner-border {
  width: 3rem;
  height: 3rem;
  border-width: 0.3rem;
}

/* ========== BADGES ========== */
.badge {
  padding: 8px 15px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
}

/* ========== BOTONES ========== */
.btn-sm {
  padding: 6px 12px;
  font-size: 0.875rem;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-sm:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* ========== ANIMACIONES ========== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tarjeta-producto {
  animation: fadeIn 0.5s ease;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .header h1 {
    font-size: 1.8rem;
  }
  
  .bienvenida {
    font-size: 1rem;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .form-actions button {
    width: 100%;
    margin-bottom: 10px;
  }
  
  .tarjeta-producto img {
    height: 150px;
  }
}

/* ========== TRANSICIONES SUAVES ========== */
* {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ========== SCROLL SUAVE ========== */
html {
  scroll-behavior: smooth;
}

/* ========== TOOLTIPS PERSONALIZADOS ========== */
[title] {
  position: relative;
  cursor: help;
}

/* ========== MEJORAS DE ACCESIBILIDAD ========== */
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--rosa-claro);
  outline-offset: 2px;
}

/* ========== SIN PRODUCTOS ========== */
#mensajeSinProductos {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#mensajeSinProductos i {
  font-size: 4rem;
  margin-bottom: 15px;
}