/* MOXIE AI Insights — Design System */

@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&family=Barlow+Condensed:wght@700;800;900&family=Permanent+Marker&display=swap');

/* ── Tokens ── */
:root {
  --blue: #1D80DE;
  --blue-light: rgba(29, 128, 222, 0.06);
  --blue-border: rgba(29, 128, 222, 0.25);
  --orange: #DF6229;
  --orange-light: rgba(223, 98, 41, 0.06);
  --orange-border: rgba(223, 98, 41, 0.25);
  --green: #27AE60;
  --green-light: rgba(39, 174, 96, 0.06);
  --white: #FFFFFF;
  --bg-card: #F8F9FA;
  --border: #E5E7EB;
  --text: #1A1A2E;
  --text-muted: #6B7280;
  --container: 1100px;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Barlow', sans-serif;
  --font-heading: 'Barlow Condensed', sans-serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.container { max-width: var(--container); margin: 0 auto; padding: 0 40px; }
@media (max-width: 768px) { .container { padding: 0 20px; } }

/* ── Password Gate Overlay ── */
.gate-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: var(--white);
}
.gate-box {
  text-align: center; max-width: 380px; width: 100%; padding: 0 20px;
}
.gate-box h1 {
  font-family: var(--font-heading);
  font-weight: 900; font-size: 2rem;
  color: var(--blue); margin-bottom: 8px;
}
.gate-box p {
  color: var(--text-muted); margin-bottom: 24px; font-size: 0.95rem;
}
.gate-box input {
  width: 100%; padding: 14px 16px; font-size: 1.1rem;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  text-align: center; font-family: var(--font);
  outline: none; transition: border-color 0.2s;
  letter-spacing: 6px;
}
.gate-box input:focus { border-color: var(--blue); }
.gate-box .gate-error {
  color: var(--orange); font-size: 0.85rem;
  margin-top: 12px; display: none;
}

/* ── Landing Page ── */
.landing {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
}
.landing-box {
  text-align: center; max-width: 480px; width: 100%; padding: 0 20px;
}
.landing-box .brand {
  font-family: var(--font-heading); font-weight: 900; font-size: 2.5rem;
  color: var(--blue); margin-bottom: 4px;
}
.landing-box .tagline {
  color: var(--text-muted); margin-bottom: 32px; font-size: 1rem;
}
.landing-box input {
  width: 100%; padding: 16px; font-size: 1.15rem;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  text-align: center; font-family: var(--font);
  outline: none; transition: border-color 0.2s;
  letter-spacing: 2px; margin-bottom: 16px;
}
.landing-box input:focus { border-color: var(--blue); }
.landing-box button {
  width: 100%; padding: 16px; font-size: 1.1rem; font-weight: 600;
  background: var(--orange); color: var(--white); border: none;
  border-radius: var(--radius-sm); cursor: pointer;
  font-family: var(--font); transition: background 0.2s;
}
.landing-box button:hover { background: #c9541f; }
.landing-box .error-msg {
  color: var(--orange); font-size: 0.85rem;
  margin-top: 12px; display: none;
}

/* ── Report Header ── */
.report-header {
  border-top: 4px solid var(--blue);
  padding: 40px 0 32px;
  display: grid; grid-template-columns: 1fr auto;
  align-items: start; gap: 24px;
}
.report-header .eyebrow {
  font-size: 0.8rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--blue); margin-bottom: 4px;
}
.report-header h1 {
  font-family: var(--font-heading); font-weight: 900;
  font-size: 3rem; line-height: 1.1; margin-bottom: 6px;
}
.report-header .client-name {
  font-size: 1.15rem; color: var(--text-muted);
}
.report-header .branding {
  text-align: right; font-size: 0.85rem; color: var(--text-muted);
  white-space: nowrap;
}
.report-header .branding strong { color: var(--text); }
@media (max-width: 768px) {
  .report-header { grid-template-columns: 1fr; }
  .report-header h1 { font-size: 2rem; }
  .report-header .branding { text-align: left; }
}

