/* ========== CSS VARIABLES ========== */
body {
  --bg-primary: #0a0a0f;
  --bg-card: rgba(255,255,255,0.04);
  --bg-card-hover: rgba(255,255,255,0.06);
  --border-subtle: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.1);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-blue: #60a5fa;
  --accent-purple: #a78bfa;
  --accent-pink: #f472b6;
  --accent-green: #22c55e;
  --accent-red: #ef4444;
  --accent-orange: #f97316;
  --accent-yellow: #f59e0b;
  --accent-teal: #06b6d4;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

/* ========== RESET & BASE ========== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* ========== FOCUS RINGS (Accessibility) ========== */
:focus-visible {
  outline: 2px solid rgba(96,165,250,0.6);
  outline-offset: 2px;
}

.btn:focus-visible {
  outline: 2px solid rgba(96,165,250,0.6);
  outline-offset: 2px;
}

.tab:focus-visible {
  outline: 2px solid rgba(96,165,250,0.6);
  outline-offset: -2px;
}

.pill:focus-visible {
  outline: 2px solid rgba(96,165,250,0.6);
  outline-offset: 2px;
}

.card-header:focus-visible {
  outline: 2px solid rgba(96,165,250,0.6);
  outline-offset: -2px;
}

/* ========== GRADIENT TEXT ========== */
.gradient-text {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========== HEADER ========== */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-dot {
  width: 10px;
  height: 10px;
  background: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(34,197,94,0.6);
}

.header h1 {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.subtitle {
  font-size: 13px;
  color: #7c8ba0;
  font-weight: 400;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-wrapper {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 8px 12px 8px 36px;
  color: var(--text-primary);
  font-size: 14px;
  width: 220px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  font-family: inherit;
}

.search-input:focus {
  border-color: rgba(96,165,250,0.4);
  background: var(--bg-card-hover);
}

.search-input::placeholder {
  color: #475569;
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  color: #fff;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

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

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

.btn-ghost:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
}

.btn-danger {
  background: rgba(239,68,68,0.15);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.2);
}

.btn-danger:hover {
  background: rgba(239,68,68,0.25);
}

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

.btn-claude {
  background: rgba(96,165,250,0.12);
  color: var(--accent-blue);
  border: 1px solid rgba(96,165,250,0.2);
}

.btn-claude:hover {
  background: rgba(96,165,250,0.2);
}

/* ========== TABS ========== */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-md);
  padding: 4px;
}

.tab {
  flex: 1;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
}

.tab:hover {
  color: var(--text-secondary);
}

.tab.active {
  background: rgba(96,165,250,0.12);
  color: var(--accent-blue);
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--accent-blue);
  border-radius: 1px;
}

.tab-badge {
  background: rgba(255,255,255,0.08);
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.tab.active .tab-badge {
  background: rgba(96,165,250,0.2);
}

/* ========== STATS BAR ========== */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
  transition: background 0.2s;
}

