/* ==========================================================================
   HEALY BIO-RESONANCE & FREQUENCY APP - STYLESHEET
   ========================================================================== */

:root {
  --bg-dark: #090c15;
  --bg-card: rgba(18, 25, 43, 0.7);
  --bg-card-hover: rgba(28, 38, 65, 0.85);
  --primary-cyan: #00e5ff;
  --primary-pink: #d800ff;
  --primary-purple: #8a2be2;
  --accent-gold: #ffd700;
  --accent-green: #00ff7f;
  --text-main: #f0f4fd;
  --text-muted: #8c9ba5;
  --border-glass: rgba(0, 229, 255, 0.2);
  --radius-lg: 20px;
  --radius-md: 12px;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --shadow-neon: 0 0 25px rgba(0, 229, 255, 0.25);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(138, 43, 226, 0.18) 0%, transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(0, 229, 255, 0.15) 0%, transparent 45%);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: 40px;
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* ==========================================================================
   HEADER & TOP STATUS BAR
   ========================================================================== */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 10px var(--primary-cyan));
}

.logo-area h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 0%, var(--primary-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.device-status-badge {
  background: rgba(0, 255, 127, 0.1);
  border: 1px solid rgba(0, 255, 127, 0.4);
  color: var(--accent-green);
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.header-user-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pwa-install-btn {
  background: linear-gradient(135deg, var(--accent-gold) 0%, #ff8c00 100%);
  color: #000;
  border: none;
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.pwa-install-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.5);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.85rem;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-cyan);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.logout-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  margin-left: 6px;
  transition: color 0.2s;
}

.logout-btn:hover {
  color: #ff4500;
}

/* Modal de Login Futurista */
.auth-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(9, 12, 21, 0.92);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--primary-cyan);
  border-radius: var(--radius-lg);
  padding: 36px 30px;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 0 40px rgba(0, 229, 255, 0.3);
  text-align: center;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-cyan);
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.auth-form-group {
  margin-bottom: 16px;
  text-align: left;
}

.auth-form-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.auth-input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.3s;
}

.auth-input:focus {
  border-color: var(--primary-cyan);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.demo-btn-row {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}


/* ==========================================================================
   NAVEGACIÓN POR PESTAÑAS
   ========================================================================== */
.nav-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.nav-tab {
  flex: 1;
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.nav-tab:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--border-glass);
}

.nav-tab.active {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.2) 0%, rgba(138, 43, 226, 0.25) 100%);
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
  box-shadow: var(--shadow-neon);
}

/* ==========================================================================
   SECCIONES Y PESTAÑAS DE CONTENIDO
   ========================================================================== */
.tab-content {
  display: none;
  animation: fadeIn 0.4s ease;
}

.tab-content.active {
  display: block;
}

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

/* ==========================================================================
   PESTAÑA ESCÁNER & ANÁLISIS BIOENERGÉTICO
   ========================================================================== */
.scanner-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .scanner-container {
    grid-template-columns: 1fr;
  }
}

.touch-sensor-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(16px);
}

.sensor-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--primary-cyan);
}

.sensor-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 30px;
  max-width: 320px;
}

/* Botón Táctil de Huella Cuántica */
.sensor-btn-wrapper {
  position: relative;
  width: 160px;
  height: 160px;
  margin-bottom: 24px;
}

.touch-sensor-btn {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.15) 0%, rgba(18, 25, 43, 0.9) 70%);
  border: 2px solid var(--primary-cyan);
  cursor: pointer;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  user-select: none;
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.2);
}

.touch-sensor-btn:hover {
  box-shadow: 0 0 35px rgba(0, 229, 255, 0.5);
  transform: scale(1.03);
}

.touch-sensor-btn.scanning {
  animation: pulseScan 1.2s infinite alternate;
  border-color: var(--primary-pink);
}

@keyframes pulseScan {
  0% { box-shadow: 0 0 20px var(--primary-cyan); }
  100% { box-shadow: 0 0 45px var(--primary-pink); }
}

.fingerprint-icon {
  font-size: 3.5rem;
  filter: drop-shadow(0 0 8px var(--primary-cyan));
}

.scan-ring-svg {
  position: absolute;
  top: -10px;
  left: -10px;
  width: 180px;
  height: 180px;
  pointer-events: none;
  transform: rotate(-90deg);
}

.scan-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 6;
}

