/* Fake Chrome Security Warning Screen */
.fake-security-screen {
  position: fixed;
  inset: 0;
  background-color: #202124;
  color: #fff;
  font-family: Roboto, Arial, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 99999;
}

.sec-container {
  max-width: 600px;
  width: 100%;
}

.sec-icon {
  margin-bottom: 24px;
}

.sec-title {
  font-size: 24px;
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 16px;
  color: #fff;
}

.sec-desc {
  font-size: 14px;
  line-height: 1.6;
  color: #9aa0a6;
  margin-bottom: 16px;
}

.sec-code {
  font-size: 12px;
  font-family: monospace;
  color: #9aa0a6;
  margin-bottom: 28px;
  text-transform: uppercase;
}

.sec-actions {
  margin-bottom: 32px;
}

.sec-btn-back {
  background-color: #8ab4f8;
  color: #202124;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 24px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.sec-btn-back:hover {
  background-color: #93bbf9;
}

.sec-details {
  font-size: 13px;
  line-height: 1.6;
  color: #9aa0a6;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
}

:root {
  --bg-main: #0b0f17;
  --bg-card: #151d2c;
  --bg-card-hover: #1c273a;
  --bg-input: #0f172a;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #3b82f6;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-amber: #f59e0b;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: 30px;
}

.app-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 4px 0;
}

.brand-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(6, 182, 212, 0.2));
  border: 1px solid rgba(59, 130, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.brand-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.live-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.live-pill.online {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--accent-green);
}

.live-pill.offline {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: var(--text-muted);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
}

.live-pill.online .live-dot {
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* Tabs */
.nav-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: var(--bg-card);
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn .nav-icon {
  font-size: 18px;
}

.nav-btn.active {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.card-header h2 {
  font-size: 16px;
  font-weight: 700;
}

.card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.badge-accent {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

/* Dropzone */
.dropzone {
  border: 2px dashed rgba(59, 130, 246, 0.4);
  border-radius: var(--radius-md);
  padding: 32px 16px;
  text-align: center;
  background: rgba(15, 23, 42, 0.6);
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropzone.dragover {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.08);
}

.upload-cloud-icon {
  font-size: 44px;
  margin-bottom: 8px;
}

.drop-text-primary {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.drop-text-secondary {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Selected File Card */
.selected-file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin: 16px 0;
}

.file-icon-box {
  font-size: 24px;
}

.file-meta {
  flex: 1;
  overflow: hidden;
}

.file-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-clear {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}

.btn-clear:hover {
  color: var(--accent-red);
}

/* Progress Panel */
.progress-panel {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 16px 0;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.progress-percent {
  color: var(--accent-cyan);
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
  border-radius: 4px;
  transition: width 0.2s ease;
}

.progress-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
}

.p-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meta-label {
  font-size: 11px;
  color: var(--text-muted);
}

.meta-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Smart Probe Report */
.smart-probe-card {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 16px;
}

.probe-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.probe-success-icon {
  font-size: 26px;
}

.probe-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-green);
}

.probe-header p {
  font-size: 12px;
  color: var(--text-secondary);
  word-break: break-all;
}

.probe-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  background: var(--bg-input);
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}

.probe-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.p-lbl {
  font-size: 11px;
  color: var(--text-muted);
}

.p-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 700;
}

.w-100 {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-success {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #fff;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

/* Media List */
.media-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.media-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  gap: 12px;
}

.mic-info {
  flex: 1;
  overflow: hidden;
}

.mic-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.mic-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.mic-badge {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 10px;
}

.mic-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Live Stream Box */
.stream-status-box {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
}

.stream-main-state {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.state-icon {
  font-size: 32px;
}

.stream-main-state h3 {
  font-size: 17px;
  font-weight: 700;
}

.state-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.live-metrics-panel {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.metric-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-card.full-width {
  grid-column: span 2;
}

.m-title {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.m-num {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.highlight-fps {
  color: var(--accent-green);
}

.highlight-bitrate {
  color: var(--accent-cyan);
}

.m-filename {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.offline-prompt {
  text-align: center;
  padding: 16px 8px;
  color: var(--text-secondary);
  font-size: 13px;
}

/* Telemetry Grid */
.telemetry-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.sc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.sc-val {
  font-weight: 700;
}

.highlight-green {
  color: var(--accent-green);
}

.sc-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

.fill-cpu {
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
}

.fill-ram {
  background: linear-gradient(90deg, #06b6d4, #10b981);
}

.fill-disk {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  z-index: 1000;
  animation: slide-up 0.3s ease;
}

@keyframes slide-up {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.hidden {
  display: none !important;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.loader-box {
  text-align: center;
  padding: 30px;
  color: var(--text-muted);
  font-size: 13px;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
