:root {
  --bg: #0b1220;
  --panel: #0f172a;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --primary: #6366f1;
  --primary-900: #4f46e5;
  --ring: #cbd5e1;
  --card: #0b1220;
  --card-border: #1f2937;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: #ffffff; /* page now white */
  color: #0f172a;      /* dark content text */
  font: 14px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica Neue, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

/* Top bar removed (title lives in sidebar) */

/* Layout */
.layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; align-self: start;
  height: 100vh;
  background: var(--panel);
  border-right: 1px solid rgba(226,232,240,0.08);
  transition: width .2s ease;
}
.layout.collapsed { grid-template-columns: 64px 1fr; }
.sidebar.collapsed { width: 64px; }
.sidebar-header { position: relative; display:flex; align-items:center; justify-content:center; text-align:center; height: 56px; padding: 0 8px; font-weight: 600; letter-spacing: .2px; color: var(--text); }
.sidebar-brand { position:absolute; left:8px; right:8px; text-align:center; pointer-events:none; }
.sidebar-brand { color: var(--text); font-weight: 700; z-index: 1; }
.nav { display: flex; flex-direction: column; padding: 12px; gap: 6px; }
.nav-link { color: var(--text); text-decoration: none; padding: 8px 10px; border-radius: 8px; }
.nav-link:hover { background: rgba(148,163,184,.08); }
.layout.collapsed .nav-link .label { display: none; }

/* Edge toggle button */
.edge-btn { position:absolute; right:-1px; top:50%; transform: translateY(-50%); z-index:60;
  width:28px; height:28px; display:inline-flex; align-items:center; justify-content:center;
  background: var(--panel); color: var(--text); border:1px solid var(--ring); border-radius:9999px;
  box-shadow: 0 2px 8px rgba(0,0,0,.3); cursor: pointer; }
.layout.collapsed .nav-link .label { display:none; }
.layout.collapsed .nav-link svg { margin-right: 0 !important; }

