:root {
  --brand-red: #E10600;
  --brand-orange: #FF8C00;
  --bg-white: #FFFFFF;
  --text-dark: #333333;
  --agent-blue: #005BBB;
  --agent-green: #ACE1AF; /* Updated to Celadon */ 
  --agent-purple: #635FC7;
}

/* RESET */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body, html {
  height: 100%;
  background: #f5f5f5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* DEVICE FRAME */
.device-frame {
  width: 375px;
  height: 667px;
  margin: 2vh auto;
  padding: 8px;
  border: 2px solid #000;
  border-radius: 30px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  background: var(--bg-white);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* MOBILE CONTAINER */
.mobile-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* HEADER */
.app-header {
  position: relative;
  text-align: center;
  padding: .5rem 1rem;
  background: var(--bg-white);
  flex-shrink: 0;
}
.banner-img {
  width: 155%;
  margin-bottom: .5rem;
}
.menu-btn, .bell-btn {
  position: absolute;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
}
.menu-btn { top: .5rem; left: .5rem; }
.bell-btn { top: .5rem; right: 4.5rem; }
.avatar-circle {
  position: absolute;
  top: .5rem;
  right: .5rem;
  width: 34px;
  height: 34px;
  background: var(--brand-red);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  font-weight: bold;
}
.header-title {
  margin-top: .25rem;
  font-size: 1.1rem;
  color: var(--brand-red);
}

/* STEPPER */
.stepper {
  display: flex;
  padding: .5rem 1rem;
  gap: .4rem;
  background: #fafafa;
  flex-shrink: 0;
}
.step {
  flex: 1;
  height: .4rem;
  background: #ddd;
  border-radius: .2rem;
  transition: background .3s;
}
.step.completed { background: var(--brand-orange); }
.step.active    { background: var(--brand-red); }

/* WIZARD / LOGIN CONTAINER */
.wizard-container {
  flex: 1;
  overflow-y: auto;
  padding: .75rem 1rem;
  position: relative;
}

/* CONTROLS BAR */
.controls-container {
  display: flex;
  justify-content: space-between;
  padding: .5rem 1rem;
  background: var(--bg-white);
  flex-shrink: 0;
}

/* LOGIN CARD */
.login-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  margin: 2rem 0;
}
.login-card input {
  padding: .6rem .8rem;
  border: 1px solid #ccc;
  border-radius: .5rem;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  font-size: .95rem;
  font-weight: 600;
}
.login-card .card-btn {
  background: var(--brand-red);
  color: #fff;
  padding: .75rem;
  border: none;
  border-radius: .5rem;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: background .3s;
}
.login-card .card-btn:hover {
  background: var(--brand-orange);
}

/* BACK BUTTON (card style) */
.back-btn {
  background: #eee;
  padding: .6rem 1rem;
  border-radius: .5rem;
  cursor: pointer;
  transition: background .2s;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  font-weight: 700;
  text-align: center;
}
.back-btn:hover { background: #ddd; }


/* … your existing CSS above … */

/* === NEW: apply Open Sans to pitch, Q&A and suggestions === */
.result-content,
.suggestions .card,
.answer-card {
  font-family: 'Open Sans', sans-serif;
}

/* === NEW: Tab wrapper + Expand “+” button styling === */
.tab-buttons {
  display: flex;
  gap: .5rem;
  margin-bottom: .5rem;
}
.tab-buttons .tab-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
}
.tab-buttons .tab-button {
  flex: 1;
  padding: .5rem;
  background: #fafafa;
  border: none;
  border-radius: .5rem .5rem 0 0;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-dark);
}
.tab-buttons .tab-button.active {
  background: var(--brand-red);
  color: #fff;
}

