/* WebRTC Connection Tester — styles.css — Electric Purple */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --primary: #6C5CE7;
  --secondary: #A29BFE;
  --accent: #00B894;
  --bg: #0A0A1A;
  --bg-card: rgba(10, 10, 26, 0.92);
  --surface: rgba(20, 20, 50, 0.5);
  --border: rgba(108, 92, 231, 0.1);
  --text: #D0D0E8;
  --text-dim: #8080A8;
  --text-muted: #404060;
  --green: #00B894;
  --red: #D63031;
  --yellow: #FDCB6E;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.25s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

.header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: var(--bg-card); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100;
}
.header-left { display: flex; align-items: center; gap: 10px; }
.logo { width: 34px; height: 34px; background: linear-gradient(135deg, var(--primary), var(--secondary)); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 16px; }
.header h1 { font-size: 15px; font-weight: 600; color: var(--secondary); }
.header-right { display: flex; align-items: center; gap: 8px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.status-dot.connected { background: var(--green); }
.status-text { font-size: 11px; color: var(--text-dim); }

.btn {
  padding: 7px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-family: 'Inter', sans-serif;
  font-size: 12px; font-weight: 500; cursor: pointer; transition: var(--transition);
}
.btn:hover { border-color: var(--primary); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--primary), #5f27cd); border-color: transparent; color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 11px; margin-right: 6px; margin-top: 6px; }

.input { width: 100%; padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg); color: var(--text); font-family: 'JetBrains Mono', monospace; font-size: 12px; outline: none; }
.input:focus { border-color: var(--primary); }

.app { max-width: 800px; margin: 0 auto; padding: 16px; }
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.card h3 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-dim); margin-bottom: 10px; }
.field-row { display: flex; gap: 8px; }

.badge { font-size: 9px; padding: 2px 8px; border-radius: 10px; background: rgba(108,92,231,0.2); color: var(--secondary); font-weight: 600; vertical-align: middle; }

.timeline { display: flex; flex-direction: column; gap: 4px; }
.tl-entry { display: flex; align-items: center; gap: 8px; font-size: 11px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.tl-time { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-muted); min-width: 60px; }
.tl-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.tl-new { background: var(--primary); }
.tl-checking { background: var(--yellow); }
.tl-connected { background: var(--green); }
.tl-failed { background: var(--red); }
.tl-closed { background: var(--text-muted); }

.ice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.ice-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px; font-size: 10px; font-family: 'JetBrains Mono', monospace; }
.ice-type { font-weight: 700; text-transform: uppercase; margin-bottom: 4px; }
.ice-host { color: var(--green); } .ice-srflx { color: var(--secondary); } .ice-relay { color: var(--yellow); }

.tabs { display: flex; gap: 2px; margin-bottom: 8px; }
.tab {
  padding: 5px 12px; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--surface); border: 1px solid var(--border); border-bottom: none;
  color: var(--text-dim); font-size: 11px; font-weight: 500; cursor: pointer;
  font-family: 'Inter', sans-serif; transition: var(--transition);
}
.tab.active { background: var(--bg); color: var(--primary); border-color: var(--primary); }

.output {
  background: var(--bg); border: 1px solid var(--border); border-radius: 0 var(--radius-sm) var(--radius-sm) var(--radius-sm);
  padding: 12px; font-family: 'JetBrains Mono', monospace; font-size: 10px;
  white-space: pre-wrap; word-break: break-all; color: var(--secondary); max-height: 200px; overflow-y: auto;
}

.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.stat-item { text-align: center; padding: 8px; background: var(--surface); border-radius: var(--radius-sm); }
.stat-label { font-size: 9px; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.5px; }
.stat-value { font-size: 16px; font-weight: 700; color: var(--accent); margin-top: 2px; font-family: 'JetBrains Mono', monospace; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 20px; font-size: 13px; opacity: 0; transition: all 0.3s; z-index: 300; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-thumb { background: var(--surface); border-radius: 3px; }
