/* ── Reset & Base ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #0f172a; color: #e2e8f0; min-height: 100vh; }

.container { max-width: 1000px; margin: 0 auto; padding: 40px 20px; }

/* ── Header ── */
.header { text-align: center; margin-bottom: 40px; }
.header h1 { font-size: 28px; font-weight: 700; color: #f8fafc; margin-bottom: 8px; }
.header p { color: #94a3b8; font-size: 15px; }

/* ── Demo Badge ── */
.demo-badge {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 16px;
  background: #92400e;
  color: #fbbf24;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid #fbbf24;
}

/* ── Drop Zone ── */
.dropzone {
  border: 2px dashed #334155; border-radius: 16px; padding: 60px 40px;
  text-align: center; cursor: pointer; transition: all 0.2s;
  background: #1e293b; margin-bottom: 24px;
}
.dropzone:hover, .dropzone.dragover { border-color: #3b82f6; background: #1e3a5f; }
.dropzone-icon { font-size: 48px; margin-bottom: 16px; }
.dropzone h3 { font-size: 18px; color: #f1f5f9; margin-bottom: 8px; }
.dropzone p { color: #64748b; font-size: 14px; }

/* ── File List ── */
.file-list { margin-bottom: 24px; }
.file-item {
  display: flex; align-items: center; justify-content: space-between;
  background: #1e293b; border-radius: 8px; padding: 10px 16px; margin-bottom: 6px;
  font-size: 14px;
}
.file-item .name { color: #e2e8f0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .size { color: #64748b; margin-left: 12px; white-space: nowrap; }
.file-item .remove { color: #ef4444; cursor: pointer; margin-left: 12px; font-size: 18px; border: none; background: none; }
.file-item .remove:hover { color: #f87171; }

/* ── Buttons ── */
.btn {
  display: inline-block; padding: 14px 32px; border-radius: 10px;
  font-size: 16px; font-weight: 600; cursor: pointer; border: none;
  transition: all 0.2s;
}
.btn-primary { background: #3b82f6; color: #fff; width: 100%; }
.btn-primary:hover { background: #2563eb; }
.btn-primary:disabled { background: #334155; color: #64748b; cursor: not-allowed; }
.btn-download { margin-top: 24px; }
.btn-secondary { background: #334155; color: #e2e8f0; margin-top: 12px; width: 100%; }
.btn-secondary:hover { background: #475569; }

/* ── Progress ── */
.progress-section { margin-bottom: 24px; }
.progress-bar-track { background: #334155; border-radius: 8px; height: 8px; overflow: hidden; margin-bottom: 12px; }
.progress-bar-fill { background: #3b82f6; height: 100%; border-radius: 8px; transition: width 0.5s ease; width: 0%; }
.progress-status { color: #94a3b8; font-size: 14px; text-align: center; }

/* ── Results ── */
.results-section { }
.score-card {
  background: #1e293b; border-radius: 16px; padding: 32px;
  text-align: center; margin-bottom: 24px;
}
.score-number { font-size: 72px; font-weight: 800; line-height: 1; margin-bottom: 8px; }
.score-number.green { color: #22c55e; }
.score-number.yellow { color: #eab308; }
.score-number.red { color: #ef4444; }
.score-label { font-size: 14px; color: #94a3b8; text-transform: uppercase; letter-spacing: 1px; }
.decision-badge {
  display: inline-block; padding: 8px 24px; border-radius: 999px;
  font-size: 18px; font-weight: 700; margin-top: 16px;
}
.decision-badge.Go { background: #052e16; color: #22c55e; border: 1px solid #22c55e; }
.decision-badge.Hold { background: #422006; color: #eab308; border: 1px solid #eab308; }
.decision-badge.No-Go { background: #450a0a; color: #ef4444; border: 1px solid #ef4444; }

.detail-card {
  background: #1e293b; border-radius: 12px; padding: 24px;
  margin-bottom: 16px;
}
.detail-card h3 { font-size: 16px; color: #3b82f6; margin-bottom: 12px; font-weight: 600; }
.detail-card p, .detail-card pre { color: #cbd5e1; font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-wrap: break-word; }

.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.meta-item { background: #0f172a; border-radius: 8px; padding: 12px; }
.meta-item .label { font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.meta-item .value { font-size: 14px; color: #e2e8f0; }

.timing { text-align: center; color: #64748b; font-size: 13px; margin-top: 24px; }

/* ── Error ── */
.error-msg { background: #450a0a; border: 1px solid #ef4444; border-radius: 8px; padding: 16px; color: #fca5a5; font-size: 14px; margin-bottom: 16px; }

/* ── API Key Section ── */
.api-key-section {
  background: #1e293b; border-radius: 16px; padding: 32px;
  text-align: center; margin-bottom: 24px;
  max-width: 500px; margin-left: auto; margin-right: auto;
}
.api-key-section h2 {
  font-size: 22px; font-weight: 700; color: #f8fafc; margin-bottom: 16px;
}
.api-key-section p {
  color: #cbd5e1; font-size: 14px; line-height: 1.7; margin-bottom: 16px;
}

.api-key-input {
  width: 100%; padding: 14px 16px; border-radius: 10px;
  border: 1px solid #334155; background: #0f172a; color: #e2e8f0;
  font-size: 15px; font-family: inherit; margin-bottom: 16px;
  transition: border-color 0.2s;
}
.api-key-input:focus {
  outline: none; border-color: #3b82f6;
}
.api-key-input::placeholder { color: #475569; }

.api-key-status {
  font-size: 14px; color: #94a3b8; margin-top: 12px;
  min-height: 20px;
}
.api-key-status.success { color: #22c55e; }
.api-key-status.error { color: #ef4444; }

.api-key-info {
  color: #94a3b8; font-size: 13px; line-height: 1.6;
  margin-bottom: 20px;
}

.api-key-badge {
  display: inline-block; background: #334155; color: #94a3b8;
  font-size: 12px; font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  padding: 4px 10px; border-radius: 6px;
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  vertical-align: middle;
}

.change-key-link {
  color: #64748b; font-size: 12px; margin-left: 8px;
  text-decoration: underline; cursor: pointer;
  transition: color 0.2s;
}
.change-key-link:hover { color: #94a3b8; }

.connecting-spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid #334155; border-top-color: #3b82f6;
  border-radius: 50%; animation: spin 0.6s linear infinite;
  vertical-align: middle; margin-right: 8px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Hidden utility ── */
.hidden { display: none; }

/* ── Security Info ── */
.security-info {
  margin-top: 24px;
  padding: 18px 22px;
  background: #1e293b;
  border-left: 3px solid #3b82f6;
  border-radius: 8px;
}
.security-info-header {
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.security-info-list {
  list-style: none;
  padding: 0;
}
.security-info-list li {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.9;
  padding-left: 18px;
  position: relative;
}
.security-info-list li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: #22c55e;
  font-weight: bold;
}

#keyBadge { margin-top: 12px; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .meta-grid { grid-template-columns: 1fr; }
  .score-number { font-size: 56px; }
  .api-key-section { padding: 24px 20px; }
}
