@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ==================== Reset & Base ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: #020617;
  background: #f8fafc;
  height: 100%;
}

/* ==================== Import Screen ==================== */

.import-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 40%, #0f172a 100%);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.import-screen::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at center, rgba(99,102,241,0.15) 0%, transparent 60%);
  animation: pulseGlow 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.import-hero {
  text-align: center;
  max-width: 520px;
  width: 100%;
  position: relative;
  z-index: 1;
}

.import-logo {
  margin-bottom: 20px;
}

.logo-icon {
  font-size: 56px;
  display: block;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 20px rgba(99,102,241,0.6));
  animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.logo-title {
  font-size: 32px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.logo-sub {
  font-size: 14px;
  color: #a5b4fc;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.import-description {
  color: #94a3b8;
  font-size: 15px;
  margin-bottom: 32px;
  line-height: 1.6;
}

.import-support-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.import-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #c7d2fe;
  text-decoration: none;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 999px;
  padding: 8px 12px;
  transition: all 0.2s;
  background: rgba(15, 23, 42, 0.35);
}

.import-link:hover {
  color: #ffffff;
  border-color: rgba(99, 102, 241, 0.9);
  background: rgba(99, 102, 241, 0.22);
}

.btn.btn-coffee {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-color: #b45309;
  color: #fff;
}

.btn.btn-coffee:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  border-color: #92400e;
}

.import-dropzone {
  background: rgba(255,255,255,0.04);
  border: 2px dashed rgba(99,102,241,0.4);
  border-radius: 20px;
  padding: 48px 32px;
  transition: all 0.3s;
  cursor: pointer;
  position: relative;
  backdrop-filter: blur(8px);
}

.import-dropzone:hover,
.import-dropzone.drag-over {
  background: rgba(99,102,241,0.1);
  border-color: #6366f1;
  transform: translateY(-2px);
  box-shadow: 0 20px 60px rgba(99,102,241,0.2);
}

.import-dropzone.drag-over {
  border-style: solid;
}

.dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.dropzone-icon {
  font-size: 48px;
  opacity: 0.8;
}

.dropzone-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.dropzone-main {
  font-size: 16px;
  font-weight: 600;
  color: #e2e8f0;
}

.dropzone-sub {
  font-size: 13px;
  color: #64748b;
}