/* The little 3D + button next to each tab */
.tab-buttons .tab-expand-button {
  flex: 0 0 10%;
  margin-left: .25rem;
  background: var(--bg-white);
  border: 1px solid #ccc;
  border-radius: .5rem .5rem 0 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.tab-buttons .tab-expand-button:hover {
  background: #f0f0f0;
}

/* Hide old suggestions area (we removed it in JS) */
.suggestions-header,
.suggestions {
  display: none !important;
}

/* Controls bar (Download + New Pitch) sits outside of tab content */
.controls-container {
  display: flex;
  justify-content: space-between;
  padding: .5rem 1rem;
  background: var(--bg-white);
  flex-shrink: 0;
}

/* … rest of your existing CSS … */





/* QUESTION GROUP & CARDS */
.question-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}
.card {
  background: var(--bg-white);
  border: 1px solid #ccc;
  border-radius: .75rem;
  padding: 1rem;
  transition: background .3s, border-color .3s;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  font-weight: 600;
  color: var(--text-dark);
}
.card:hover { background: #fff7f2; }

/* SELECTED STATE FOR INDIVIDUAL CARD */
.card.selected {
  background: var(--agent-green) !important;
  border-color: var(--agent-green) !important;
  color: var(--text-dark) !important;
}

.question {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: .5rem;
}
.option-cards {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.option-cards .card {
  padding: .75rem;
  font-size: .95rem;
}

/* GENERATE BUTTON OVERLAY */
.generate-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  display: flex;
  justify-content: center;
  width: 100%;
}
.primary-btn {
  background: var(--brand-red);
  color: #fff;
  padding: .75rem;
  border: none;
  border-radius: .5rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background .3s;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  font-weight: 700;
}
.primary-btn:hover { background: var(--brand-orange); }

/* NEW PITCH BUTTON */
.new-pitch-btn {
  background: #eee;
  padding: .6rem 1rem;
  border-radius: .5rem;
  cursor: pointer;
  transition: background .2s;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  font-weight: 700;
  margin-top: 1rem;
}
.new-pitch-btn:hover { background: #ddd; }

/* GENERIC SELECTED STYLE FOR CARD & BUTTONS */
.card.selected,
.back-btn.selected,
.new-pitch-btn.selected,
.login-card .card-btn.selected {
  background: var(--agent-green) !important;
  border-color: var(--agent-green) !important;
  color: var(--text-dark) !important;
}


/* Markdown / Pitch styling */
.result-content {
  /* ensure readability */
  white-space: pre-wrap;
}

/* Section headings */
.result-content h2 {
  margin-top: 1.5em;    /* 1.5 spacing before section */
  margin-bottom: 0.75em;/* 1.5 spacing after heading */
  font-weight: bold;     /* headings bold */
}

/* Paragraphs (section content) */
.result-content p {
  margin-bottom: 1.5em;  /* 1.5 spacing between sections */
  line-height: 1.5;      /* line spacing for content */
  font-weight: normal;   /* normal weight */
}

/* Bullet lists */
.result-content ul {
  margin-bottom: 1.5em;
}
.result-content li {
  margin-bottom: 0.5em;  /* ~1.0 spacing between bullets */
  line-height: 1.0;
  font-weight: normal;
}


/* RESULT TABS & CONTENT */
.tab-buttons {
  display: flex;
  gap: .5rem;
  margin-bottom: .5rem;
}
.tab-buttons button {
  flex: 1;
  padding: .5rem;
  background: #fafafa;
  border: none;
  border-radius: .5rem .5rem 0 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-dark);
}
.tab-buttons button.active {
  background: var(--brand-red);
  color: #fff;
}
.result-content {
  padding: 1rem;
  border: 1px solid #ccc;
  border-top: none;
  border-radius: 0 0 .75rem .75rem;
  line-height: 1;
  margin-bottom: 3rem;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  font-weight: 600;
}
.result-content.hidden { display: none; }

/* SUGGESTED QUESTIONS */
.suggestions-header {
  font-size: 1rem;
  margin: 0.5rem 0;
  font-weight: 700;
  color: var(--brand-red);
}
.suggestions {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}


/* Make the wizard container positioning context for overlays */
.wizard-container {
  position: relative;  /* Added to enable absolute positioning of loader */
  flex: 1;
  overflow-y: auto;
  padding: .75rem 1rem;
}

/* FAQ Loading Overlay - full-screen semi-transparent overlay */
.faq-loading-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(255, 255, 255, 0.9);  /* white with slight transparency */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Container for loading text and progress bar */
.faq-loading-box {
  text-align: center;
}

/* Loading text style */
.faq-loading-text {
  color: var(--brand-red);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

/* Progress bar track */
.faq-loading-bar {
  width: 80%;
  max-width: 300px;
  height: 8px;
  background: rgba(255, 140, 0, 0.2);  /* light orange background for track */
  border-radius: 4px;
  overflow: hidden;
  margin: 0 auto;
}

/* Progress bar fill (animated) */
.faq-loading-fill {
  width: 0%;
  height: 100%;
  background: var(--brand-orange);
  border-radius: 4px;
  animation: loading-progress 1.5s ease-in-out infinite alternate;
}

/* Keyframes for the progress bar animation */
@keyframes loading-progress {
  0%   { width: 0%; }
  100% { width: 100%; }
}



/* ANSWER CARD */
.answer-card {
  background: var(--bg-white);
  border: 1px solid #ccc;
  border-radius: .75rem;
  padding: 1rem;
  margin-bottom: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  font-weight: 600;
  color: var(--text-dark);
}

/* PIPELINE VISUALIZATION */
.pipeline-container {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 1rem;
}
.pipeline-rail {
  position: relative;
  width: 140px;
}
.pipeline-step {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}
.pipeline-icon {
  width: 20px;
  height: 20px;
  border: 2px solid #ccc;
  border-radius: 50%;
  margin-right: 0.5rem;
}
.pipeline-icon.complete {
  background: var(--agent-green) !important;
  border-color: var(--agent-green) !important;
}
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid var(--brand-orange);
  border-top: 3px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 0.5rem;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* LATEST STATEMENT LOG */
.pipeline-log {
  flex: 1;
  background: #f9f9f9;
  padding: 1rem;
  border: 1px solid #ccc;
  border-radius: 0.5rem;
  min-height: 3em;
  display: flex;
  align-items: center;
  font-weight: 600;
  color: var(--text-dark);
  overflow: hidden;
}
.pipeline-log .agent-output {
  margin: 0;
}

/* AGENT COLORS */
.agent-Retriever\ Agent   { color: var(--brand-red); }
.agent-Structurer\ Agent  { color: var(--agent-blue); }
.agent-Writer\ Agent       { color: var(--agent-green); }
.agent-Overseer\ Agent     { color: var(--brand-orange); }
.agent-Translator\ Agent   { color: var(--agent-purple); }
.agent-Question\ Generator { color: var(--text-dark); }
