/* css/styles.css */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --danger-gradient: linear-gradient(135deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%);
  --dark-gradient: linear-gradient(135deg, #232526 0%, #414345 100%);
  --glass-bg: rgba(255, 255, 255, 0.9);
  --glass-border: 1px solid rgba(255, 255, 255, 0.5);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.1);
  --radius-lg: 20px;
}

body {
  font-family: 'Poppins', sans-serif;
  background: #f4f7f6;
  background-image: 
    radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%), 
    radial-gradient(at 50% 100%, hsla(225,39%,30%,1) 0, transparent 50%);
  background-attachment: fixed;
  color: #495057;
  min-height: 100vh;
}

/* --- Navbar --- */
.navbar {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(15px);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  padding: 1rem 0;
}

.navbar-brand {
  font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* --- Cards Modernas --- */
.card {
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.card h5 {
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  padding-bottom: 1rem;
}

/* --- Inputs Unificados --- */
.input-group {
  box-shadow: 0 4px 6px rgba(0,0,0,0.02);
  border-radius: 12px;
  transition: all 0.3s;
}

.input-group:focus-within {
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
  transform: translateY(-1px);
}

.input-group-text {
  background: white;
  border: 1px solid #e0e0e0;
  border-right: none;
  border-radius: 12px 0 0 12px;
  color: #8898aa;
}

.form-control, .form-select {
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  background-color: white;
  font-size: 0.95rem;
}

.input-group .form-control {
  border-left: none;
  border-radius: 0 12px 12px 0;
}
.input-group .form-control:focus {
  box-shadow: none;
  border-color: #e0e0e0;
}

textarea.form-control {
  border-radius: 12px !important;
}

/* --- Botones --- */
.btn {
  border-radius: 50px;
  padding: 0.7rem 1.8rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  border: none;
  transition: all 0.3s ease;
}

.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

#btnGuardar {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  width: 100%;
}
@media (min-width: 768px) { #btnGuardar { width: auto; } }

/* --- Tablas Estilizadas --- */
.table-responsive {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  background: white;
  border: var(--glass-border);
  overflow: hidden; 
}

.table thead {
  background: #f8f9fa;
}

.table thead th {
  padding: 1.2rem 1rem;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
  border: none;
  color: white; 
}

.table tbody tr {
  transition: background-color 0.2s;
}

.table tbody td {
  padding: 1.2rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid #f0f0f0;
  color: #525f7f;
}

.table-hover tbody tr:hover {
  background-color: rgba(0,0,0,0.02) !important;
}

/* --- Estilos Específicos por Página --- */

/* HOMBRES */
body.page-hombres {
  background-image: linear-gradient(to top, #cfd9df 0%, #e2ebf0 100%);
}
body.page-hombres .navbar {
  background: var(--dark-gradient);
}
body.page-hombres .table thead th {
  background: #2c3e50; 
  background: linear-gradient(135deg, #2c3e50 0%, #4ca1af 100%);
  color: white !important;
  border: none;
}
body.page-hombres #detNombre { color: #2c3e50; }


/* MUJERES */
body.page-mujeres {
  background-image: linear-gradient(120deg, #fdfbfb 0%, #ebedee 100%);
}
body.page-mujeres .navbar {
  background: linear-gradient(to right, #ed213a, #93291e);
}
body.page-mujeres .table thead th {
  background: #ff416c;
  background: linear-gradient(to right, #ff416c, #ff4b2b);
  color: white !important;
  border: none;
}
body.page-mujeres #detNombre { color: #d63384; }
body.page-mujeres #btnGuardar {
  background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
}

/* --- Modals y Auth --- */
.modal-content {
  border-radius: 20px;
  border: none;
  box-shadow: 0 15px 50px rgba(0,0,0,0.3);
}
.modal-header {
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.user-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 6px 16px;
  border-radius: 30px;
  font-size: 0.9rem;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255,255,255,0.3);
}

/* Comentarios y Estrellas */
.star-rating i { color: #e9ecef; transition: color 0.2s; }
.star-rating i.active { color: #ffd700; filter: drop-shadow(0 2px 4px rgba(255, 215, 0, 0.3)); }
.comment-box {
  background: #fff;
  border: 1px solid #eff2f7;
  box-shadow: 0 2px 5px rgba(0,0,0,0.02);
  border-radius: 12px;
}
.comment-box.admin-comment {
  border-left: 4px solid #dc3545; 
  background-color: #fff5f5;      
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 15px;
}
.badge-admin {
  background-color: #dc3545;
  color: white;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
  text-transform: uppercase;
}

/* --- NUEVO: Badge de Usuarios en Vivo (Estilo para Navbar) --- */
.live-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.15); /* Más claro para el navbar oscuro */
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  color: white;
  font-size: 0.8rem;
  font-weight: 500;
  margin-left: 10px;
  transition: all 0.3s ease;
}

.live-dot {
  width: 8px;
  height: 8px;
  background-color: #00e676; /* Verde neón */
  border-radius: 50%;
  margin-right: 8px;
  box-shadow: 0 0 10px rgba(0, 230, 118, 0.6);
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.7); }
  70% { box-shadow: 0 0 0 5px rgba(0, 230, 118, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 230, 118, 0); }
}

/* --- CORRECCIÓN DE ANCHO DE TABLA --- */

/* 1. Forzar que la tabla respete los anchos */
.table {
  table-layout: fixed; /* Importante: evita que el navegador "adivine" */
  width: 100%;
}

/* 2. Definir anchos específicos para cada columna */
/* Columna 1: Nombre (25%) */
.table th:nth-child(1), 
.table td:nth-child(1) {
  width: 25%;
  word-wrap: break-word;
}

/* Columna 2: Departamento (15%) */
.table th:nth-child(2), 
.table td:nth-child(2) {
  width: 15%;
}

/* Columna 3: Provincia (15% - Esto arregla tu problema) */
.table th:nth-child(3), 
.table td:nth-child(3) {
  width: 15%;
}

/* Columna 4: Motivo (45% - El resto del espacio) */
.table th:nth-child(4), 
.table td:nth-child(4) {
  width: 45%;
  /* Asegurar que el texto largo no rompa la tabla */
  white-space: nowrap;       /* Mantiene en una linea */
  overflow: hidden;          /* Oculta lo que sobra */
  text-overflow: ellipsis;   /* Pone tres puntos (...) */
  max-width: 0;              /* Truco para activar el ellipsis en tablas */
}