.import-file-btn {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.file-input-hidden {
  display: none;
}

.import-error {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(244,63,94,0.15);
  border: 1px solid rgba(244,63,94,0.4);
  border-radius: 10px;
  color: #fda4af;
  font-size: 13px;
  text-align: left;
}

/* ==================== Dashboard Layout ==================== */

.dashboard {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #ffffff;
}

.dashboard-header {
  padding: 5px 20px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.dashboard-header h1 {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
}

.header-actions {
  display: flex;
  gap: 12px;
}

/* ==================== Buttons ==================== */

.btn {
  padding: 8px 14px;
  font-size: 13px;
  border: 1px solid #e2e8f0;
  background: white;
  color: #0f172a;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  font-family: inherit;
}

.btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.btn.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
}

.btn.btn-primary {
  background: #6366f1;
  color: white;
  border-color: #6366f1;
}

.btn.btn-primary:hover {
  background: #4f46e5;
  border-color: #4f46e5;
}

.btn.btn-success {
  background: #047857;
  color: white;
  border-color: #047857;
}

.btn.btn-success:hover {
  background: #046449;
  border-color: #046449;
}

.btn.btn-danger {
  background: #f43f5e;
  color: white;
  border-color: #f43f5e;
}

.btn.btn-danger:hover {
  background: #e11d48;
  border-color: #e11d48;
}

.btn.btn-secondary {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-detail {
  padding: 6px 10px;
  font-size: 11px;
  background: #6366f1;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  font-family: inherit;
}

.btn-detail:hover {
  background: #4f46e5;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ==================== Session Info Bar ==================== */

.session-info-compact {
  background: white;
  padding: 10px 20px;
  border-left: 3px solid #6366f1;
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
  flex-shrink: 0;
  width: 100%;
  border-bottom: 1px solid #e2e8f0;
}

.session-info-compact strong {
  color: #0f172a;
  font-weight: 600;
}

/* ==================== Layout ==================== */

.dashboard-body {
  flex: 1;
  overflow: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.two-column {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 12px !important;
  overflow: visible !important;
  min-height: 0;
  flex: 1;
}

.video-panel,
.tabs-panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

/* ==================== Video Panel ==================== */

.video-panel {
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.panel-title {
  padding: 10px 20px;
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 600;
  font-size: 13px;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.video-panel .video-container {
  flex: 1;
  display: flex;
  overflow: hidden;
  background: #f8fafc;
  padding: 16px;
  justify-content: center;
  align-items: center;
  min-height: 0;
  flex-direction: column;
}

.video-panel .video-container.is-fullscreen,
.video-panel .video-container:fullscreen,
.video-panel .video-container:-webkit-full-screen,
.video-panel .video-container:-ms-fullscreen {
  background: #020617;
  padding: 20px;
  gap: 14px;
}

.video-panel .video-container.is-fullscreen .video-stage,
.video-panel .video-container:fullscreen .video-stage,
.video-panel .video-container:-webkit-full-screen .video-stage,
.video-panel .video-container:-ms-fullscreen .video-stage {
  background: #020617;
  border: 1px solid #1e293b;
}

.video-panel .video-container.is-fullscreen video,
.video-panel .video-container:fullscreen video,
.video-panel .video-container:-webkit-full-screen video,
.video-panel .video-container:-ms-fullscreen video {
  max-height: calc(100vh - 180px);
  border-color: #334155;
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
}

.video-panel .video-container.is-fullscreen .custom-video-controls,
.video-panel .video-container:fullscreen .custom-video-controls,
.video-panel .video-container:-webkit-full-screen .custom-video-controls,
.video-panel .video-container:-ms-fullscreen .custom-video-controls {
  border-color: #334155;
  background: rgba(2, 6, 23, 0.86);
}

.video-stage {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 14px;
  background: linear-gradient(140deg, #f9fbff 0%, #f1f5f9 100%);
  padding: 8px;
  flex: 1;
  min-height: 0;
}

.video-panel video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
  border: 1px solid #e2e8f0;
  background: transparent;
}

.custom-video-controls {
  width: 100%;
  margin-top: 12px;
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.custom-video-controls.disabled {
  opacity: 0.65;
}

.video-time-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #475569;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fbff 0%, #f1f6ff 100%);
  padding: 6px 8px;
}

.video-time-row > span {
  background: #ffffff;
  border: 1px solid #cfdcf1;
  border-radius: 8px;
  color: #1e3a8a;
  font-size: 12px;
  font-weight: 700;
  min-width: 58px;
  text-align: center;
  padding: 3px 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
  flex: 0 0 auto;
}

.video-time-row .video-info {
  flex: 1;
  text-align: center;
}

.video-timeline-wrap {
  position: relative;
  padding-top: 18px;
  margin: 0 20px;
}

.video-timeline-ticks {
  position: absolute;
  top: 1px;
  left: 0;
  right: 0;
  height: 20px;
  pointer-events: none;
}

.video-tick {
  position: absolute;
  bottom: 1px;
  transform: translateX(-50%);
  width: 1px;
  background: #94a3b8;
  height: 5px;
  opacity: 0.75;
}

.video-tick.medium {
  height: 8px;
  background: #64748b;
  opacity: 0.9;
}

.video-tick.major {
  height: 12px;
  background: #334155;
  opacity: 1;
}

.video-tick-label {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  color: #475569;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.video-timeline-slider {
  width: 100%;
  appearance: none;
  background: transparent;
  cursor: pointer;
  position: relative;
}

.video-timeline-slider::-webkit-slider-runnable-track {
  height: 12px;
  border-radius: 999px;
  border: 1px solid #c7d2e3;
  background: repeating-linear-gradient(to right, rgba(100,116,139,0.3), rgba(100,116,139,0.3) 1px, transparent 1px, transparent 8px),
    linear-gradient(90deg, #e0ecff 0%, #f8fbff 100%);
  box-shadow: inset 0 1px 2px rgba(15,23,42,0.1);
}

.video-timeline-slider::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid #1e3a8a;
  background: #fff;
  margin-top: -4px;
  box-shadow: 0 2px 6px rgba(15,23,42,0.25), inset 0 0 0 2px #dbeafe;
}

.video-timeline-slider::-moz-range-track {
  height: 12px;
  border-radius: 999px;
  border: 1px solid #c7d2e3;
  background: linear-gradient(90deg, #e0ecff 0%, #f8fbff 100%);
}

.video-timeline-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid #1e3a8a;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15,23,42,0.25);
}

.video-timeline-slider:disabled { cursor: not-allowed; }

.video-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.video-actions .btn {
  min-width: 100px;
}

.video-info {
  padding: 0;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
}

.video-info-text {
  display: inline-block;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.video-size-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  color: #6366f1;
  font-size: 12px;
  font-weight: 700;
}

/* ==================== Tabs Panel ==================== */

.tabs-panel {
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.tabs-panel .tabs {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs-panel .tabs::-webkit-scrollbar { display: none; }

.tabs-panel .tab-content {
  flex: 1;
  overflow-y: auto;
  background: white;
  padding: 16px;
  min-height: 0;
}

.tabs-panel .tab-pane {
  display: none;
}

.tabs-panel .tab-pane.active {
  display: flex;
  flex-direction: column;
}

.tab-btn {
  padding: 10px 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
}

.tab-btn:hover {
  color: #6366f1;
  background: #f1f5f9;
}

.tab-btn.active {
  color: #6366f1;
  border-bottom-color: #6366f1;
}

.tab-count {
  display: inline-block;
  background: #ef4444;
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 12px;
  margin-left: 5px;
  min-width: 22px;
  text-align: center;
}

.tab-btn.active .tab-count { background: #6366f1; }

/* ==================== Filter Bar ==================== */

.filter-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px;
  background: #f8fafc;
  border-radius: 12px 6px 0 0;
  border-bottom: 1px solid #e2e8f0;
  margin: -16px -16px 12px -16px;
  flex-shrink: 0;
}

.filter-input,
.filter-select {
  padding: 8px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  background: white;
  color: #0f172a;
  transition: all 0.2s;
  font-family: inherit;
}

.filter-input { flex: 1; min-width: 200px; }

.filter-input:focus,
.filter-select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

/* ==================== Lists ==================== */

.replay-timeline,
.replay-api-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  padding-right: 2px;
  flex: 1;
}

.replay-timeline-item,
.replay-api-item {
  padding: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 12px;
  transition: all 0.2s;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.replay-timeline-item:hover,
.replay-api-item:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.replay-timeline-item.active,
.replay-api-item.active {
  font-weight: 600;
  background: #eef2ff;
  border-color: #6366f1;
  box-shadow: 0 1px 3px #6366f11a;
}

.timeline-number,
.api-number {
  min-width: 28px;
  padding: 2px 4px;
  background: #e2e8f0;
  color: #0f172a;
  border-radius: 12px;
  font-weight: 700;
  text-align: center;
  font-size: 11px;
  flex-shrink: 0;
}

.timeline-time,
.api-time {
  font-size: 11px;
  color: #94a3b8;
  min-width: 40px;
  flex-shrink: 0;
}

.timeline-type {
  flex-shrink: 0;
  background: #e0e7ff;
  color: #6366f1;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 11px;
}

.timeline-desc {
  flex: 1;
  word-break: break-word;
}

.timeline-title { font-weight: 600; color: #0f172a; }
.timeline-description { font-size: 11px; color: #94a3b8; margin-top: 2px; }

.api-method {
  min-width: 40px;
  padding: 2px 6px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 10px;
  text-align: center;
  background: #e0e7ff;
  color: #6366f1;
  flex-shrink: 0;
}

.api-method.get { background: #e0e7ff; color: #4338ca; }
.api-method.post { background: #dcfce7; color: #059669; }
.api-method.put { background: #fef3c7; color: #b45309; }
.api-method.delete { background: #ffe4e6; color: #e11d48; }
.api-method.patch { background: #f3e8ff; color: #7c3aed; }

.api-details {
  flex: 1;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
}

.api-url {
  font-size: 11px;
  color: #0f172a;
  word-break: break-all;
  flex: 1;
  min-width: 80px;
}

.api-status {
  font-size: 11px;
  font-weight: 600;
  color: #064e3b;
  background: #d1fae5;
  padding: 2px 6px;
  border-radius: 12px;
  min-width: 30px;
  text-align: center;
  flex-shrink: 0;
}

.api-status[data-status*="2"],
.api-status[data-status*="3"] { background: #dcfce7; color: #059669; }
.api-status[data-status*="4"],
.api-status[data-status*="5"] { background: #ffe4e6; color: #e11d48; }

.replay-api-item[data-status="status-error"] .api-status { color: #9f1239; background: #ffe4e6; }
.replay-api-item[data-status="status-aborted"] .api-status { color: #92400e; background: #fef3c7; }

/* ==================== Empty State ==================== */

.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: #94a3b8;
  font-size: 13px;
}

/* ==================== Replay Tab ==================== */

.replay-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.replay-controls-section {
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
  padding-bottom: 10px;
}

.replay-controls-section h3 {
  font-size: 13px;
  color: #0f172a;
  font-weight: 600;
  margin-bottom: 8px;
}

.replay-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.replay-speed {
  display: flex;
  gap: 10px;
  align-items: center;
}

.replay-speed label { font-size: 12px; color: #64748b; font-weight: 500; }
.replay-speed input { width: 90px; cursor: pointer; }
.replay-speed span { font-size: 12px; color: #6366f1; font-weight: 600; min-width: 30px; }

.replay-status {
  margin-top: 8px;
  padding: 8px;
  background: #e0f2fe;
  color: #3730a3;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
}

.replay-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.replay-column {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.replay-column h3 {
  font-size: 13px;
  color: #0f172a;
  font-weight: 600;
  margin-bottom: 8px;
  flex-shrink: 0;
}

/* ==================== Analytics ==================== */

.analytics-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.analytics-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.stat-card {
  background: white;
  border: 1px solid #e2e8f0;
  padding: 16px;
  border-radius: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.stat-icon { font-size: 20px; min-width: 28px; }
.stat-info { flex: 1; }
.stat-label { font-size: 11px; color: #94a3b8; font-weight: 500; margin-bottom: 2px; }
.stat-value { font-size: 16px; font-weight: 700; color: #0f172a; }

.stat-value.health-good { color: #047857; }
.stat-value.health-warning { color: #b45309; }
.stat-value.health-bad { color: #b91c1c; }

.analytics-section {
  border: 1px solid #e2e8f0;
  padding: 16px;
  border-radius: 12px;
  background: white;
}

.analytics-section h3 {
  font-size: 13px;
  color: #0f172a;
  font-weight: 600;
  margin-bottom: 12px;
}

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

.analytics-section-header h3 { margin-bottom: 0; }

.ai-summary-text {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  font-size: 12px;
  color: #1e293b;
  white-space: pre-wrap;
  line-height: 1.55;
  max-height: 380px;
  overflow: auto;
  font-family: 'Courier New', monospace;
}

.analytics-chart { display: flex; flex-direction: column; gap: 12px; }

.chart-bar { display: flex; gap: 12px; align-items: center; }
.chart-label { min-width: 80px; font-size: 12px; color: #64748b; font-weight: 500; }
.chart-bar-fill { flex: 1; height: 6px; background: #6366f1; border-radius: 3px; transition: width 0.6s ease; }
.chart-count { min-width: 30px; text-align: right; font-size: 12px; font-weight: 600; color: #0f172a; }

.analytics-list { display: flex; flex-direction: column; gap: 8px; }

.analytics-mini-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
}

.analytics-mini-stat {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  padding: 10px;
}

.analytics-mini-label { font-size: 11px; color: #64748b; margin-bottom: 4px; }
.analytics-mini-value { font-size: 16px; color: #0f172a; font-weight: 700; }

.analytics-meta { color: #64748b; font-size: 11px; }

.analytics-action { cursor: pointer; }
.analytics-action:hover { border-color: #cbd5e1 !important; background: #f1f5f9 !important; }

/* ==================== Special Headers Warning ==================== */

.special-headers-warning { border-color: #f59e0b; background: #fffbeb; }
.special-headers-warning details { width: 100%; }
.special-headers-warning summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: #92400e;
  font-weight: 600;
}
.special-headers-warning summary::-webkit-details-marker { display: none; }
.warning-count {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
}
.special-headers-content { margin-top: 12px; }
.special-headers-description { color: #78350f; font-size: 12px; margin-bottom: 10px; }
.special-headers-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.special-header-tag {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #fcd34d;
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  font-weight: 600;
}

/* ==================== Badges ==================== */

.badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.badge-secondary { color: #64748b; }
.badge-primary { color: #3b82f6; }
.badge-success { color: #22c55e; }
.badge-danger { color: #ef4444; }
.badge-warning { color: #f59e0b; }
.badge-info { color: #0ea5e9; }

/* ==================== Scrollbar ==================== */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ==================== Modal ==================== */

.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-content {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  max-width: 700px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  width: 90%;
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.modal-header h2 { font-size: 18px; font-weight: 600; color: #0f172a; }

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #64748b;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover { color: #020617; }

.modal-body { padding: 20px; overflow-y: auto; flex: 1; }

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* ==================== Event Detail Modal ==================== */

.event-detail-container { display: flex; flex-direction: column; gap: 16px; }
.event-detail-section { border: 1px solid #e2e8f0; background: #f8fafc; border-radius: 12px; padding: 12px; }
.event-detail-header { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: #1e293b; display: flex; align-items: center; gap: 6px; }
.event-detail-grid { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 12px; }
.event-detail-label { color: #64748b; font-weight: 600; }
.event-detail-value { color: #0f172a; word-break: break-word; }
.event-detail-kv { display: flex; flex-direction: column; gap: 6px; }
.event-detail-kv-row { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 6px 8px; font-size: 12px; }

.event-raw-json { margin-top: 8px; border: 1px dashed #cbd5e1; border-radius: 10px; padding: 8px 10px; background: #fff; }
.event-raw-json summary { cursor: pointer; color: #475569; font-size: 12px; font-weight: 600; list-style: none; }
.event-raw-json summary::-webkit-details-marker { display: none; }
.event-raw-code { margin: 10px 0 0; background: #f5f5f5; padding: 10px; border-radius: 8px; overflow: auto; max-height: 300px; font-family: 'Courier New', monospace; font-size: 11px; line-height: 1.5; color: #0f172a; }

/* ==================== API Detail Modal ==================== */

.api-summary-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.api-summary-header { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.api-method-pill { background: #e0e7ff; color: #4338ca; font-weight: 700; font-size: 11px; padding: 4px 10px; border-radius: 999px; }
.api-status-pill { font-weight: 700; font-size: 11px; padding: 4px 10px; border-radius: 999px; }
.api-status-ok { background: #dcfce7; color: #15803d; }
.api-status-error { background: #fee2e2; color: #b91c1c; }
.api-status-aborted { background: #fef3c7; color: #92400e; }
.api-duration-pill { background: #f1f5f9; color: #475569; font-weight: 600; font-size: 11px; padding: 4px 10px; border-radius: 999px; }
.api-summary-grid { display: grid; grid-template-columns: 80px 1fr; gap: 6px 12px; font-size: 12px; }
.api-summary-label { color: #64748b; font-weight: 600; }
.api-summary-value { color: #0f172a; word-break: break-word; }
.api-summary-url { font-family: 'Courier New', monospace; font-size: 11px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 6px 8px; }

/* ==================== Coffee Modal ==================== */

.coffee-modal-content {
  max-width: 420px;
}

.coffee-modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.coffee-note {
  font-size: 13px;
  color: #475569;
  text-align: center;
}

.coffee-qr-image {
  width: min(280px, 100%);
  height: auto;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

/* ==================== Responsive ==================== */

@media (max-width: 1024px) {
  .two-column { grid-template-columns: 1fr !important; overflow-y: auto !important; }
  .replay-content { grid-template-columns: 1fr; }
  .analytics-stats { grid-template-columns: repeat(2, 1fr); }
  .dashboard-body { overflow-y: auto; }
  .video-panel, .tabs-panel { min-height: 400px; }
}

@media (max-width: 640px) {
  .dashboard-header { flex-direction: column; gap: 10px; align-items: flex-start; padding: 10px 16px; }
  .header-actions { width: 100%; flex-wrap: wrap; }
  .tab-btn { padding: 10px 12px; font-size: 12px; }
  .analytics-stats { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; }
  .filter-input { min-width: 100%; }
  .import-dropzone { padding: 32px 20px; }
  .logo-title { font-size: 24px; }
  .import-support-actions { width: 100%; }
  .import-link,
  .btn.btn-coffee { width: 100%; justify-content: center; }
}
