/* ============================================================
   Frequency Sweep Detector — Styles
   FrequencyDetector.com
   ============================================================ */

/* Sweep Status Display */
.sweep-status-wrap {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: rgba(0, 255, 65, 0.02);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.sweep-status-wrap.active {
  border-color: #00ff41;
  box-shadow: 0 0 30px rgba(0, 255, 65, 0.25), inset 0 0 20px rgba(0, 255, 65, 0.05);
}

.sweep-status__label {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3em;
  margin-bottom: var(--space-xs);
}

.sweep-status__value {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 900;
  color: var(--color-text-muted);
  line-height: 1;
  letter-spacing: -0.02em;
  text-shadow: none;
  transition: color 0.3s, text-shadow 0.3s;
}

.sweep-status-wrap.active .sweep-status__value {
  color: #00ff41;
  text-shadow: 0 0 20px rgba(0, 255, 65, 0.5);
}

/* Direction Indicator */
.direction-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: rgba(0, 255, 65, 0.02);
}

.direction-arrow {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.3);
  color: var(--color-text-muted);
  transition: color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.direction-arrow__svg {
  width: 36px;
  height: 36px;
  transition: transform 0.3s ease;
}

/* Ascending arrow — pointing up */
.direction-arrow[data-direction="ascending"] {
  color: #00ff41;
  border-color: #00ff41;
  box-shadow: 0 0 12px rgba(0, 255, 65, 0.3);
}

.direction-arrow[data-direction="ascending"] .direction-arrow__svg {
  transform: rotate(0deg);
}

/* Descending arrow — pointing down */
.direction-arrow[data-direction="descending"] {
  color: #ff6600;
  border-color: #ff6600;
  box-shadow: 0 0 12px rgba(255, 102, 0, 0.3);
}

.direction-arrow[data-direction="descending"] .direction-arrow__svg {
  transform: rotate(180deg);
}

/* Bidirectional — up-down icon */
.direction-arrow[data-direction="bidirectional"] {
  color: #ffaa00;
  border-color: #ffaa00;
  box-shadow: 0 0 12px rgba(255, 170, 0, 0.3);
}

.direction-arrow[data-direction="bidirectional"] .direction-arrow__svg {
  animation: sweep-pulse 1.2s ease-in-out infinite alternate;
}

@keyframes sweep-pulse {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(180deg); }
}

/* None direction */
.direction-arrow[data-direction="none"] {
  color: var(--color-text-muted);
  border-color: var(--color-border);
  box-shadow: none;
}

.direction-label {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: color 0.3s;
}

.direction-arrow[data-direction="ascending"] ~ .direction-label {
  color: #00ff41;
}

.direction-arrow[data-direction="descending"] ~ .direction-label {
  color: #ff6600;
}

.direction-arrow[data-direction="bidirectional"] ~ .direction-label {
  color: #ffaa00;
}

/* Sweep Rate Display */
.sweep-rate-display {
  text-align: center;
  padding: var(--space-md);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: rgba(0, 255, 65, 0.02);
  transition: border-color 0.3s;
}

.sweep-rate__value {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 900;
  color: var(--color-primary);
  line-height: 1;
  letter-spacing: -0.02em;
  text-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
  transition: color 0.3s, text-shadow 0.3s;
}

.sweep-rate__unit {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}

/* Siren Pattern Indicator */
.siren-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: rgba(0, 0, 0, 0.2);
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
}

.siren-indicator.active {
  border-color: #ff3333;
  background: rgba(255, 51, 51, 0.06);
  box-shadow: 0 0 20px rgba(255, 51, 51, 0.15);
  animation: siren-flash 1.5s ease-in-out infinite;
}

@keyframes siren-flash {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 51, 51, 0.15); }
  50%      { box-shadow: 0 0 30px rgba(255, 51, 51, 0.35), 0 0 10px rgba(0, 100, 255, 0.2); }
}

.siren-indicator__icon {
  font-size: 1.5rem;
  transition: transform 0.3s;
}

.siren-indicator.active .siren-indicator__icon {
  animation: siren-icon-pulse 0.8s ease-in-out infinite alternate;
}

@keyframes siren-icon-pulse {
  0%   { transform: scale(1); }
  100% { transform: scale(1.2); }
}

.siren-indicator__text {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  transition: color 0.3s;
}

.siren-indicator.active .siren-indicator__text {
  color: #ff3333;
  font-weight: 600;
}

/* Spectrogram canvas — taller for sweep visibility */
.viz-canvas-wrap canvas {
  width: 100%;
  height: 180px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: #0a0a0a;
}

/* Result box */
.result-box {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--color-text);
  padding: var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: rgba(0, 255, 65, 0.02);
  text-align: center;
}

.result-box--large {
  font-size: var(--fs-md);
  padding: var(--space-md);
}

/* Sweep Event Log */
.history-wrap {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.3);
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}

.history-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.history-table th {
  background: rgba(0, 255, 65, 0.08);
  color: var(--color-text-muted);
  font-weight: 600;
  text-align: left;
  padding: var(--space-xs) var(--space-sm);
  border-bottom: 1px solid var(--color-border);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.history-table td {
  padding: var(--space-xs) var(--space-sm);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--color-text);
}

.history-table tr:hover td {
  background: rgba(0, 255, 65, 0.03);
}

.history-table td.dir--ascending {
  color: #00ff41;
  font-weight: 600;
}

.history-table td.dir--descending {
  color: #ff6600;
  font-weight: 600;
}

.history-table td.dir--bidirectional {
  color: #ffaa00;
  font-weight: 600;
}

/* Export Actions */
.export-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
  flex-wrap: wrap;
}

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
}

.stat-box {
  text-align: center;
  padding: var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: rgba(0, 255, 65, 0.02);
}

.stat-box__label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.stat-box__value {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--color-primary);
}

/* Keyboard hints */
.kbd-hints {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  flex-wrap: wrap;
}

.kbd-hint kbd {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  margin-right: 4px;
}

/* File upload zone */
.file-upload-zone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
  margin-bottom: var(--space-sm);
}

.file-upload-zone:hover,
.file-upload-zone.dragover {
  border-color: var(--color-primary);
  background: rgba(0, 255, 65, 0.03);
}

.file-upload-zone__icon {
  font-size: 2rem;
  margin-bottom: var(--space-xs);
}

.file-upload-zone__link {
  color: var(--color-primary);
  cursor: pointer;
  text-decoration: underline;
}

.file-upload-zone__hint {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}

/* File info bar */
.file-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: rgba(0, 255, 65, 0.03);
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}

/* Progress bar */
.progress-bar-wrap {
  margin-bottom: var(--space-sm);
}

.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}

.progress-bar__fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 3px;
  width: 0%;
  transition: width 0.2s;
}

/* Sensitivity slider */
.range-input {
  flex: 1;
  accent-color: var(--color-primary);
}

/* Sweep Generator Panel */
.sweep-generator-panel {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  background: var(--color-surface);
}

.sweep-generator-panel .tool-panel__title {
  margin-bottom: var(--space-sm);
}

/* Responsive */
@media (max-width: 768px) {
  .stats-row {
    grid-template-columns: 1fr;
  }

  .sweep-status__value {
    font-size: clamp(2.5rem, 8vw, 4rem);
  }

  .sweep-rate__value {
    font-size: clamp(2rem, 8vw, 3.5rem);
  }

  .direction-indicator {
    flex-direction: column;
    text-align: center;
  }

  .viz-canvas-wrap canvas {
    height: 140px;
  }
}