.scan-ring-progress {
  fill: none;
  stroke: url(#cyanPinkGrad);
  stroke-width: 6;
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  transition: stroke-dashoffset 0.1s linear;
}

.scan-percent {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary-cyan);
  margin-bottom: 8px;
}

.scan-status-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Tarjeta de Resultados del Análisis */
.analysis-results-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(16px);
}

.hidden {
  display: none !important;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.results-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.metric-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 14px;
  border-radius: var(--radius-md);
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.metric-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary-cyan);
}

.weak-chakra-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid;
}

/* Lista de Chakras */
.chakras-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chakra-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(0,0,0,0.2);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.chakra-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.chakra-icon {
  font-size: 1.2rem;
}

.chakra-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.chakra-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chakra-bar-wrap {
  width: 100px;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.chakra-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.chakra-score {
  font-size: 0.85rem;
  font-weight: 700;
  min-width: 40px;
  text-align: right;
}

/* ==========================================================================
   REPRODUCTOR DE FRECUENCIAS AUDITIVAS
   ========================================================================== */
.player-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

@media (max-width: 850px) {
  .player-grid {
    grid-template-columns: 1fr;
  }
}

.main-player-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(16px);
}

.visualizer-wrapper {
  position: relative;
  width: 100%;
  height: 220px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(0, 229, 255, 0.3);
  margin-bottom: 20px;
}

#oscilloscopeCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.player-info {
  margin-bottom: 20px;
}

.program-cat-badge {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--primary-cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  margin-bottom: 4px;
}

.program-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-cyan) 0%, var(--primary-purple) 100%);
  color: #fff;
  border: none;
  padding: 14px 28px;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 229, 255, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 229, 255, 0.5);
}

.btn-primary.playing {
  background: linear-gradient(135deg, #ff4500 0%, #d800ff 100%);
  box-shadow: 0 4px 15px rgba(255, 69, 0, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--primary-cyan);
}

/* Panel de Síntesis de Frecuencias */
.synthesis-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(16px);
}

.controls-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

.control-group {
  margin-bottom: 18px;
}

.control-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.control-val {
  color: var(--primary-cyan);
  font-weight: 700;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--primary-cyan);
  cursor: pointer;
}

select {
  width: 100%;
  padding: 10px;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  border-radius: var(--radius-md);
  outline: none;
}

/* Checkbox Toggle Switch */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 15px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.2);
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider { background-color: var(--primary-cyan); }
input:checked + .slider:before { transform: translateX(20px); }

/* ==========================================================================
   CATÁLOGO DE PROGRAMAS
   ========================================================================== */
.catalog-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-chip.active, .filter-chip:hover {
  background: var(--primary-cyan);
  color: #000;
  font-weight: 700;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.program-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s ease;
}

.program-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary-cyan);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.recommended-border {
  border: 1px solid var(--accent-gold) !important;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.15);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.hz-tag {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--primary-cyan);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 14px;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.card-actions {
  display: flex;
  gap: 8px;
}

.card-actions button {
  flex: 1;
}

/* ==========================================================================
   SINCRONIZADOR HEALY (VINCULACIÓN & TRANSMISIÓN)
   ========================================================================== */
.sync-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 30px;
  backdrop-filter: blur(16px);
  max-width: 650px;
  margin: 0 auto;
  text-align: center;
}

.sync-device-visual {
  width: 120px;
  height: 120px;
  margin: 0 auto 20px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.2) 0%, rgba(216, 0, 255, 0.3) 100%);
  border: 2px solid var(--primary-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  box-shadow: var(--shadow-neon);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.hz-streaming-box {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--primary-cyan);
  padding: 16px;
  border-radius: var(--radius-md);
  margin: 20px 0;
}

.hz-active-val {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--primary-cyan);
  letter-spacing: 1px;
}

.sync-progress-bar {
  width: 100%;
  height: 10px;
  background: rgba(255,255,255,0.1);
  border-radius: 5px;
  overflow: hidden;
  margin: 12px 0 6px;
}

.sync-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-cyan), var(--primary-pink));
  width: 0%;
  transition: width 1s linear;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #12192b;
  border: 1px solid var(--primary-cyan);
  border-radius: var(--radius-lg);
  padding: 30px;
  width: 90%;
  max-width: 450px;
  box-shadow: var(--shadow-neon);
}
