/* ==========================================================================
   HADALYX — Shared Visual CSS System
   Theme: Hadal-Zone Research, Bathymetric Mapping, Bioluminescent Signals
   ========================================================================== */

:root {
  --bathy-abyss: #020617;     /* Dark Slate Navy canvas */
  --bathy-trench: #070d1e;    /* Deep Hadal Trench layer */
  --bathy-panel: #0b1329;     /* Deep slate blue panel base */
  --bathy-border: #1e293b;    /* Clean technical border */
  --biolum-cyan: #22d3ee;     /* Active Cyan Signal */
  --biolum-teal: #2dd4bf;     /* Teal state display */
  --biolum-violet: #8b5cf6;   /* Muted Violet state display */
  --bathy-mist: #94a3b8;      /* Primary readable copy text */
  --bathy-muted: #64748b;     /* Telemetry labels and metadata */
}

body {
  background: var(--bathy-abyss);
  color: #f1f5f9;
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
  line-height: 1.6;
}

h1, h2, h3, h4, .font-display {
  font-family: 'Rajdhani', sans-serif;
  letter-spacing: 0.01em;
}

/* ============ FOCUS STATES ============ */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [role="radio"]:focus-visible {
  outline: 2px solid var(--biolum-cyan) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.25) !important;
}

/* ============ BATHYMETRIC CONTOUR BACKGROUND ============ */
.bathy-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: 
    linear-gradient(rgba(34, 211, 238, 0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.012) 1px, transparent 1px);
  background-size: 60px 60px;
  background-position: center top;
  mask-image: radial-gradient(circle at center, black 35%, transparent 90%);
}

/* Concentric Depth Contour Lines */
.bathy-contour-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 700px;
  height: 700px;
  pointer-events: none;
}
.bathy-contour-line {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(34, 211, 238, 0.05);
  border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%; /* irregular contour rings */
  animation: float-contour 20s linear infinite;
  opacity: 0.4;
}
.bathy-contour-line:nth-child(1) { width: 250px; height: 230px; animation-duration: 25s; }
.bathy-contour-line:nth-child(2) { width: 450px; height: 430px; animation-duration: 35s; animation-delay: -5s; }
.bathy-contour-line:nth-child(3) { width: 650px; height: 610px; animation-duration: 45s; animation-delay: -10s; }

@keyframes float-contour {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Depth radar sweeps */
.bathy-sonar-sweep {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 350px;
  height: 350px;
  transform-origin: top left;
  background: linear-gradient(45deg, rgba(34, 211, 238, 0.05) 0%, transparent 60%);
  border-left: 1.2px dashed rgba(34, 211, 238, 0.25);
  animation: sonar-rotate-slow 22s linear infinite;
}

@keyframes sonar-rotate-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ============ REFINED DARK GLASS PANELING ============ */
.hadal-panel {
  background: rgba(11, 19, 41, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-top: 1.5px solid rgba(34, 211, 238, 0.2);
  box-shadow: 0 12px 32px rgba(2, 6, 23, 0.8);
  transition: all 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
}

.hadal-panel-hover:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 211, 238, 0.25);
  border-top-color: var(--biolum-cyan);
  box-shadow: 
    0 20px 48px rgba(2, 6, 23, 0.9), 
    0 0 20px rgba(34, 211, 238, 0.04);
}

.hadal-panel-featured {
  background: rgba(11, 19, 41, 0.9);
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-top: 2px.5 solid var(--biolum-cyan);
  box-shadow: 
    0 24px 60px rgba(2, 6, 23, 0.95), 
    0 0 30px rgba(34, 211, 238, 0.08);
}

