/**
 * CertMaster Marketing Poster Bento CSS
 * Design Spec: Linear / Apple-grade minimalist white Bento Grid, soft tint badges,
 * IBM Plex Mono figures, precise SVG & CSS Grid micro-visualizations.
 */

:root {
  --mp-bg: #f8fafc;
  --mp-card-bg: #ffffff;
  --mp-border: rgba(226, 232, 240, 0.85);
  --mp-text-main: #0f172a;
  --mp-text-muted: #475569;
  --mp-text-light: #94a3b8;
  --mp-primary: #0284c7;
  --mp-primary-hover: #0369a1;
  --mp-shadow: 0 4px 24px -4px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
  --mp-shadow-hover: 0 12px 32px -4px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.03);
}

/* Outer Wrapper & Standalone Container */
.marketing-poster-wrapper {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", "DM Sans", sans-serif;
  color: var(--mp-text-main);
  -webkit-font-smoothing: antialiased;
}

/* Top Floating Control Bar (Not exported to image) */
.mp-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--mp-border);
  padding: 10px 16px;
  border-radius: 9999px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
  margin-bottom: 28px;
  position: sticky;
  top: 16px;
  z-index: 100;
}

.mp-persona-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 9999px;
}

.mp-persona-tab {
  border: none;
  background: transparent;
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.mp-persona-tab:hover {
  color: var(--mp-text-main);
}

.mp-persona-tab.active {
  background: #ffffff;
  color: #0284c7;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.mp-control-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mp-btn-export {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  border: none;
  border-radius: 9999px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.28);
  transition: all 0.2s;
}

.mp-btn-export:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.38);
}

.mp-btn-export:active {
  transform: translateY(0);
}

.mp-btn-export.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* Poster Canvas (The area exported via html2canvas) */
.mp-canvas {
  background-color: #f8fafc;
  background-image: radial-gradient(circle at 50% 0%, rgba(2, 132, 199, 0.06) 0%, transparent 70%);
  border: 1px solid var(--mp-border);
  border-radius: 36px;
  padding: 44px 36px;
  box-shadow: 0 16px 48px -12px rgba(15, 23, 42, 0.05);
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

/* Watermark & Meta Bar in Poster */
.mp-poster-header-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.mp-brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.9);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 700;
  color: #0284c7;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
}

.mp-badge-official {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: #64748b;
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

/* Hero Section */
.mp-hero {
  text-align: center;
  max-width: 860px;
  margin: 0 auto 40px;
}

.mp-hero-title-en {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #0284c7;
  margin-bottom: 8px;
  display: block;
  font-family: "IBM Plex Mono", monospace;
}

.mp-hero-h1 {
  font-size: 38px;
  font-weight: 800;
  line-height: 1.25;
  color: #0f172a;
  letter-spacing: -0.025em;
  margin: 0 0 16px;
}

.mp-hero-desc {
  font-size: 15px;
  line-height: 1.65;
  color: #475569;
  max-width: 740px;
  margin: 0 auto 24px;
}

.mp-trust-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}

.mp-trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.85);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

/* Section Header Typography */
.mp-section-header {
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.mp-section-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mp-section-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0284c7;
  font-family: "IBM Plex Mono", monospace;
}

.mp-section-title {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.02em;
}

/* Section 1: Question Bank Matrix (Cards Grid) */
.mp-matrix-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 40px;
}

@media (max-width: 992px) {
  .mp-matrix-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .mp-matrix-grid {
    grid-template-columns: 1fr;
  }
}

.mp-bank-card {
  background: #ffffff;
  border-radius: 24px;
  border: 1px solid var(--mp-border);
  box-shadow: var(--mp-shadow);
  padding: 22px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.mp-bank-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--mp-shadow-hover);
  border-color: rgba(2, 132, 199, 0.3);
}

.mp-bank-card.dimmed {
  opacity: 0.35;
  filter: grayscale(0.5);
  transform: scale(0.98);
}

.mp-bank-card.highlighted {
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15), var(--mp-shadow-hover);
}

.mp-card-top {
  margin-bottom: 14px;
}

.mp-card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

/* Soft Tint Badges */
.mp-soft-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 9999px;
  border: 1px solid transparent;
  letter-spacing: 0.02em;
}