/* ── Breadcrumb ── */
.breadcrumb {
  font-size: 0.85rem; color: var(--text-muted);
  padding-bottom: 24px; border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.breadcrumb a { color: var(--blue); }

/* ── Section Labels ── */
.section-label {
  font-family: var(--font-heading); font-weight: 800;
  font-size: 1.4rem; margin-bottom: 16px; color: var(--text);
}

/* ── TL;DR Summary Card ── */
.moxie-analysis-label {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Permanent Marker', cursive; font-size: 1.4rem; color: var(--blue);
  margin-bottom: 12px;
}
.moxie-analysis-label img { width: 36px; height: 36px; }
.summary-card {
  background: var(--blue-light);
  border-left: 4px solid var(--blue);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 24px 28px; margin-bottom: 40px;
}
.summary-card p { font-size: 1.05rem; line-height: 1.7; }

/* ── At-a-Glance Metrics ── */
.metrics-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 40px;
}
.metric-card {
  background: var(--bg-card); border-radius: var(--radius);
  padding: 20px; text-align: center;
  border: 1px solid var(--border);
}
.metric-card .accent {
  height: 3px; border-radius: 2px;
  margin: 0 auto 14px; width: 40px;
}
.metric-card .accent.blue { background: var(--blue); }
.metric-card .accent.green { background: var(--green); }
.metric-card .accent.orange { background: var(--orange); }
.metric-card .value {
  font-family: var(--font-heading); font-weight: 900;
  font-size: 2rem; line-height: 1.1; margin-bottom: 4px;
}
.metric-card .label {
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-muted);
}
@media (max-width: 768px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Platform Cards ── */
.platform-card {
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border); margin-bottom: 20px;
  overflow: hidden;
}
.platform-card .platform-header {
  padding: 14px 20px; font-weight: 700; font-size: 1rem;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border);
}
.platform-card .platform-header .icon {
  width: 24px; height: 24px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 800; color: var(--white);
}
.platform-card .platform-header .icon.fb { background: #1877F2; }
.platform-card .platform-header .icon.li { background: #0A66C2; }
.platform-card .platform-header .icon.gd { background: #34A853; }
.platform-card .platform-header .icon.gs { background: #EA4335; }
.platform-card .metric-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px; font-size: 0.95rem;
}
.platform-card .metric-row:not(:last-child) {
  border-bottom: 1px solid var(--border);
}
.platform-card .metric-row .metric-label { color: var(--text-muted); }
.platform-card .metric-row .metric-value { font-weight: 600; }

/* ── Service Pills ── */
.services-grid {
  display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 40px;
}
.service-pill {
  background: var(--blue); color: var(--white);
  padding: 8px 18px; border-radius: 20px;
  font-size: 0.9rem; font-weight: 500;
}

/* ── Opportunity Cards ── */
.opportunity-card {
  background: var(--orange-light);
  border-left: 4px solid var(--orange);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 20px 24px; margin-bottom: 16px;
}
.opportunity-card h4 {
  font-weight: 700; margin-bottom: 6px; color: var(--orange);
}
.opportunity-card p { font-size: 0.95rem; line-height: 1.6; }

/* ── Director Notes ── */
.notes-section {
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 20px 24px;
  margin-bottom: 20px;
}
.notes-section h4 {
  font-weight: 700; font-size: 0.9rem; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-muted); margin-bottom: 8px;
}
.notes-section p { font-size: 0.95rem; line-height: 1.6; }

/* ── Footer ── */
.report-footer {
  text-align: center; padding: 40px 0 32px;
  border-top: 1px solid var(--border); margin-top: 40px;
  font-size: 0.85rem; color: var(--text-muted);
}
.report-footer .footer-logo { display: block; margin: 0 auto 6px; height: 32px; }
.report-footer .powered-by { display: block; margin-bottom: 4px; font-size: 0.75rem; color: var(--text-muted); }

/* ── Client Dashboard (report listing) ── */
.dashboard-header {
  border-top: 4px solid var(--blue);
  padding: 40px 0 8px;
}
.dashboard-header .brand {
  font-family: var(--font-heading); font-weight: 900;
  font-size: 2rem; color: var(--blue); margin-bottom: 4px;
}
.dashboard-header .client-name {
  font-size: 1.3rem; color: var(--text); margin-bottom: 4px;
}
.dashboard-header .back-link {
  font-size: 0.85rem; color: var(--text-muted);
}

/* ── Trends Summary (dashboard) ── */
.dashboard-hero {
  display: flex; align-items: center; gap: 24px;
  padding: 24px 0 12px;
}
.dashboard-hero .hero-mascot { width: 120px; height: 120px; flex-shrink: 0; }
.trends-summary {
  flex: 1;
  max-width: 500px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 20px;
}
.trends-summary .trends-title {
  font-family: 'Permanent Marker', cursive; font-size: 1rem;
  color: var(--blue); margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.trends-summary .trends-title img { width: 20px; height: 20px; }
.trend-item {
  display: flex; align-items: center; gap: 10px;
  padding: 3px 0; font-size: 0.8rem;
}
.trend-item .trend-label { color: var(--text-muted); font-weight: 500; min-width: 100px; }
.trend-item .trend-val { font-weight: 700; color: var(--text); font-family: var(--font-heading); font-size: 0.95rem; }
.trend-item .trend-badge {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px 8px; border-radius: 10px;
  font-size: 0.7rem; font-weight: 700;
}
.trend-item .trend-badge.up { background: rgba(39,174,96,0.1); color: var(--green); }
.trend-item .trend-badge.strong { background: var(--blue-light); color: var(--blue); }
@media (max-width: 600px) {
  .dashboard-hero { flex-direction: column; align-items: flex-start; margin-top: 16px; }
  .dashboard-hero .hero-mascot { width: 80px; height: 80px; }
}

.reports-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px; padding: 24px 0 60px;
}
.report-card {
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 24px;
  text-align: center; transition: box-shadow 0.2s;
}
.report-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.report-card .month {
  font-family: var(--font-heading); font-weight: 900;
  font-size: 1.6rem; line-height: 1.2; margin-bottom: 8px;
}
.report-card .year-badge {
  display: inline-block; padding: 2px 12px; border-radius: 10px;
  font-size: 0.75rem; font-weight: 700; margin-bottom: 14px;
  background: var(--blue-light); color: var(--blue);
}
.report-card a {
  display: inline-block; font-weight: 600; font-size: 0.9rem;
  color: var(--blue);
}

/* ── Performance Scorecard ── */
.perf-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px; margin-bottom: 40px;
}
.perf-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 18px;
}
.perf-card .perf-label {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 6px;
}
.perf-card .perf-value {
  font-family: var(--font-heading); font-weight: 900;
  font-size: 1.6rem; line-height: 1.1; margin-bottom: 8px;
}
.perf-card .perf-bar {
  height: 6px; background: var(--bg-card); border-radius: 3px;
  overflow: hidden;
}
.perf-card .perf-bar .perf-fill {
  height: 100%; border-radius: 3px; transition: width 0.6s ease;
}
.perf-card .perf-bar .perf-fill.blue { background: var(--blue); }
.perf-card .perf-bar .perf-fill.green { background: var(--green); }
.perf-card .perf-bar .perf-fill.orange { background: var(--orange); }
.perf-card .perf-trend {
  font-size: 0.7rem; font-weight: 600; margin-top: 6px;
}
.perf-card .perf-trend.up { color: var(--green); }
.perf-card .perf-trend.steady { color: var(--blue); }
@media (max-width: 600px) {
  .perf-grid { grid-template-columns: 1fr 1fr; }
}

