/* CableDoctor Stylesheet */
:root {
  --bg-main: #090d16;
  --bg-card: #111827;
  --bg-subtle: #1f2937;
  --border-color: #374151;
  --accent-cyan: #06b6d4;
  --accent-violet: #8b5cf6;
  --accent-blue: #3b82f6;
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --status-pass: #10b981;
  --status-warn: #f59e0b;
  --status-fail: #ef4444;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
}

/* Header */
.app-header {
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  font-size: 1.8rem;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
  border-radius: 12px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.app-subtitle {
  font-size: 0.8rem;
  color: var(--accent-cyan);
  font-weight: 500;
}

/* Main Layout */
.app-main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 1.5rem;
}

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

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  margin-bottom: 1.25rem;
}

.panel-card:last-child {
  margin-bottom: 0;
}

.panel-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Device Presets Row */
.preset-chips {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.preset-chip {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s;
  text-align: left;
}

.preset-chip:hover {
  border-color: var(--accent-cyan);
  color: var(--text-main);
}

.preset-chip.active {
  background: rgba(6, 182, 212, 0.12);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Form Controls */
.form-group {
  margin-bottom: 0.85rem;
}

.form-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.form-select, .form-input {
  width: 100%;
  background: #090d16;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-select:focus, .form-input:focus {
  border-color: var(--accent-cyan);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-main);
  margin-top: 0.5rem;
  cursor: pointer;
}

.checkbox-row input {
  accent-color: var(--accent-cyan);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Bandwidth Throughput Hero Banner */
.throughput-hero {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.12), rgba(139, 92, 246, 0.12));
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hero-data-box {
  display: flex;
  flex-direction: column;
}

.hero-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.hero-val {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--accent-cyan);
  font-family: monospace;
  line-height: 1.1;
  margin-top: 0.2rem;
}

.hero-val span {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
}

.hero-details {
  text-align: right;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.hero-details b {
  color: var(--text-main);
  font-family: monospace;
}

/* Pipe Comparison Bar */
.pipe-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.pipe-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
}

.cable-row {
  margin-bottom: 1rem;
}

.cable-row:last-child {
  margin-bottom: 0;
}

.cable-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.cable-type-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-right: 0.4rem;
}

.badge-hdmi { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }
.badge-dp { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.4); }
.badge-usbc { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.4); }

.pipe-bar-bg {
  width: 100%;
  height: 14px;
  background: #1f2937;
  border-radius: 7px;
  overflow: hidden;
  position: relative;
}

.pipe-bar-fill {
  height: 100%;
  border-radius: 7px;
  transition: width 0.4s ease-out, background-color 0.4s;
}

.pipe-bar-fill.pass {
  background: linear-gradient(90deg, #10b981, #059669);
}

.pipe-bar-fill.warn {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

.pipe-bar-fill.fail {
  background: linear-gradient(90deg, #ef4444, #b91c1c);
}

.status-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
}

.status-pill.pass { background: rgba(16, 185, 129, 0.2); color: var(--status-pass); }
.status-pill.warn { background: rgba(245, 158, 11, 0.2); color: var(--status-warn); }
.status-pill.fail { background: rgba(239, 68, 68, 0.2); color: var(--status-fail); }

/* Cable Cards Grid */
.cables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.cable-card {
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s, border-color 0.2s;
}

.cable-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-cyan);
}

.cable-card.pass { border-left: 4px solid var(--status-pass); }
.cable-card.warn { border-left: 4px solid var(--status-warn); }
.cable-card.fail { border-left: 4px solid var(--status-fail); }

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.card-spec {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.card-reason {
  font-size: 0.78rem;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

/* Buying Guide & Traps */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.guide-item {
  background: rgba(31, 41, 55, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.85rem;
}

.guide-item-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.guide-item-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}