.mp-badge-emerald {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.mp-badge-amber {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.mp-badge-rose {
  background: #fff1f2;
  color: #be123c;
  border-color: #fecdd3;
}

.mp-badge-violet {
  background: #f5f3ff;
  color: #6d28d9;
  border-color: #ddd6fe;
}

.mp-badge-sky {
  background: #f0f9ff;
  color: #0369a1;
  border-color: #bae6fd;
}

.mp-card-metric {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  background: #f8fafc;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.mp-card-title {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 4px;
  letter-spacing: -0.015em;
}

.mp-card-subtitle {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  margin: 0 0 14px;
}

/* Contrast Pain vs Solution Block */
.mp-contrast-box {
  background: #f8fafc;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid #f1f5f9;
}

.mp-contrast-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.mp-contrast-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
  white-space: nowrap;
  letter-spacing: 0.04em;
  margin-top: 1px;
}

.mp-tag-pain {
  background: #fee2e2;
  color: #991b1b;
}

.mp-tag-solution {
  background: #dbeafe;
  color: #1e40af;
}

.mp-contrast-text {
  color: #475569;
}

.mp-contrast-text strong {
  color: #0f172a;
  font-weight: 700;
}

/* Section 2: Four Cognitive Breakthroughs (2x2 Bento Grid) */
.mp-cog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-bottom: 40px;
}

@media (max-width: 860px) {
  .mp-cog-grid {
    grid-template-columns: 1fr;
  }
}

.mp-cog-card {
  background: #ffffff;
  border-radius: 28px;
  border: 1px solid var(--mp-border);
  box-shadow: var(--mp-shadow);
  padding: 24px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.mp-cog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.mp-cog-badge-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mp-cog-title {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  margin: 6px 0 4px;
  letter-spacing: -0.015em;
}

.mp-cog-desc {
  font-size: 13px;
  line-height: 1.55;
  color: #475569;
  margin: 0 0 16px;
}

/* Visual Micro-Graph Containers */
.mp-graph-container {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 14px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  position: relative;
}

/* 1. SRS SVG Curve */
.mp-srs-svg {
  width: 100%;
  max-width: 440px;
  height: 120px;
}

.mp-graph-footnote {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 2. CBM 2x2 Matrix */
.mp-cbm-matrix {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  max-width: 440px;
}

.mp-cbm-cell {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.2s;
}

.mp-cbm-cell-danger {
  background: #fff1f2;
  border-color: #fecdd3;
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.08);
}

.mp-cbm-cell-success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.06);
}

.mp-cbm-cell-amber {
  background: #fffbeb;
  border-color: #fde68a;
}

.mp-cbm-cell-neutral {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.mp-cbm-label {
  font-size: 11px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mp-cbm-action {
  font-size: 11px;
  color: #475569;
  line-height: 1.35;
}

/* 3. Interleaving Network SVG */
.mp-interleave-svg {
  width: 100%;
  max-width: 440px;
  height: 110px;
}

/* 4. 5x7 35-day Heatmap */
.mp-heatmap-wrap {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mp-heatmap-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.mp-heat-cell {
  aspect-ratio: 1;
  border-radius: 6px;
  background: #e2e8f0;
  transition: transform 0.15s;
  position: relative;
}

.mp-heat-cell:hover {
  transform: scale(1.15);
  z-index: 2;
}

.mp-heat-lvl-0 { background: #e2e8f0; }
.mp-heat-lvl-1 { background: #bbf7d0; }
.mp-heat-lvl-2 { background: #86efac; }
.mp-heat-lvl-3 { background: #4ade80; }
.mp-heat-lvl-4 { background: #16a34a; }

.mp-heatmap-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}

/* Section 3: Dashboard Mini Preview Strip */
.mp-dash-strip {
  background: #ffffff;
  border: 1px solid var(--mp-border);
  border-radius: 20px;
  padding: 14px 20px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  box-shadow: var(--mp-shadow);
}

.mp-dash-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #334155;
  font-weight: 600;
}

.mp-dash-pill i {
  font-size: 16px;
  color: #0284c7;
}

.mp-dash-pill strong {
  font-family: "IBM Plex Mono", monospace;
  color: #0f172a;
  font-weight: 700;
}

/* Section 4: Dual CTA Conversion Card */
.mp-cta-card {
  background: #ffffff;
  border: 1px solid var(--mp-border);
  border-radius: 32px;
  padding: 36px 32px;
  text-align: center;
  box-shadow: 0 10px 30px -4px rgba(15, 23, 42, 0.05);
  position: relative;
  overflow: hidden;
}

.mp-cta-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0284c7, #38bdf8, #10b981);
}

.mp-cta-h2 {
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}

.mp-cta-p {
  font-size: 15px;
  color: #64748b;
  max-width: 600px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

.mp-cta-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
}

.mp-btn-primary-cta {
  background: #0284c7;
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 28px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 18px rgba(2, 132, 199, 0.3);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
  cursor: pointer;
}

.mp-btn-primary-cta:hover {
  background: #0369a1;
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(2, 132, 199, 0.4);
}

.mp-btn-secondary-cta {
  background: #0f172a;
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 24px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

.mp-btn-secondary-cta:hover {
  background: #1e293b;
  transform: translateY(-1px);
}

.mp-cta-foot-note {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
  margin: 0;
}

/* Footer in poster */
.mp-poster-footer {
  margin-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
  font-family: "IBM Plex Mono", monospace;
  padding-top: 14px;
  border-top: 1px dashed #e2e8f0;
}