/* ── MOXIE Chat Widget ── */
.moxie-chat-btn {
  position: fixed; bottom: 24px; right: 24px; z-index: 9998;
  background: var(--blue); box-shadow: 0 4px 16px rgba(29,128,222,0.4);
  cursor: pointer; display: flex; align-items: center; gap: 10px;
  padding: 12px 20px 12px 14px; border-radius: 30px;
  transition: transform 0.2s, box-shadow 0.2s;
  color: #fff; font-family: 'Permanent Marker', cursive; font-size: 0.95rem;
}
.moxie-chat-btn:hover { transform: scale(1.05); box-shadow: 0 6px 24px rgba(29,128,222,0.5); }
.moxie-chat-btn img { width: 36px; height: 36px; border-radius: 50%; }

.moxie-chat-panel {
  position: fixed; bottom: 96px; right: 24px; z-index: 9998;
  width: 380px; height: 500px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  flex-direction: column; overflow: hidden;
}
.moxie-chat-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; background: var(--blue); color: #fff;
  font-weight: 700; font-size: 1rem;
  font-family: 'Permanent Marker', cursive;
}
.moxie-chat-header img { width: 28px; height: 28px; border-radius: 50%; }
.moxie-chat-header span { flex: 1; }
.moxie-chat-close {
  background: none; border: none; color: #fff; font-size: 1.4rem;
  cursor: pointer; padding: 0; line-height: 1; opacity: 0.8;
}
.moxie-chat-close:hover { opacity: 1; }

