/* ==========================================================================
   EDGEVEC LAYOUT STYLES
   Page structure and responsive layout
   ========================================================================== */

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13, 17, 23, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--text-muted);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.header__logo {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
}

.header__version {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.header__nav {
  display: flex;
  gap: var(--space-lg);
}

.header__link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
  position: relative;
}

.header__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--neon-cyan);
  transition: width var(--transition-fast);
}

.header__link:hover {
  color: var(--neon-cyan);
}

.header__link:hover::after {
  width: 100%;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* Theme Toggle */
.theme-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.theme-toggle__icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--text-primary);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle__icon--light {
  display: none;
}

[data-theme="light"] .theme-toggle__icon--dark {
  display: none;
}

[data-theme="light"] .theme-toggle__icon--light {
  display: block;
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.hero {
  padding: var(--space-2xl) 0;
  text-align: center;
  background: radial-gradient(ellipse at center, rgba(0, 255, 255, 0.1) 0%, transparent 70%);
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 3rem);
  font-weight: 900;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-md);
}

.hero__subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

/* Status Bar */
.status-bar {
  display: inline-flex;
  gap: var(--space-lg);
  padding: var(--space-md) var(--space-xl);
  background: var(--bg-panel);
  border: 1px solid var(--text-muted);
  border-radius: var(--radius-md);
}

.status-bar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}

.status-bar__label {
  font-size: 0.625rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.status-bar__value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--neon-green);
}

.status-bar__value--loading {
  color: var(--neon-yellow);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* --------------------------------------------------------------------------
   Main Layout
   -------------------------------------------------------------------------- */
.main {
  padding: var(--space-xl) 0;
}

.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: var(--space-xl);
}

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

/* Sidebar */
.sidebar {
  position: sticky;
  top: calc(64px + var(--space-lg));
  height: fit-content;
}

@media (max-width: 1024px) {
  .sidebar {
    position: static;
  }
}

/* Control Groups */
.control-group {
  margin-bottom: var(--space-md);
}

.control-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--neon-cyan);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-xs);
}

.control-output {
  display: block;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Radio Group */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.radio {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
}

.radio input[type="radio"] {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid var(--text-muted);
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.radio input[type="radio"]:checked {
  border-color: var(--neon-cyan);
  background: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.radio__label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.radio input[type="radio"]:checked + .radio__label {
  color: var(--neon-cyan);
}

/* --------------------------------------------------------------------------
   Search Box
   -------------------------------------------------------------------------- */
.search-box {
  margin-bottom: var(--space-xl);
}

.search-box__input-wrapper {
  position: relative;
  display: flex;
}

.search-box__input {
  flex: 1;
  padding: var(--space-md) var(--space-lg);
  padding-right: 60px;
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-terminal);
  border: 2px solid var(--text-muted);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.search-box__input:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
}

.search-box__btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--neon-cyan);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.search-box__btn:hover {
  background: var(--neon-magenta);
  box-shadow: var(--glow-magenta);
}

.search-box__icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--bg-void);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --------------------------------------------------------------------------
   Results Container
   -------------------------------------------------------------------------- */
.results {
  min-height: 300px;
}

.results__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  text-align: center;
  gap: var(--space-sm);
}

.results__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  text-align: center;
  gap: var(--space-sm);
}

/* --------------------------------------------------------------------------
   Metric Cards
   -------------------------------------------------------------------------- */
.metric-card {
  background: var(--bg-panel);
  border: 1px solid var(--text-muted);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  text-align: center;
  transition: all var(--transition-base);
}

.metric-card:hover {
  border-color: var(--neon-cyan);
  transform: translateY(-4px);
}

.metric-card__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-md);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  background: rgba(0, 255, 255, 0.1);
}

.metric-card__icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--neon-cyan);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.metric-card__icon--cyan svg { stroke: var(--neon-cyan); }
.metric-card__icon--magenta svg { stroke: var(--neon-magenta); }
.metric-card__icon--green svg { stroke: var(--neon-green); }

.metric-card__value {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.metric-card__label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* --------------------------------------------------------------------------
   Chart Container
   -------------------------------------------------------------------------- */
.chart-container {
  background: var(--bg-panel);
  border: 1px solid var(--text-muted);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin: var(--space-xl) 0;
  min-height: 250px;
}

.chart {
  width: 100%;
  height: 100%;
}

.chart__line {
  stroke-width: 2;
  fill: none;
}

.chart__line--f32 { stroke: var(--neon-cyan); }
.chart__line--bq { stroke: var(--neon-magenta); }

/* --------------------------------------------------------------------------
   Memory Gauge
   -------------------------------------------------------------------------- */
.memory-gauge {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-xl);
}

.gauge {
  max-width: 200px;
}

.gauge__progress {
  transition: stroke-dashoffset var(--transition-slow);
}

.memory-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  flex-wrap: wrap;
}

.memory-stats__item {
  text-align: center;
}

.memory-stats__label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-xs);
}

.memory-stats__value {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.memory-stats__value--status {
  color: var(--neon-green);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
  padding: var(--space-xl) 0;
  background: var(--bg-void);
  border-top: 1px solid var(--text-muted);
  text-align: center;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer__text {
  color: var(--text-secondary);
}

.footer__text a {
  color: var(--neon-cyan);
  text-decoration: none;
}

.footer__text a:hover {
  text-decoration: underline;
}

.footer__subtext {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Noise Overlay
   -------------------------------------------------------------------------- */
.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.02;
  z-index: var(--z-overlay);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Effect Canvas (Particle/Matrix backgrounds)
   -------------------------------------------------------------------------- */
.effect-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.effect-canvas--matrix {
  opacity: 0.15;
  z-index: -2;
}

/* Hide effect canvases when reduced motion is preferred */
@media (prefers-reduced-motion: reduce) {
  .effect-canvas {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Mobile Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .header__nav {
    display: none;
  }

  .hero__title {
    font-size: 1.5rem;
  }

  .status-bar {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .metric-card__value {
    font-size: 2rem;
  }

  .memory-stats {
    flex-direction: column;
    gap: var(--space-md);
  }
}
