/* Claude Toolkit - Shared Styles */
:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --surface-hover: #f1f3f5;
  --border: #dee2e6;
  --border-light: #e9ecef;
  --text: #212529;
  --text-muted: #6c757d;
  --text-light: #adb5bd;
  --primary: #4a6cf7;
  --primary-hover: #3b5de7;
  --primary-light: #e8edfe;
  --success: #40c057;
  --success-light: #e6fcf5;
  --warning: #fab005;
  --warning-light: #fff9db;
  --danger: #fa5252;
  --danger-light: #fff5f5;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
  --transition: 150ms ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Top Navigation */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.topbar-brand {
  font-weight: 700;
  font-size: 18px;
  color: var(--primary);
  text-decoration: none;
}

.topbar-brand:hover { opacity: 0.8; }

.topbar-nav {
  display: flex;
  gap: 4px;
  list-style: none;
}

.topbar-nav a {
  display: block;
  padding: 8px 14px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius);
  transition: all var(--transition);
}

.topbar-nav a:hover { background: var(--surface-hover); color: var(--text); }
.topbar-nav a.active { background: var(--primary-light); color: var(--primary); }

/* Main Layout */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 24px;
}

.container-wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* Page Header */
.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.page-header p {
  color: var(--text-muted);
  font-size: 16px;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}

.card + .card { margin-top: 16px; }

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Forms */
label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

label .hint {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 13px;
}

input[type="text"],
input[type="search"],
textarea,
select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition);
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

select { cursor: pointer; }

.form-row {
  margin-bottom: 16px;
}

.form-row:last-child { margin-bottom: 0; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); box-shadow: var(--shadow); }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { opacity: 0.9; }

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-outline:hover { background: var(--surface-hover); color: var(--text); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.9; }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 12px 28px; font-size: 16px; }

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* Tags / Chips */
.tag {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  background: var(--primary-light);
  color: var(--primary);
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  user-select: none;
}

.tag:hover { background: var(--primary); color: white; }
.tag.active { background: var(--primary); color: white; }
.tag-success { background: var(--success-light); color: #2b8a3e; }
.tag-warning { background: var(--warning-light); color: #e67700; }

/* Output / Preview */
.output-box {
  background: #1a1a2e;
  color: #e0e0e0;
  border-radius: var(--radius-lg);
  padding: 20px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
  position: relative;
  min-height: 100px;
  border: 1px solid #2a2a4a;
}

.output-box .copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,0.1);
  color: #ccc;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 6px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: all var(--transition);
}

.output-box .copy-btn:hover { background: rgba(255,255,255,0.2); color: white; }
.output-box .copy-btn.copied { background: var(--success); color: white; border-color: var(--success); }

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

.output-header h3 { font-size: 16px; font-weight: 600; }

.char-count {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.char-count.warning { color: var(--warning); }
.char-count.danger { color: var(--danger); }

/* Selection Grid (for choosing task types, etc) */
.selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.selection-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.selection-card:hover { border-color: var(--primary); background: var(--primary-light); }
.selection-card.selected { border-color: var(--primary); background: var(--primary-light); }

.selection-card .icon { font-size: 28px; margin-bottom: 8px; }
.selection-card .label { font-size: 14px; font-weight: 600; }
.selection-card .desc { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Collapsible sections */
.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 12px 0;
  user-select: none;
}

.collapsible-header .arrow {
  transition: transform var(--transition);
  color: var(--text-muted);
}

.collapsible-header.open .arrow { transform: rotate(90deg); }
.collapsible-body { display: none; padding-bottom: 12px; }
.collapsible-body.open { display: block; }

/* Tips / Alerts */
.tip {
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  padding: 12px 16px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 14px;
  margin: 16px 0;
  color: var(--text);
}

.tip strong { font-weight: 600; }

.alert-warning {
  background: var(--warning-light);
  border-left: 4px solid var(--warning);
  padding: 12px 16px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 14px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state .icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; color: var(--text); }
.empty-state p { font-size: 14px; }

/* Responsive */
@media (max-width: 768px) {
  .topbar { padding: 0 16px; }
  .topbar-nav a { padding: 6px 10px; font-size: 13px; }
  .container, .container-wide { padding: 20px 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .selection-grid { grid-template-columns: 1fr 1fr; }
  .page-header h1 { font-size: 22px; }
}

@media (max-width: 480px) {
  .selection-grid { grid-template-columns: 1fr; }
  .topbar-nav { gap: 0; }
}

/* Utility */
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.hidden { display: none !important; }

/* Toast notification */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateY(100px);
  opacity: 0;
  transition: all 300ms ease;
  z-index: 1000;
}

.toast.show { transform: translateY(0); opacity: 1; }

/* Template list items */
.template-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  transition: all var(--transition);
  cursor: pointer;
}

.template-item:hover { background: var(--surface-hover); border-color: var(--border); }
.template-item + .template-item { margin-top: 8px; }

.template-item .name { font-weight: 600; font-size: 15px; }
.template-item .preview { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.template-item .meta { display: flex; gap: 8px; margin-top: 8px; }
.template-item .actions { display: flex; gap: 4px; flex-shrink: 0; margin-left: 16px; }

/* Step indicators */
.steps-indicator {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
}

.step-dot {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  transition: background var(--transition);
}

.step-dot + .step-dot { margin-left: 4px; }
.step-dot.active { background: var(--primary); }
.step-dot.done { background: var(--success); }

/* Conversation planner - step cards */
.plan-step {
  display: flex;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  align-items: flex-start;
}

.plan-step + .plan-step { margin-top: 8px; }

.plan-step .step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 50%;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.plan-step .step-content { flex: 1; }
.plan-step .step-content input { margin-bottom: 8px; }

/* Drag handle */
.drag-handle {
  cursor: grab;
  color: var(--text-light);
  font-size: 18px;
  padding: 4px;
  user-select: none;
}

.drag-handle:active { cursor: grabbing; }