.moxie-chat-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.moxie-msg {
  max-width: 90%; padding: 10px 14px; border-radius: 12px;
  font-size: 0.85rem; line-height: 1.5;
}
.moxie-msg.bot {
  background: var(--bg-card); border: 1px solid var(--border);
  align-self: flex-start; border-bottom-left-radius: 4px;
}
.moxie-msg.user {
  background: var(--blue); color: #fff;
  align-self: flex-end; border-bottom-right-radius: 4px;
}
.moxie-msg em { color: var(--blue); font-style: italic; }
.moxie-msg.bot em { cursor: pointer; }

.moxie-chat-input-bar {
  display: flex; gap: 8px; padding: 12px;
  border-top: 1px solid var(--border); background: var(--white);
}
.moxie-chat-input-bar input {
  flex: 1; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 14px; font-size: 16px; font-family: 'Barlow', sans-serif;
  outline: none;
}
.moxie-chat-input-bar input:focus { border-color: var(--blue); }
.moxie-chat-input-bar button {
  background: var(--blue); color: #fff; border: none;
  border-radius: 8px; padding: 10px 14px; cursor: pointer;
  font-size: 1rem; transition: background 0.2s;
}
.moxie-chat-input-bar button:hover { background: #1565c0; }

@media (max-width: 600px) {
  .moxie-chat-panel {
    width: calc(100% - 32px); right: 16px; left: 16px; bottom: 80px;
    height: 55vh; border-radius: 12px;
  }
  .moxie-chat-btn { bottom: 16px; right: 16px; padding: 10px 16px 10px 10px; font-size: 0.85rem; }
  .moxie-chat-btn img { width: 32px; height: 32px; }
}

/* ── Trend Indicators ── */
.trend {
  font-size: 0.75rem; font-weight: 600; margin-top: 4px;
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 10px;
}
.trend.up {
  color: var(--green); background: var(--green-light);
}
.trend.down {
  color: var(--orange); background: var(--orange-light);
}
.trend .arrow { font-size: 0.9rem; }

/* ── Budget Utilization Bar ── */
.budget-util {
  display: flex; align-items: center; gap: 10px; padding: 10px 20px;
  border-top: 1px solid var(--border);
}
.budget-util .util-label {
  font-size: 0.8rem; color: var(--text-muted); min-width: 60px;
}
.budget-util .util-track {
  flex: 1; height: 10px; background: #E8ECF0;
  border-radius: 5px; overflow: hidden;
}
.budget-util .util-fill {
  height: 100%; border-radius: 5px;
  background: linear-gradient(90deg, var(--blue), var(--green));
}
.budget-util .util-pct {
  font-size: 0.8rem; font-weight: 700; color: var(--text); min-width: 40px;
}

/* ── Activity Log ── */
.activity-list {
  margin-bottom: 40px;
}
.activity-list ul {
  list-style: none; padding: 0;
}
.activity-list li {
  padding: 12px 16px; font-size: 0.95rem; line-height: 1.5;
  border-left: 3px solid var(--blue);
  background: var(--bg-card);
  margin-bottom: 8px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  display: flex; align-items: flex-start; gap: 10px;
}
.activity-list li .activity-icon {
  flex-shrink: 0; width: 20px; height: 20px;
  color: var(--blue); font-size: 0.85rem; margin-top: 2px;
}
.activity-list li:nth-child(3n+2) { border-left-color: var(--green); }
.activity-list li:nth-child(3n+2) .activity-icon { color: var(--green); }
.activity-list li:nth-child(3n) { border-left-color: var(--orange); }
.activity-list li:nth-child(3n) .activity-icon { color: var(--orange); }