.main { padding: 20px; background: #ffffff; max-width: 100%; overflow-x: hidden; }

/* Welcome page */
.welcome-wrap { display: flex; align-items: center; justify-content: center; padding: 40px 16px; }
.welcome-hero {
  max-width: 720px;
  width: 100%;
  text-align: center;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(2,6,23,.08);
  position: relative;            /* for animated border */
  overflow: hidden;
}
.welcome-hero h2 {
  margin: 0 0 8px 0;
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(90deg, #7c3aed, #3b82f6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.welcome-hero p { margin: 0; color: #0f172a; opacity: .9; }
.welcome-hero .accent {
  color: #7c3aed;         /* vivid purple */
  font-weight: 800;       /* bold to match emphasis */
}

/* Fancy animated gradient ring around the card */
.welcome-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 2px;                       /* ring thickness */
  border-radius: inherit;
  /* Animated colour sweep along the frame (no rotation) */
  background: linear-gradient(90deg, #7c3aed, #06b6d4, #3b82f6, #ec4899, #7c3aed);
  background-size: 400% 100%;
  -webkit-mask: 
    linear-gradient(#000 0 0) content-box, 
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: .7;                        /* subtle glow on the border */
  will-change: background-position;
  animation: moveBorder 6s linear infinite;
}
/* Remove background glow/animation */
.welcome-hero::after { content: none; }

@keyframes moveBorder {
  0%   { background-position:   0% 50%; }
  100% { background-position: 200% 50%; }
}

/* Buttons */
.btn { cursor: pointer; border: 1px solid var(--ring); background: transparent; color: var(--text); border-radius: 10px; padding: 8px 12px; display:inline-flex; align-items:center; height:40px; }
.btn:hover { background: rgba(148,163,184,.08); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-900); }
.btn:disabled, .btn[disabled] { opacity: .6; cursor: not-allowed; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-block { width: 100%; }

/* Inputs */
.input { width: 100%; background: #ffffff; color: #0f172a; border: 1px solid #cbd5e1; border-radius: 10px; padding: 8px 10px; font: inherit; }
.select { width: 100%; background: #ffffff; color: #0f172a; border: 1px solid #cbd5e1; border-radius: 10px; padding: 8px 10px; font: inherit; }
/* Input group with inline action button (e.g., Pull BTC) */
.input-group { position: relative; } /* legacy - unused now */
.btc-url-input { width: 420px; max-width: 100%; flex: 0 0 420px; }
.btc-url-row { margin-bottom: 14px; gap: 12px; flex-wrap: nowrap; }
/* Seasonal Events controls - keep single line and compact selects */
.events-controls { flex-wrap: nowrap; }
.events-controls label { white-space: nowrap; }
.events-controls .select { width: auto; min-width: 140px; }
.toolbar.ai-controls { flex-wrap: nowrap; }
.toolbar.ai-controls label { white-space: nowrap; margin-right: 4px; }
.toolbar.ai-controls .select { display: inline-block; width: auto !important; min-width: 180px; }

/* Articles controls - single line, compact inputs */
.articles-controls { flex-wrap: nowrap; }
.articles-controls label { white-space: nowrap; margin-right: 4px; }
.articles-controls .select { width: auto; min-width: 180px; }
.articles-controls .input { width: auto; min-width: 220px; }

/* Cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; }
/* AISearch - single column stacked cards (force) */
.ai-stack { display: flex !important; flex-direction: column !important; gap: 12px !important; }
.ai-stack > .card { width: 100% !important; max-width: none !important; }

/* AISearch - explicit grid rows on wide screens */
.ai-rows { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card.full { grid-column: 1 / -1; }
.hidden { display: none !important; }
.card { background: #ffffff; border: 1px solid #e5e7eb; border-radius: 14px; padding: 14px; }
.card h3 { margin: 0 0 6px 0; font-size: 16px; }
.card p { margin: 0; color: #475569; }

/* Section header */
.section {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 16px;
}
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row .grow { flex: 1 1 auto; }

/* Badges and toolbar helpers */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  color: #0f172a;
  border-radius: 9999px;
  font-size: 12px;
}
.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9999px;
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
  font-size: 12px;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 10px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  color: #0f172a;
}
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar .spacer { flex: 1 1 auto; }
.card > .toolbar { margin-bottom: 12px; }
.search-row { flex-wrap: nowrap; margin-top: 24px; }
.search-row .input { width: 380px; }
.export-row { margin-top: 18px; }
.checkbox { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.btn-outline { background:#ffffff; color:#0f172a; border:1px solid #cbd5e1; }
.btn-outline:hover { background:#f8fafc; }
.label-required::after { content: " *"; color: #ef4444; }
.card .card-header { display:flex; align-items:center; justify-content:space-between; gap:10px; cursor:pointer; }
.card .card-title { margin:0; font-size:16px; }
.editor-tools { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-bottom:8px; }
.editor-tools .input { width:220px; }
.card .card-actions { display:flex; align-items:center; gap:8px; }
.card .card-body { margin-top:8px; display:none; }
.card.expanded .card-body { display:block; }
.muted { color:#64748b; font-size:13px; }

/* Add extra spacing between sub-card titles and their controls in visuals split */
.split-2 .card .card-title { margin: 0 0 16px 0; }
.split-2 .card .toolbar:first-of-type { margin-top: 4px; }

/* Page hero header */
.page-hero {
  background: linear-gradient(135deg, #7c3aed, #3b82f6);
  color: #ffffff;
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: 0 8px 20px rgba(2,6,23,.12);
}
.page-hero h1 {
  margin: 0 0 6px 0;
  font-size: 20px;
  font-weight: 700;
}
.page-hero p {
  margin: 0;
  font-size: 13px;
  opacity: .95;
}

/* Modal */
.modal.hidden { display: none; }
.modal { position: fixed; inset: 0; display: grid; place-items: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(2,6,23,0.6); }
.modal-card { position: relative; width: min(720px, 92vw); background: var(--panel); border: 1px solid rgba(226,232,240,.12); border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.modal-header, .modal-footer { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid rgba(226,232,240,.08); }
.modal-footer { border-top: 1px solid rgba(226,232,240,.08); border-bottom: none; }
.modal-title { margin: 0; font-size: 16px; }
.modal-body { padding: 14px; color: var(--text); }

/* Responsive */
@media (max-width: 920px) {
  .layout { grid-template-columns: 64px 1fr; }
  .sidebar { width: 64px; }
  .split-2 { grid-template-columns: 1fr; }
}

/* Two-column split inside a card (e.g., visuals) */
.split-2 { display:grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tone-style .tone-style-col { display:flex; flex-direction: column; gap: 8px; }
.tone-style .tone-style-col .select { width: 100%; }

/* Three-column form layout for MC Ads inputs */
.three-col { display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:12px; align-items:end; }
.frame-block { margin-bottom: 14px; }
.form-field label { display:block; margin:0 0 4px 0; white-space:nowrap; }
.form-field .select, .form-field .input { width:100%; }
@media (max-width: 1024px) {
  .three-col { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 720px) {
  .three-col { grid-template-columns: 1fr; }
}

/* Extra mobile responsiveness */
@media (max-width: 720px) {
  .toolbar.ai-controls,
  .articles-controls,
  .btc-url-row { flex-wrap: wrap; }
  .toolbar.ai-controls .select,
  .articles-controls .select,
  .articles-controls .input { width: 100% !important; min-width: 0; }
  .btc-url-input { flex: 1 1 100%; width: 100%; }
  .btc-url-row .btn { margin-top: 8px; }
}
.split-2 .card .toolbar { margin-bottom: 10px; }

/* Tabs */
.tabs { display:none !important; gap:8px; margin-bottom:10px; }
.tabs .tab { border:1px solid #cbd5e1; background:#ffffff; color:#0f172a; border-radius:9999px; padding:6px 12px; cursor:pointer; }
.tabs .tab.active { background:#eef2ff; border-color:#c7d2fe; color:#3730a3; }

/* Event Cards - API Response Display */
.card-grid:has(.event-card) {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.event-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}
.event-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  cursor: pointer;
  transition: background 0.15s;
}
.event-card-header:hover {
  background: #f9fafb;
}
.event-card-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.event-card-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}
.event-card-country {
  display: inline-block;
  background: #e0f2fe;
  color: #0369a1;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}
.event-card-date {
  background: #dcfce7;
  color: #166534;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.event-card-category {
  display: inline-block;
  background: #ede9fe;
  color: #6d28d9;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}
.event-card-chevron {
  font-size: 18px;
  color: #9ca3af;
  transition: transform 0.2s;
}
.event-card.expanded .event-card-chevron {
  transform: rotate(180deg);
}
.event-card-body {
  display: none;
  padding: 0 20px 20px 20px;
  border-top: 1px solid #e5e7eb;
}
.event-card.expanded .event-card-body {
  display: block;
}
.event-card-description {
  color: #475569;
  font-size: 14px;
  line-height: 1.6;
  margin: 16px 0;
}
.event-card-section {
  margin-bottom: 16px;
}
.event-card-section:last-child {
  margin-bottom: 0;
}
.event-card-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.event-card-section-title::before {
  content: "•";
  color: #a855f7;
}
.event-card-relevance {
  background: #faf5ff;
  border-left: 4px solid #a855f7;
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  color: #475569;
  font-size: 14px;
  line-height: 1.6;
}
.event-card-best-practices {
  padding-left: 20px;
  margin: 0;
  color: #475569;
  font-size: 14px;
  line-height: 1.8;
}
.event-card-best-practices li {
  margin-bottom: 4px;
}
.event-card-suggestions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.event-card-suggestion {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.event-card-suggestion-label {
  min-width: 70px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  flex-shrink: 0;
}
.event-card-suggestion-label.h1 { background: #dbeafe; color: #1d4ed8; }
.event-card-suggestion-label.dh1 { background: #d1fae5; color: #047857; }
.event-card-suggestion-label.h2 { background: #fef3c7; color: #b45309; }
.event-card-suggestion-label.article { background: #f3e8ff; color: #7c3aed; }
.event-card-suggestion-label.btc { background: #fce7f3; color: #be185d; }
.event-card-suggestion-label.ribbon { background: #e0e7ff; color: #4338ca; }
.event-card-suggestion-text {
  color: #374151;
  font-size: 14px;
  line-height: 1.5;
}

/* Vertical selector buttons within event cards */
.event-card-verticals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}
.event-card-vertical-btn {
  padding: 6px 14px;
  border: 1px solid #d1d5db;
  border-radius: 9999px;
  background: #ffffff;
  color: #374151;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.event-card-vertical-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}
.event-card-vertical-btn.active {
  background: #ede9fe;
  border-color: #a78bfa;
  color: #6d28d9;
  font-weight: 600;
}


