/* ============================================================
   AI Context Orchestrator — Custom Styles
   ============================================================ */

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

* { box-sizing: border-box; }

body { font-family: 'Inter', sans-serif; }

/* ── Panels ─────────────────────────────────────────────── */
.panel {
  background: rgba(20, 20, 37, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 16px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 4px;
  flex-shrink: 0;
}

.panel-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(220, 226, 245, 0.5);
}

/* ── Textarea ────────────────────────────────────────────── */
.textarea {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 14px;
  color: #dce2f5;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.textarea:focus {
  border-color: rgba(96, 165, 250, 0.4);
}

.textarea::placeholder {
  color: rgba(220, 226, 245, 0.2);
}

/* ── Drop Zone ───────────────────────────────────────────── */
.drop-zone {
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  flex-shrink: 0;
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(96, 165, 250, 0.04);
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s, transform 0.1s;
}

.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secondary {
  background: rgba(255,255,255,0.05);
  color: #dce2f5;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background 0.2s;
}

.btn-secondary:hover { background: rgba(255,255,255,0.08); }
.btn-secondary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: rgba(220,226,245,0.4);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.2s;
}

.btn-ghost:hover { color: #dce2f5; border-color: rgba(255,255,255,0.15); }

.btn-green {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 7px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-green:hover { background: rgba(16, 185, 129, 0.25); }

.icon-btn {
  background: transparent;
  border: none;
  color: rgba(220,226,245,0.35);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
}

.icon-btn:hover { color: #dce2f5; background: rgba(255,255,255,0.06); }

/* ── Selects ─────────────────────────────────────────────── */
.select-sm {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 4px 8px;
  color: #93c5fd;
  font-size: 12px;
  outline: none;
  cursor: pointer;
}

.select-full {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 10px 12px;
  color: #dce2f5;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.select-full:focus { border-color: rgba(96,165,250,0.4); }

/* ── Inputs ──────────────────────────────────────────────── */
.input-full {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 10px 12px;
  color: #dce2f5;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.input-full:focus { border-color: rgba(96,165,250,0.4); }
.input-full::placeholder { color: rgba(220,226,245,0.25); }

/* ── Result Cards ────────────────────────────────────────── */
.result-card {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 12px 14px;
}

.result-card.created  { border-left: 3px solid #22c55e; }
.result-card.updated  { border-left: 3px solid #3b82f6; }
.result-card.commented { border-left: 3px solid #f59e0b; }
.result-card.error    { border-left: 3px solid #ef4444; }
.result-card.report   { border-left: 3px solid #8b5cf6; }

.result-key {
  font-size: 11px;
  font-weight: 700;
  color: #818cf8;
  margin-bottom: 3px;
  font-family: 'JetBrains Mono', monospace;
}

.result-summary {
  font-size: 13px;
  color: #dce2f5;
  font-weight: 500;
}

.result-meta {
  font-size: 11px;
  color: rgba(220,226,245,0.4);
  margin-top: 4px;
}

.result-link {
  font-size: 11px;
  font-weight: 600;
  color: #6366f1;
  text-decoration: none;
  padding: 3px 8px;
  background: rgba(99,102,241,0.1);
  border-radius: 5px;
  transition: background 0.2s;
  white-space: nowrap;
}

.result-link:hover { background: rgba(99,102,241,0.2); }

.report-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.7;
  color: #93c5fd;
  white-space: pre-wrap;
  max-height: 400px;
  overflow-y: auto;
}

/* ── Stats Bar ───────────────────────────────────────────── */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 12px;
}

.stat-item { text-align: center; }
.stat-num { font-size: 22px; font-weight: 700; }
.stat-lbl { font-size: 10px; color: rgba(220,226,245,0.4); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-created  .stat-num { color: #22c55e; }
.stat-updated  .stat-num { color: #3b82f6; }
.stat-commented .stat-num { color: #f59e0b; }
.stat-errors   .stat-num { color: #ef4444; }

/* ── Loading State ───────────────────────────────────────── */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  color: rgba(220,226,245,0.5);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(96,165,250,0.15);
  border-top-color: #60a5fa;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-time {
  font-size: 22px;
  font-weight: 700;
  color: #60a5fa;
  font-family: 'JetBrains Mono', monospace;
}

.loading-hint {
  font-size: 12px;
  text-align: center;
  max-width: 200px;
}

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}

.modal-overlay.hidden { display: none; }

.modal-card {
  background: #141425;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

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

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  background: rgba(0,0,0,0.1);
}

.settings-group { display: flex; flex-direction: column; gap: 6px; }
.settings-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(220,226,245,0.4);
}

.divider { border-top: 1px solid rgba(255,255,255,0.05); margin: 4px 0; }

/* ── Scrollbar ───────────────────────────────────────────── */
.custom-scrollbar::-webkit-scrollbar { width: 4px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