.stat-card:hover {
  background: rgba(255,255,255,0.05);
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ========== FILTERS ========== */
.filters {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.section-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}

.pill {
  padding: 5px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  white-space: nowrap;
}

.pill:hover {
  background: var(--bg-card-hover);
  color: var(--text-secondary);
}

.pill.active {
  background: rgba(96,165,250,0.12);
  color: var(--accent-blue);
  border-color: rgba(96,165,250,0.2);
}

/* Section pill color dots */
.pill[data-section="AI Data Flywheel"]::before,
.pill[data-section="SaaS Tools"]::before,
.pill[data-section="AI Wrapper"]::before,
.pill[data-section="Widget / Embed"]::before,
.pill[data-section="Creative / Novel"]::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.pill[data-section="AI Data Flywheel"]::before { background: var(--accent-blue); }
.pill[data-section="SaaS Tools"]::before       { background: #10b981; }
.pill[data-section="AI Wrapper"]::before        { background: #8b5cf6; }
.pill[data-section="Widget / Embed"]::before    { background: var(--accent-teal); }
.pill[data-section="Creative / Novel"]::before  { background: var(--accent-yellow); }

/* Sort dropdown */
.sort-dropdown-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.sort-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sort-select {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 6px 32px 6px 12px;
  color: var(--accent-purple);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a78bfa' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.2s;
}

.sort-select:focus {
  border-color: rgba(167,139,250,0.4);
}

/* ========== IDEAS LIST ========== */
.ideas-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ideas-empty {
  text-align: center;
  padding: 80px 20px;
  color: #475569;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.empty-description {
  font-size: 14px;
  color: #475569;
  margin-bottom: 24px;
  line-height: 1.5;
}

.empty-action {
  display: inline-flex;
}

/* ========== SKELETON LOADING ========== */
.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.skeleton-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--border-subtle);
  flex-shrink: 0;
  animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: var(--border-subtle);
  animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-line:nth-child(1) { width: 60%; animation-delay: 0.1s; }
.skeleton-line:nth-child(2) { width: 40%; animation-delay: 0.2s; }

.skeleton-badges {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.skeleton-badge {
  width: 44px;
  height: 24px;
  border-radius: var(--radius-sm);
  background: var(--border-subtle);
  animation: shimmer 1.5s ease-in-out infinite;
  animation-delay: 0.3s;
}

@keyframes shimmer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ========== IDEA CARD ========== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  transition: background 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  animation: cardEnter 0.3s ease both;
  position: relative;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

/* Section accent colors applied to left border */
.card.accent-ai-data-flywheel    { border-left-color: var(--accent-blue); }
.card.accent-saas-tools          { border-left-color: #10b981; }
.card.accent-ai-wrapper          { border-left-color: #8b5cf6; }
.card.accent-widget-embed        { border-left-color: var(--accent-teal); }
.card.accent-creative-novel      { border-left-color: var(--accent-yellow); }
.card.accent-default             { border-left-color: rgba(255,255,255,0.1); }

/* Card entrance — staggered fade-in */
@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* In-progress pulse indicator */
.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-indicator.in-progress {
  background: var(--accent-green);
  box-shadow: 0 0 6px rgba(34,197,94,0.5);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  position: relative;
}

.card-emoji {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}

.card-info {
  flex: 1;
  min-width: 0;
}

.card-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.card-tagline {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-badges {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ========== SCORE RING ========== */
.score-ring {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.score-ring svg {
  transform: rotate(-90deg);
  width: 44px;
  height: 44px;
}

.score-ring .ring-bg {
  fill: none;
  stroke: var(--border-subtle);
  stroke-width: 4;
}

.score-ring .ring-fill {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.score-ring .ring-fill.ring-high   { stroke: url(#ring-gradient-high); }
.score-ring .ring-fill.ring-mid    { stroke: url(#ring-gradient-mid); }
.score-ring .ring-fill.ring-low    { stroke: rgba(255,255,255,0.2); }

.score-ring-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.section-tag {
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.confidence-badge {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.confidence-HIGH {
  background: rgba(34,197,94,0.15);
  color: var(--accent-green);
}

.confidence-MEDIUM-HIGH {
  background: rgba(96,165,250,0.15);
  color: var(--accent-blue);
}

.confidence-MEDIUM {
  background: rgba(245,158,11,0.15);
  color: var(--accent-yellow);
}

.confidence-LOW {
  background: rgba(239,68,68,0.15);
  color: #f87171;
}

/* Quick action buttons on card header */
.card-quick-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
  margin-left: 4px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-icon:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
}

.btn-icon svg {
  width: 16px;
  height: 16px;
}

/* Quick status dropdown */
.quick-menu {
  position: fixed;
  background: #1a1a24;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  padding: 6px;
  min-width: 180px;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: menuIn 0.15s ease;
}

@keyframes menuIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.quick-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.1s;
  text-align: left;
}

.quick-menu-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.quick-menu-item.danger {
  color: #f87171;
}

.quick-menu-item.danger:hover {
  background: rgba(239,68,68,0.1);
}

.card-chevron {
  font-size: 14px;
  color: #475569;
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: 8px;
}

.card.expanded .card-chevron {
  transform: rotate(180deg);
}

/* ========== EXPANDED CARD ========== */
.card-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.card.expanded .card-body {
  max-height: 2000px;
}

.card-body-inner {
  padding: 0 20px 20px;
  border-top: 1px solid var(--border-subtle);
}

/* Score bars */
.score-bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 16px 0;
}

.score-bar-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.score-bar-label {
  font-size: 12px;
  color: var(--text-secondary);
  width: 90px;
  text-align: right;
  flex-shrink: 0;
}

.score-bar-label::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.score-bar-item:nth-child(1) .score-bar-label::before { background: var(--accent-blue); }
.score-bar-item:nth-child(2) .score-bar-label::before { background: var(--accent-purple); }
.score-bar-item:nth-child(3) .score-bar-label::before { background: var(--accent-yellow); }
.score-bar-item:nth-child(4) .score-bar-label::before { background: var(--accent-green); }

.score-bar-track {
  flex: 1;
  height: 8px;
  background: var(--border-subtle);
  border-radius: 4px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.bar-5 { background: var(--accent-green); }
.bar-4 { background: var(--accent-blue); }
.bar-3 { background: var(--accent-yellow); }
.bar-2 { background: var(--accent-orange); }
.bar-1 { background: var(--accent-red); }
.bar-0 { background: rgba(255,255,255,0.1); }

.score-bar-value {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  width: 28px;
  flex-shrink: 0;
}

/* Detail rows */
.detail-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 0;
}

.detail-row {
  display: flex;
  gap: 12px;
}

.detail-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  width: 110px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding-top: 2px;
}

.detail-value {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.5;
  flex: 1;
}

/* Action buttons */
.card-actions {
  display: flex;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.04);
  flex-wrap: wrap;
}

/* ========== MODAL ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}

.modal-panel {
  background: #12121a;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 680px;
  padding: 0;
  animation: modalIn 0.2s ease;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 80px);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px 16px;
  flex-shrink: 0;
}

.modal-header h2 {
  font-size: 22px;
  font-weight: 800;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.modal-close:hover {
  color: var(--text-primary);
}

/* Modal tabs */
.modal-tabs {
  display: flex;
  gap: 4px;
  padding: 0 28px 16px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.modal-tab {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.modal-tab:hover {
  color: var(--text-secondary);
  background: var(--bg-card);
}

.modal-tab.active {
  background: rgba(96,165,250,0.12);
  color: var(--accent-blue);
}

/* Modal tab content */
.modal-tab-content {
  display: none;
  padding: 24px 28px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

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

/* Override form to be flex column */
#idea-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* Sticky form actions at bottom */
#idea-form .form-actions {
  padding: 16px 28px;
  border-top: 1px solid var(--border-subtle);
  background: #12121a;
  border-radius: 0 0 20px 20px;
  flex-shrink: 0;
  margin-top: 0;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.span-2 { grid-column: span 2; }
.form-group.span-3 { grid-column: span 3; }

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
  resize: vertical;
}

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

.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* Score section */
.score-section {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius-md);
  padding: 16px;
}

.score-total {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  color: var(--accent-blue);
}

.score-sliders {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slider-label {
  font-size: 13px;
  color: var(--text-secondary);
  width: 100px;
  flex-shrink: 0;
}

.slider-row input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  outline: none;
}

.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  cursor: pointer;
  border: 2px solid #12121a;
}

.slider-value {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  width: 20px;
  text-align: center;
}

/* Form actions */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

/* ========== CONFIRM DIALOG ========== */
.confirm-panel {
  background: #12121a;
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 400px;
  width: 100%;
  animation: modalIn 0.2s ease;
}

.confirm-panel h3 {
  font-size: 18px;
  font-weight: 700;
  color: #f87171;
  margin-bottom: 8px;
}

.confirm-panel p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

/* ========== KEYBOARD SHORTCUTS ========== */
.shortcuts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  text-align: left;
}

.shortcut-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shortcut-row kbd {
  display: inline-block;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 40px;
  text-align: center;
}

.shortcut-row span {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ========== TOAST — UPGRADED ========== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
}

.toast {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1a1a24;
  border: 1px solid var(--border-hover);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  animation: toastFade 3s ease forwards;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  pointer-events: auto;
  max-width: 360px;
}

.toast-icon {
  font-size: 16px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.toast-success {
  border-left: 3px solid var(--accent-green);
}

.toast-success .toast-icon {
  color: var(--accent-green);
}

.toast-error {
  border-left: 3px solid var(--accent-red);
}

.toast-error .toast-icon {
  color: var(--accent-red);
}

.toast-info {
  border-left: 3px solid var(--accent-blue);
}

.toast-info .toast-icon {
  color: var(--accent-blue);
}

@keyframes toastFade {
  0% { opacity: 0; transform: translateX(20px); }
  8% { opacity: 1; transform: translateX(0); }
  80% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(20px); }
}

/* ========== SECTION TAG COLORS ========== */
.section-ai-data-flywheel { background: rgba(96,165,250,0.15); color: var(--accent-blue); }
.section-saas-tools { background: rgba(16,185,129,0.15); color: #10b981; }
.section-ai-wrapper { background: rgba(139,92,246,0.15); color: #8b5cf6; }
.section-widget-embed { background: rgba(6,182,212,0.15); color: var(--accent-teal); }
.section-creative-novel { background: rgba(245,158,11,0.15); color: var(--accent-yellow); }
.section-default { background: rgba(255,255,255,0.08); color: var(--text-secondary); }

/* ========== RESPONSIVE ========== */
@media (max-width: 640px) {
  .container {
    padding: 16px 12px;
  }

  .header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .header-left {
    justify-content: center;
    gap: 10px;
  }

  .header h1 {
    font-size: 24px;
  }

  .header-right {
    display: flex;
    gap: 8px;
  }

  .search-input {
    flex: 1;
    width: auto;
    min-width: 0;
  }

  .btn-primary {
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Stats bar — 2x2 grid on mobile */
  .stats-bar {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .stat-card {
    padding: 10px 12px;
  }

  .stat-value {
    font-size: 18px;
  }

  /* Tabs — smaller text */
  .tab {
    font-size: 13px;
    padding: 8px 12px;
  }

  /* Filters — stack on mobile */
  .filters {
    flex-direction: column;
    gap: 8px;
  }

  .sort-dropdown-wrapper {
    align-self: flex-end;
  }

  /* Cards */
  .card-header {
    padding: 12px 16px;
    gap: 10px;
  }

  .card-emoji {
    font-size: 24px;
  }

  .card-name {
    font-size: 16px;
  }

  .card-badges {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 4px;
  }

  /* Hide confidence badge on mobile */
  .confidence-badge {
    display: none;
  }

  /* Score ring smaller on mobile */
  .score-ring {
    width: 36px;
    height: 36px;
  }

  .score-ring svg {
    width: 36px;
    height: 36px;
  }

  .score-ring-value {
    font-size: 10px;
  }

  /* Quick actions — smaller */
  .card-quick-actions {
    margin-left: 0;
  }

  .btn-icon {
    width: 28px;
    height: 28px;
  }

  /* Expanded content */
  .card-body-inner {
    padding: 0 16px 16px;
  }

  .score-bars {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .score-bar-label {
    width: 80px;
    font-size: 11px;
  }

  .detail-row {
    flex-direction: column;
    gap: 2px;
  }

  .detail-label {
    width: auto;
  }

  .card-actions {
    flex-direction: column;
  }

  .card-actions .btn {
    justify-content: center;
  }

  /* Form grid — single column */
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-group.span-2,
  .form-group.span-3 {
    grid-column: span 1;
  }

  /* Modal */
  .modal-overlay {
    padding: 20px 8px;
  }

  .modal-panel {
    border-radius: var(--radius-lg);
    max-height: calc(100vh - 40px);
  }

  .modal-header {
    padding: 16px 16px 12px;
  }

  .modal-tabs {
    padding: 0 16px 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-tab-content {
    padding: 16px;
  }

  #idea-form .form-actions {
    padding: 12px 16px;
  }

  /* Toast */
  .toast-container {
    bottom: 12px;
    right: 12px;
    left: 12px;
  }

  .toast {
    max-width: 100%;
  }

  .strategy-content {
    padding: 16px;
    max-height: calc(100vh - 120px);
  }
}

/* ========== STRATEGY MODAL ========== */
.modal-panel-wide {
  max-width: 860px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 80px);
}

.strategy-content {
  overflow-y: auto;
  padding: 0 28px 28px;
  flex: 1;
}

.strategy-loading {
  color: var(--text-muted);
  text-align: center;
  padding: 40px;
  font-size: 14px;
}

/* ========== MARKDOWN RENDERER ========== */
.md-h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 24px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.md-h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 20px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.md-h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-blue);
  margin: 16px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.md-h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 12px 0 6px;
}

.md-p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0 0 6px;
}

.md-p strong {
  color: var(--text-primary);
  font-weight: 600;
}

.md-p em {
  color: var(--accent-purple);
  font-style: italic;
}

.md-hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 20px 0;
}

.md-spacer {
  height: 6px;
}

.md-list {
  margin: 6px 0 10px 20px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}

.md-list li {
  margin-bottom: 4px;
}

.md-list strong {
  color: var(--text-primary);
}

.md-pre {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 12px 0;
  overflow-x: auto;
}

.md-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #a5f3fc;
  line-height: 1.6;
  white-space: pre;
}

.md-code-inline {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  background: rgba(255,255,255,0.06);
  color: var(--accent-blue);
  padding: 1px 6px;
  border-radius: 4px;
}

.md-table-wrap {
  overflow-x: auto;
  margin: 12px 0;
}

.md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.md-table th {
  background: rgba(96,165,250,0.08);
  color: var(--text-primary);
  font-weight: 600;
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-hover);
  white-space: nowrap;
}

.md-table td {
  color: var(--text-secondary);
  padding: 7px 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

.md-table tr:last-child td {
  border-bottom: none;
}

.md-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

/* ========== STRATEGY BUTTON ========== */
.btn-strategy {
  background: rgba(16,185,129,0.12);
  color: #10b981;
  border: 1px solid rgba(16,185,129,0.2);
}

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