/* Version: 5.2.7 */
/* ============================================
   TUNEL-DE-VIENTO.CSS
   Estilos propios de la página Túnel de Viento
   (Base en basestyles.css)
   ============================================ */

/* Botones del header (REGISTRO / MI CUENTA) */
.btn-registro {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.75rem;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(123, 97, 255, 0.08));
  border: 1px solid rgba(0, 212, 255, 0.4);
  border-radius: 12px;
  color: #00d4ff;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.15);
}

.btn-registro:hover {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.25), rgba(123, 97, 255, 0.15));
  border-color: rgba(0, 212, 255, 0.6);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 212, 255, 0.35), 0 0 30px rgba(0, 212, 255, 0.2);
}

.btn-registro:active {
  transform: translateY(0);
}

.btn-mi-cuenta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.75rem;
  background: linear-gradient(135deg, #ff3b3b 0%, #cc1a1a 100%);
  border: none;
  border-radius: 12px;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-mi-cuenta:hover {
  background: linear-gradient(135deg, #ff4d4d 0%, #e62222 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 59, 59, 0.4);
}

.btn-mi-cuenta svg {
  width: 18px;
  height: 18px;
}

/* Sección principal */
.content-section.tunel-section {
  padding: 2rem 0 3rem;
  min-height: 80vh;
  position: relative;
  z-index: 1;
  background: transparent;
}

/* Barra presupuesto y precio por análisis */
.tunnel-budget-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.08), rgba(123, 97, 255, 0.05));
  border: 1px solid rgba(0, 212, 255, 0.25);
  border-radius: 12px;
  backdrop-filter: blur(8px);
}
.tunnel-budget-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.tunnel-budget-item.tunnel-budget-price {
  margin-left: auto;
}
.tunnel-budget-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.6);
}
.tunnel-budget-value {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: #00d4ff;
}
.tunnel-budget-item.tunnel-budget-price .tunnel-budget-value {
  color: #00ff88;
}

/* Cabecera de página */
.page-header {
  text-align: center;
  margin-bottom: 3rem;
}

.page-icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(123, 97, 255, 0.1));
  border: 2px solid rgba(0, 212, 255, 0.3);
  border-radius: 50%;
  margin-bottom: var(--space-lg);
  animation: tunelPulse 2s ease-in-out infinite;
}

@keyframes tunelPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.3); }
  50% { box-shadow: 0 0 40px rgba(0, 212, 255, 0.6); }
}

.page-icon-wrapper svg {
  color: var(--color-primary);
  filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.8));
}

.page-title {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--color-text);
  margin-bottom: var(--space-md);
  text-align: center;
  text-transform: uppercase;
}

.page-title span { display: block; }

.page-title .highlight {
  background: linear-gradient(135deg, var(--color-primary), #7b61ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.5));
}

.page-subtitle {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  margin-bottom: 0;
  text-align: center;
  letter-spacing: 0.05em;
}

/* Botón volver */
.btn-back-fabrica {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  margin-bottom: 2rem;
}

.btn-back-fabrica:hover {
  background: rgba(0, 212, 255, 0.1);
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateX(-4px);
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.2);
}

.btn-back-fabrica svg { transition: transform 0.3s ease; }
.btn-back-fabrica:hover svg { transform: translateX(-3px); }

/* Sección de piezas */
.pieces-section { margin-bottom: 3rem; }

.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 1rem;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.section-icon {
  width: 64px;
  height: 64px;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-icon.completed {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.2));
  border: 2px solid rgba(16, 185, 129, 0.4);
  color: #10b981;
}

.section-title {
  flex: 1;
  font-size: 1.75rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
}

.section-description {
  display: block;
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 0.25rem;
}

.pieces-count {
  font-size: 2rem;
  font-weight: 800;
  color: #3b82f6;
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
  min-width: 3rem;
  text-align: right;
}

.pieces-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* Tarjetas de pieza */
.piece-card {
  background: rgba(0, 0, 0, 0.5);
  border-radius: 1rem;
  padding: 1.5rem;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
}

