/* node.css — Node page styles */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600;700&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
  --color-bg: #0a0a0f;
  --color-surface: #141420;
  --color-surface-raised: #1a1a2e;
  --color-border: #2a2a3e;
  --color-text: #e8e8f0;
  --color-text-muted: #888899;
  --color-accent: #ff6b35;
  --color-accent-gradient: linear-gradient(135deg, #ff6b35, #ffab40);
  --color-teal: #7eddd6;
  --color-green: #4caf50;
  --color-red: #ef4444;
  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
}

body {
  font-family: var(--font-display);
  max-width: 600px;
  margin: 50px auto;
  padding: 20px;
  background: var(--color-bg);
  color: var(--color-text);
}

.container {
  text-align: center;
}

h1 {
  background: var(--color-accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

button {
  font-size: 16px;
  padding: 10px 20px;
  margin: 10px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-display);
}

#connectBtn {
  background: linear-gradient(135deg, var(--color-green), #66bb6a);
  color: white;
  font-weight: 600;
  width: 100%;
  max-width: 320px;
  padding: 14px 0;
  box-shadow: 0 2px 12px rgba(76, 175, 80, 0.25);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
#connectBtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(76, 175, 80, 0.35);
}
#connectBtn.connected {
  background: linear-gradient(135deg, var(--color-red), #f87171);
  box-shadow: 0 2px 12px rgba(239, 68, 68, 0.25);
}
#connectBtn.connected:hover {
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
}

/* Status indicators */
.status {
  margin: 6px 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status.connected::before {
  background: var(--color-green);
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.5);
}
.status.disconnected::before {
  background: var(--color-red);
}
.status.receiving::before {
  background: var(--color-teal);
  box-shadow: 0 0 8px rgba(126, 221, 214, 0.5);
}
.status.connected {
  color: #6fcf6f;
}
.status.disconnected {
  color: #cf6f6f;
}
.status.receiving {
  color: var(--color-teal);
}

/* Room entry */
.room-entry {
  margin: 20px 0;
}

.room-manual-entry {
  margin-bottom: 15px;
}

.room-manual-entry label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-text-muted);
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

#roomCodeInput {
  font-family: var(--font-mono);
  font-size: 32px;
  text-align: center;
  width: 180px;
  padding: 12px;
  letter-spacing: 10px;
  text-transform: lowercase;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: #fff;
  font-weight: 700;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
#roomCodeInput:focus {
  outline: none;
  border-color: var(--color-teal);
  box-shadow: 0 0 0 3px rgba(126, 221, 214, 0.15);
}
#roomCodeInput::placeholder {
  color: #333;
  font-size: 16px;
  letter-spacing: 2px;
  font-weight: 400;
}

.room-url-status {
  color: #c8b84d !important;
}
.room-url-status::before {
  background: #c8b84d !important;
}

/* Name and color inputs */
.user-settings {
  margin: 12px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 320px;
}
.user-settings label {
  color: var(--color-text-muted);
  font-size: 13px;
  display: none;
}
#nodeNameInput {
  flex: 1;
  padding: 8px 12px;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 13px;
  transition: border-color 0.2s ease;
}
#nodeNameInput:focus {
  outline: none;
  border-color: var(--color-teal);
}
#nodeNameInput::placeholder {
  color: var(--color-text-muted);
}
#nodeColorInput {
  width: 36px;
  height: 36px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0;
  cursor: pointer;
  background: none;
}
#updateNameBtn {
  padding: 8px 12px;
  display: none;
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: all 0.15s ease;
}
#updateNameBtn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Audio visualization */
#visualization {
  width: 100%;
  max-width: 320px;
  height: 100px;
  background: linear-gradient(to right, #1e3c72, #2a5298);
  border-radius: var(--radius-md);
  margin: 20px auto;
  position: relative;
  overflow: hidden;
  display: none;
}

.wave {
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.3)
  );
  border-radius: var(--radius-md);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.1s ease-out;
}

#amplitudeIndicator {
  position: absolute;
  bottom: 10px;
  right: 10px;
  color: white;
  font-size: 12px;
  opacity: 0.8;
  font-family: var(--font-mono);
}

/* Controls section */
#controls {
  display: none;
  max-width: 320px;
  margin: 0 auto;
  text-align: left;
}

#controls h3 {
  color: var(--color-text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

#controls label {
  color: var(--color-text-muted);
  font-size: 13px;
}

#volumeControl {
  margin: 20px 0;
}

#volumeSlider,
#boostSlider {
  width: 100%;
}

/* Debug panel */
#debugPanel {
  max-width: 320px;
  margin: 8px auto;
  text-align: left;
}
#debugPanel details {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
#debugPanel summary {
  padding: 8px 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-text-muted);
  cursor: pointer;
  user-select: none;
}
#debugLog {
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  color: var(--color-text-muted);
  max-height: 200px;
  overflow-y: auto;
}
#debugLog .debug-entry {
  padding: 2px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
#debugLog .debug-ok { color: var(--color-green); }
#debugLog .debug-warn { color: #c8b84d; }
#debugLog .debug-err { color: var(--color-red); }
#debugLog .debug-info { color: var(--color-teal); }