/* ============ PRECISE HADALYX BUTTONS ============ */
.btn-hadalyx {
  background: linear-gradient(135deg, #0e7490, #0f766e);
  border: 1px solid rgba(34, 211, 238, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-weight: 500;
  letter-spacing: 0.03em;
}
.btn-hadalyx:hover:not(:disabled) {
  filter: brightness(1.08);
  box-shadow: 0 0 28px rgba(34, 211, 238, 0.35);
  transform: translateY(-1px);
}
.btn-hadalyx:active:not(:disabled) {
  transform: translateY(1px);
}
.btn-hadalyx:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-hadalyx-violet {
  background: linear-gradient(135deg, #5b21b6, #4c1d95);
  border: 1px solid rgba(139, 92, 246, 0.35);
}
.btn-hadalyx-violet:hover:not(:disabled) {
  box-shadow: 0 0 28px rgba(139, 92, 246, 0.35);
}

.btn-hadalyx-ghost {
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: transparent;
  color: var(--bathy-mist);
  transition: all 0.2s ease;
}
.btn-hadalyx-ghost:hover {
  background: rgba(34, 211, 238, 0.04);
  border-color: rgba(34, 211, 238, 0.5);
  color: #fff;
}

/* ============ TELEMETRY TABLES ============ */
.bathy-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.bathy-table th {
  background: rgba(7, 13, 30, 0.6);
  color: var(--bathy-muted);
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.9rem 1.25rem;
  border-bottom: 1.5px solid rgba(148, 163, 184, 0.1);
  font-size: 0.8rem;
}
.bathy-table td {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.06);
  font-size: 0.85rem;
}
.bathy-table tr:hover td {
  background: rgba(34, 211, 238, 0.015);
}

/* ============ FORM FIELDS ============ */
.hadal-field {
  width: 100%;
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 4px;
  padding: 0.7rem 0.9rem;
  color: #f1f5f9;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  outline: none;
  transition: all 0.2s ease;
}
.hadal-field:focus {
  border-color: var(--biolum-cyan);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.12);
  background: rgba(11, 19, 41, 0.5);
}
.hadal-field::placeholder {
  color: #475569;
}
.hadal-field.error {
  border-color: #f87171;
  box-shadow: 0 0 10px rgba(248, 113, 113, 0.12);
}
.hadal-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--bathy-muted);
  margin-bottom: 0.35rem;
}

/* ============ ACCORDION ============ */
.hadal-accordion {
  border-bottom: 1px solid rgba(148, 163, 184, 0.06);
}
.hadal-accordion-trigger {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 0.25rem;
  text-align: left;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  color: #fff;
  transition: color 0.18s ease;
}
.hadal-accordion-trigger:hover {
  color: var(--biolum-cyan);
}
.hadal-accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0 0.25rem;
}
.hadal-accordion.open .hadal-accordion-content {
  max-height: 320px;
  padding-bottom: 1.1rem;
}
.hadal-accordion-icon {
  transition: transform 0.25s ease;
  color: var(--biolum-cyan);
}
.hadal-accordion.open .hadal-accordion-icon {
  transform: rotate(180deg);
}

/* ============ GRADIENT TITLE ============ */
.hadal-gradient {
  background: linear-gradient(120deg, var(--biolum-cyan) 0%, var(--biolum-teal) 45%, var(--biolum-violet) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ============ BIOLUMINESCENT TELEMETRY BADGES ============ */
.hadalyx-badge {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid rgba(34, 211, 238, 0.22);
  color: var(--biolum-teal);
  padding: 0.25rem 0.65rem;
  border-radius: 3px;
  background: rgba(34, 211, 238, 0.02);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: 'Rajdhani', sans-serif;
}

/* ============ BIOLUMINESCENT DOTS ============ */
.hadal-pulse-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--biolum-teal);
  box-shadow: 0 0 8px var(--biolum-teal);
  animation: hadal-pulse-anim 2.5s infinite alternate;
}
@keyframes hadal-pulse-anim {
  0% { transform: scale(0.9); opacity: 0.4; box-shadow: 0 0 3px var(--biolum-teal); }
  100% { transform: scale(1.1); opacity: 0.9; box-shadow: 0 0 10px var(--biolum-teal); }
}

/* ============ ACCESSIBILITY / MOTION DEGRADATION ============ */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-delay: -1ms !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    background-attachment: initial !important;
    scroll-behavior: auto !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
  }
}