.piece-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6);
  border-color: rgba(59, 130, 246, 0.4);
}

.piece-card.clickable { cursor: pointer; }

.piece-card-completed {
  position: relative;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.05));
  border: 2px solid rgba(16, 185, 129, 0.3);
}

.piece-card-completed:hover {
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 15px 50px rgba(16, 185, 129, 0.3);
}

.completed-piece-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1rem;
}

.completed-piece-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(16, 185, 129, 0.2);
}

.completed-piece-icon {
  font-size: 3.5rem;
  filter: drop-shadow(0 0 15px rgba(16, 185, 129, 0.4));
}

.completed-piece-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #10b981;
  text-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
  text-align: center;
  margin: 0;
}

.completed-stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.completed-stat-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 0.75rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.3s ease;
}

.completed-stat-box:hover {
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(16, 185, 129, 0.4);
  transform: translateY(-2px);
}

.completed-stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: center;
}

.completed-stat-value {
  font-size: 2rem;
  font-weight: 900;
  text-align: center;
  letter-spacing: 0.02em;
}

.completed-stat-value.performance {
  color: #10b981;
  text-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
}

.completed-stat-value.failure {
  color: #3b82f6;
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.6);
}

.completed-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.2));
  border: 2px solid rgba(16, 185, 129, 0.5);
  border-radius: 0.75rem;
  font-size: 1rem;
  color: #10b981;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.completed-badge svg {
  flex-shrink: 0;
  filter: drop-shadow(0 0 5px rgba(16, 185, 129, 0.6));
}

/* Estado vacío */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1rem;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0.5rem;
}

.empty-state-text {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
}

/* Notificaciones */
.notification {
  position: fixed;
  top: 5rem;
  right: 1rem;
  z-index: 10000;
  min-width: 300px;
  max-width: 400px;
  background: rgba(0, 0, 0, 0.95);
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: tunelSlideIn 0.3s ease;
}

@keyframes tunelSlideIn {
  from { transform: translateX(400px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.notification-content { display: flex; align-items: center; gap: 1rem; }
.notification-message { flex: 1; color: #ffffff; font-size: 0.875rem; }
.notification-close {
  background: none; border: none; color: #ffffff; font-size: 1.5rem;
  cursor: pointer; padding: 0; width: 2rem; height: 2rem;
  display: flex; align-items: center; justify-content: center; border-radius: 0.25rem;
  transition: background 0.2s;
}
.notification-close:hover { background: rgba(255, 255, 255, 0.1); }
.notification.success { border-left: 4px solid #3b82f6; }
.notification.error { border-left: 4px solid #ef4444; }

/* Modales */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: tunelFadeIn 0.3s ease;
}

@keyframes tunelFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(15, 23, 42, 0.85) 100%);
  backdrop-filter: blur(24px) saturate(180%);
  border-radius: 1.5rem;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border: 2px solid transparent;
  background-clip: padding-box;
  position: relative;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(59, 130, 246, 0.3) inset, 0 0 80px rgba(59, 130, 246, 0.15);
  animation: tunelScaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem;
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
  background: linear-gradient(to bottom, rgba(59, 130, 246, 0.08), transparent);
}

.modal-header h3 {
  font-size: 1.75rem;
  font-weight: 800;
  color: #60a5fa;
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.7);
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.modal-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.75rem;
  cursor: pointer;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
  transform: rotate(90deg) scale(1.05);
}

.modal-body { padding: 2rem; }

.modal-description {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1.5rem;
  line-height: 1.6;
  font-size: 0.9375rem;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  padding: 2rem;
  border-top: 1px solid rgba(59, 130, 246, 0.2);
  justify-content: flex-end;
  background: linear-gradient(to top, rgba(59, 130, 246, 0.05), transparent);
}

.modal-actions .btn-primary,
.modal-actions .btn-secondary {
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 0.75rem;
}

.modal-actions .btn-primary:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Info de pieza en modal */
.tunnel-test-info { margin-bottom: 1.5rem; }

.piece-info-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.piece-info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.info-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.info-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #60a5fa;
  text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}
