/* =========================================
   1. GLOBAL VARIABLES & RESET
   ========================================= */
:root {
  --bg: #fff;
  --muted: #6b7280;
  
  /* PRIMARY THEME: PURPLE */
  --accent: #7042f8;       
  --accent-hover: #5d30d9;
  --accent-light: #f3f0ff; 
  
  --text-dark: #111827;
  --border: #e5e7eb;
  
  /* Status Colors */
  --green: #10b981;
  --red: #ef4444;
  
  /* Landing Page Palette */
  --lp-teal: #14b8a6;
  --lp-red: #f43f5e;
  --lp-gray: #4b5563;
  --lp-light-bg: #f9fafb;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  margin: 0;
  color: var(--text-dark);
  /* Default background (will be overridden by page classes) */
  background: #fff; 
  display: flex;         /* Added for sticky footer */
  flex-direction: column;
  min-height: 100vh;
}

/* Page Specific Backgrounds */
body.landing-page { background-color: #fff; }
body.app-page { background-color: #f8f9fa; }

/* Utilities */
.fade-in { animation: fadeIn 0.4s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Global Throbber */
.throbber {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid #ccc;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* =========================================
   2. LANDING PAGE STYLES (INDEX.HTML)
   ========================================= */

.lp-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* -- Nav -- */
.lp-nav {
  padding: 20px 0;
  border-bottom: 1px solid #f3f4f6;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-weight: 800;
  font-size: 1.25rem;
  color: #111;
  letter-spacing: -0.5px;
  min-width: 150px;
  display: flex;          /* Flexbox for alignment */
  align-items: center;    /* Vertical center */
  gap: 10px;              /* Space between icon and text */
}
.logo-icon {
  height: 32px;           /* Fixed height for icon */
  width: auto;            /* Maintain aspect ratio */
}
.nav-links {
  display: flex;
  gap: 32px;
  flex: 1;
  justify-content: center;
}
.nav-links a {
  text-decoration: none;
  color: var(--lp-gray);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }

/* User Section in Nav */
.nav-actions {
  min-width: 150px;
  display: flex;
  justify-content: flex-end;
}
.user-section {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f9fafb;
  padding: 6px 12px 6px 6px;
  border-radius: 50px;
  border: 1px solid #e5e7eb;
}
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.user-greeting { font-weight: 600; font-size: 0.9rem; }
.nav-btn-logout {
  background: none; border: none; color: var(--lp-red); font-weight: 700;
  font-size: 0.8rem; cursor: pointer; padding: 4px 8px; border-radius: 4px;
}
.nav-btn-logout:hover { background: #fff1f2; }

/* NEW: User Balance Badge */
.user-balance {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-light);
  padding: 6px 12px;
  border-radius: 20px;
  margin-right: 4px;
  white-space: nowrap;
}

/* Auth Buttons (Login / Sign Up) */
.auth-buttons {
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav-login-btn {
  background: none;
  border: none;
  font-weight: 700;
  color: #374151; /* Gray-700 */
  cursor: pointer;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  padding: 0;
}
.nav-login-btn:hover {
  color: var(--accent); /* Accent color */
}
.nav-signup-btn {
  background-color: var(--accent); /* Primary Purple */
  color: white;
  padding: 10px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}
.nav-signup-btn:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(112, 66, 248, 0.2);
}

/* -- Hero Section -- */
.lp-hero {
  padding: 60px 0 80px;
  background-color: #fff;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  min-height: 400px;
}
.hero-text { text-align: left; }
.hero-text h1 {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1.15;
  color: #111;
  margin-bottom: 24px;
  letter-spacing: -1px;
}
.highlight-box {
  background-color: var(--accent);
  color: #fff;
  padding: 4px 12px;
  transform: skewX(-10deg);
  display: inline-block;
  font-style: italic;
  white-space: nowrap;
  margin-top: 6px;
  font-weight: 900;
}
.hero-subtext {
  font-size: 1.1rem;
  color: var(--lp-gray);
  margin-bottom: 32px;
  line-height: 1.6;
  max-width: 95%;
}
.hero-image-container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
}
.hero-img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  border-radius: 24px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.12);
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; gap: 40px; padding-top: 20px; }
  .hero-text { text-align: center; }
  .hero-subtext { margin: 0 auto 32px; }
  .hero-image-container { justify-content: center; }
}

.lp-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 16px 36px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.05rem;
}
.lp-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.btn-hero { background-color: var(--accent); color: #fff; }

/* -- Features Section -- */
.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-top: 40px;
}
@media (min-width: 768px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}
.feature-card {
  background: #fff;
  padding: 32px;
  border-radius: 16px;
  border: 1px solid #f3f4f6;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.08);
  border-color: var(--accent-light);
}
.feature-icon-wrapper {
  width: 64px;
  height: 64px;
  background: var(--accent-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}
.feature-icon-wrapper img { width: 32px; height: 32px; }
.feature-card h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 12px 0;
  color: var(--text-dark);
}
.feature-card p {
  color: var(--lp-gray);
  line-height: 1.6;
  font-size: 1rem;
  margin: 0;
}

/* -- Pricing -- */
.lp-section { padding: 80px 0; }
.section-header { text-align: center; margin-bottom: 50px; }
.section-header h2 { font-size: 2.2rem; font-weight: 800; margin-bottom: 10px; }
.section-header p { color: var(--lp-gray); font-size: 1.1rem; }

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  align-items: stretch;
}
.pricing-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 32px 24px;
  background: #fff;
  text-align: center;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.3s;
}
.pricing-card:hover { box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.1); }

.border-teal { border-top: 6px solid var(--lp-teal); }
.border-purple { border-top: 6px solid var(--accent); }
.border-red { border-top: 6px solid var(--lp-red); }

.pricing-card h3 { font-size: 0.85rem; font-weight: 800; letter-spacing: 1px; margin: 0 0 16px; text-transform: uppercase; }
.pricing-card .price { font-size: 2.5rem; font-weight: 800; line-height: 1; margin-bottom: 8px; }
.pricing-card .period { font-size: 0.75rem; color: #9ca3af; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; }
.pricing-card hr { border: 0; border-top: 1px solid #f3f4f6; margin: 24px 0; }
.pricing-card .features { flex-grow: 1; }
.pricing-card .limit { font-weight: 700; margin-bottom: 12px; font-size: 0.95rem; }
.pricing-card .desc { color: var(--lp-gray); font-size: 0.9rem; line-height: 1.5; margin-bottom: 20px; }
.pricing-card .sub-feature { color: var(--lp-gray); font-weight: 600; font-size: 0.9rem; background: #f9fafb; padding: 6px; border-radius: 4px; }
.card-footer { margin-top: 24px; }

.btn-teal { background-color: var(--lp-teal); color: #fff; width: 100%; border-radius: 50px; }
.btn-purple { background-color: var(--accent); color: #fff; width: 100%; border-radius: 50px; }
.btn-red { background-color: var(--lp-red); color: #fff; width: 100%; border-radius: 50px; }

/* -- FAQ -- */
.faq-section { text-align: center; background-color: #fff; padding-top: 60px; border-top: 1px solid #f3f4f6; }
.faq-header { margin-bottom: 40px; }
.faq-label { color: var(--accent); font-weight: 700; font-size: 0.8rem; letter-spacing: 1px; text-transform: uppercase; display: block; margin-bottom: 8px; }
.faq-header h2 { font-size: 2.2rem; font-weight: 800; margin: 0 0 10px; }
.text-purple { color: var(--accent); }
.faq-sub { color: var(--lp-gray); font-size: 1.1rem; }

.faq-accordion { max-width: 800px; margin: 0 auto; text-align: left; }
.faq-item { background: #f9fafb; margin-bottom: 12px; border-radius: 8px; border: 1px solid #e5e7eb; overflow: hidden; }
.faq-question {
  width: 100%; padding: 20px; background: none; border: none; text-align: left;
  font-size: 1rem; font-weight: 600; color: #1f2937; display: flex; justify-content: space-between;
  align-items: center; cursor: pointer;
}
.faq-question:hover { background: #f3f4f6; }
.faq-answer {
  max-height: 0; overflow: hidden; padding: 0 20px; transition: max-height 0.3s ease, padding 0.3s ease;
  color: #4b5563; line-height: 1.6; font-size: 0.95rem;
}
.faq-item.active .faq-answer { max-height: 200px; padding-bottom: 20px; border-top: 1px solid #e5e7eb; }
.arrow { transition: transform 0.3s; font-size: 0.8rem; opacity: 0.5; }
.faq-item.active .arrow { transform: rotate(180deg); opacity: 1; }

/* -- Footer (NEW) -- */
.lp-footer {
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  padding: 32px 0;
  margin-top: auto; /* Push to bottom if content is short */
}
.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-left { color: #6b7280; font-size: 0.9rem; }
.footer-links { display: flex; gap: 24px; }
.footer-links a {
  text-decoration: none;
  color: #4b5563;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--accent); }

@media (max-width: 600px) {
  .footer-content { flex-direction: column; gap: 16px; text-align: center; }
}

/* -- Legal Page Content (NEW) -- */
.legal-content h3 {
  font-size: 1.25rem;
  margin: 24px 0 12px 0;
  color: #111;
}
.legal-content p, .legal-content li {
  color: #4b5563;
  line-height: 1.7;
  font-size: 1rem;
  margin-bottom: 16px;
}
.legal-content ul { padding-left: 20px; margin-bottom: 16px; }
.legal-content a { color: var(--accent); text-decoration: none; }
.legal-content a:hover { text-decoration: underline; }


/* =========================================
   3. APP STYLES (INTERVIEW.HTML)
   ========================================= */

/* Header & Stepper */
.app-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  margin-bottom: 30px;
}
.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.badge-new {
  background: #dcfce7; color: #166534; font-size: 0.7rem; padding: 2px 6px;
  border-radius: 4px; text-transform: uppercase; margin-left: 8px;
}

.stepper { display: flex; align-items: center; gap: 12px; }
.step { display: flex; align-items: center; gap: 8px; color: #9ca3af; font-weight: 500; font-size: 0.9rem; }
.step.active { color: var(--text-dark); }
.step-circle {
  width: 28px; height: 28px; border-radius: 50%; background: #f3f4f6; color: #6b7280;
  display: flex; align-items: center; justify-content: center; font-size: 0.85rem; font-weight: 700;
}
.step.active .step-circle { background: var(--accent); color: #fff; }
.step-line { width: 40px; height: 2px; background: #f3f4f6; }
.step.completed .step-circle { background: var(--accent-light); color: var(--accent); }

/* User Controls (App Header) */
.app-user { display: flex; align-items: center; gap: 10px; }
#app-user-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.text-btn { background: none; border: none; color: var(--red); font-weight: 600; cursor: pointer; font-size: 0.85rem; }

/* Common Layout */
/* FIX: Force container to be full width up to max-width */
.container { 
  width: 100%; /* Ensure container itself doesn't shrink */
  max-width: 1100px; 
  margin: 0 auto; 
  padding: 0 20px; 
}

/* FIX: Ensure the main app content block is full width */
.app-content {
  width: 100%;
  display: block;
}

.card {
  background: #fff; padding: 40px; border-radius: 12px;
  border: 1px solid var(--border); 
  /* IMPROVED SHADOW */
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  /* FIX: Ensure card always takes full width of container */
  width: 100% !important;
  max-width: 100% !important;
  display: block !important; /* Ensure it is block, not flex-wrapped */
  box-sizing: border-box;
}

/* Headings */
h2 { font-size: 1.5rem; font-weight: 700; margin: 0 0 8px; }
.subtitle { color: var(--muted); font-size: 1rem; margin-bottom: 24px; line-height: 1.5; }

/* New: Gradient Header Text Utility */
.gradient-text {
  background: linear-gradient(135deg, #7042f8 0%, #d946ef 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* Buttons */
.btn {
  padding: 10px 20px; border-radius: 6px; border: 1px solid transparent;
  font-weight: 600; cursor: pointer; transition: all 0.2s;
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
}
.btn.large-btn { padding: 14px 28px; font-size: 1.05rem; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn.secondary { background: #fff; border-color: var(--border); color: var(--text-dark); }
.btn.secondary:hover { background: #f9fafb; border-color: #d1d5db; }
.btn.outline-red { background: #fff; border-color: var(--red); color: var(--red); }
.btn.outline-red:hover { background: #fef2f2; }
.btn.outline-green { background: #fff; border-color: var(--green); color: var(--green); }
.btn.success-mode { background: #ecfdf5; border-color: var(--green); color: var(--green); }
.btn.outline-gray { background: #fff; border-color: var(--border); color: #4b5563; }

/* New utility: small icon slot inside buttons so icons align like header */
.btn .icon {
  display: inline-flex;
  width: 1em;
  height: 1em;
  align-items: center;
  justify-content: center;
  line-height: 1;
  margin-right: 8px;
  font-size: 0.95em;
}

/* NEW: End button (filled red) - use this class for the End action */
.btn.end {
  background: var(--red);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 18px -8px rgba(239, 68, 68, 0.25);
}
.btn.end:hover {
  background: #dc3737; /* slightly darker on hover */
  transform: translateY(-1px);
}
.btn.end:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Optional alternate "end" small variant */
.btn.end.small {
  padding: 6px 10px;
  font-size: 0.85rem;
  border-radius: 6px;
}

/* View 1: Welcome */
/* View 1: Welcome – make it look like the Audio step card */
/* FIX: Added higher specificity and explicit block display */
.app-content #view-welcome {
  /* FIX: Force full width and correct alignment with !important */
  width: 100% !important;
  max-width: 100% !important;
  text-align: left !important;
  margin-top: 0;
  display: block !important;
}

.welcome-content {
  padding: 0;               /* rely on .card's default 40px padding */
  text-align: left !important;         /* match Audio / Setup steps */
  width: 100% !important;              /* Ensure content fills card */
  max-width: none !important;
}

.instruction-list {
  margin: 24px 0 40px;      /* similar spacing as before */
  padding-left: 20px;       /* normal bullet indent */
  list-style-position: outside;
  color: #4b5563;
  line-height: 1.8;
}


/* View 2: Setup Form */
/* FIX: Added selector to ensure Setup View is also full width */
#view-setup {
  width: 100% !important;
  max-width: 100% !important;
  text-align: left !important;
  display: block !important;
}

/* NEW: Upload Drop Zone Styles */
.upload-drop-zone {
    border: 2px dashed #e5e7eb;
    border-radius: 12px;
    padding: 28px 18px;         /* increased vertical padding for visual balance */
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    width: 100%;
    margin-bottom: 8px;
    color: var(--text-dark);
    min-height: 160px;          /* ensure consistent visual height */
    box-sizing: border-box;
}

.upload-drop-zone:hover {
    border-color: var(--accent);
    background: var(--accent-light);
    transform: translateY(-2px);
}

.upload-drop-zone .icon {
    font-size: 28px;
    margin-bottom: 8px;
    display: block;
}

.upload-drop-zone .text {
    font-weight: 600;
    font-size: 0.95rem;
    display: block;
}

.upload-drop-zone .sub {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 4px;
    display: block;
}

/* Optional: a resume-specific dropzone alias used in interview.html */
.resume-drop-zone {
    border: 2px dashed #e5e7eb;
    border-radius: 12px;
    padding: 28px 18px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    min-height: 160px;
    box-sizing: border-box;
}

/* ============ Interview page layout fixes =============
   - Top-align the two-column form
   - Keep URL + Fetch aligned
   - Make upload blocks and textareas consistent
   ===================================================== */

/* Ensure grid items align to the top so left/right columns start equally */
.form-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;   /* 1 column on small screens */
  align-items: start;          /* TOP align columns to avoid misalignment */
  width: 100%;
}

/* Two columns on wider screens (desktop / tablet) */
@media (min-width: 900px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;  /* Job Description | Resume */
    align-items: start;              /* ensure top alignment at larger widths */
  }
}

/* Input row helper for URL + Fetch button alignment
   Use this markup:
   <div class="input-row">
     <input class="jd-url" />
     <button class="fetch-btn btn secondary">Fetch</button>
   </div>
*/
.input-row {
  display: flex;
  gap: 12px;
  align-items: flex-start; /* keep fetch button at top of input */
  width: 100%;
  min-width: 0;            /* prevent flex children overflowing parent */
}
.input-row .jd-url {
  flex: 1 1 auto;
  min-width: 0;            /* allow shrinking in narrow viewports */
}
.input-row .fetch-btn {
  flex: 0 0 auto;
  margin-top: 4px;         /* small visual nudge to better match input padding */
}

/* Ensure fetch button stacks under input on very narrow screens */
@media (max-width: 520px) {
  .input-row {
    flex-direction: column;
    align-items: stretch;
  }
  .input-row .fetch-btn { margin-top: 8px; }
}

/* Make upload drop-zones visually consistent and center content */
.upload-drop-zone,
.resume-drop-zone,
.upload-drop-zone[data-type] {
  text-align: center;
}

/* Ensure textareas in the two-column form have matching heights */
.form-grid textarea,
.form-grid .answer-box,
.form-grid .job-textarea,
.form-grid .resume-textarea {
  min-height: 220px;  /* raised to keep left/right columns aligned */
  resize: vertical;
  box-sizing: border-box;
}

/* Helper to make a card occupy full column height for neat alignment */
.card.match-height {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Keep small utility classes consistent */
.field label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 0.95rem; }
input, select, textarea {
  width: 100%; padding: 16px; /* Increased padding */
  border: 1px solid var(--border); border-radius: 8px;
  font-family: inherit; font-size: 0.95rem; transition: border-color 0.2s;
  background: #fdfdfd; /* Slight off-white */
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); background: #fff; }
textarea { min-height: 150px; resize: vertical; line-height: 1.6; }
.char-count { text-align: right; font-size: 0.8rem; color: #9ca3af; margin-top: 4px; }
.upload-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.file-name { font-size: 0.9rem; color: var(--muted); }
.form-actions { display: flex; justify-content: space-between; margin-top: 32px; padding-top: 24px; border-top: 1px solid #f3f4f6; }
.right-actions { display: flex; gap: 12px; }


/* View 3: Audio Setup */
.audio-step { margin-bottom: 32px; }
.audio-step h3 { font-size: 1rem; font-weight: 700; margin-bottom: 12px; }
.step-instruction { color: #4b5563; font-size: 0.95rem; margin-bottom: 8px; }
.audio-success-msg {
  background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; padding: 12px; border-radius: 8px; margin-top: 20px; font-weight: 500;
}

/* NEW: Modern Audio Cards */
.audio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 700px) {
  .audio-grid { grid-template-columns: 1fr; }
}

.audio-selection-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  transition: all 0.2s ease;
  background: #f9fafb;
}
.audio-selection-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 10px 20px -5px rgba(0,0,0,0.05);
}
.audio-emoji {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
}
.audio-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: #1f2937;
}
.audio-desc {
  color: #6b7280;
  font-size: 0.9rem;
  margin-bottom: 24px;
  min-height: 40px; /* Align buttons */
}


/* View 4: Main Interview */
.action-bar {
  background: #fff; padding: 16px 24px; border-radius: 12px; border: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); /* Added shadow */
}
.status-indicator { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.95rem; }
.dot { width: 10px; height: 10px; background: #d1d5db; border-radius: 50%; }
.dot.live { background: var(--red); box-shadow: 0 0 0 3px #fee2e2; animation: pulse 2s infinite; }
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } }

.action-buttons { display: flex; gap: 10px; }
.btn.primary-purple { background: var(--accent); color: #fff; }

.main-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.two-column-layout { min-height: 600px; }

.panel.interaction-panel { 
  background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 24px; height: 100%;
  display: flex; flex-direction: column;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); /* Softer look */
}

.section-head { 
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; 
  border-bottom: 1px solid #f3f4f6; padding-bottom: 12px;
}
.title-group { display: flex; align-items: center; gap: 8px; }
.live-status { 
  font-size: 0.75rem; color: var(--red); font-weight: 700; text-transform: uppercase; 
  background: #fef2f2; padding: 2px 6px; border-radius: 4px;
}

.controls { display: flex; gap: 8px; align-items: center; }

/* Transcript Box */
.transcript-box {
  flex-grow: 1; 
  min-height: 300px; 
  background: #f9fafb; /* Changed to light gray */
  border: 1px solid var(--border); 
  border-radius: 8px;
  padding: 16px; 
  font-family: 'Inter', sans-serif; 
  font-size: 0.95rem; 
  line-height: 1.6;
  margin-bottom: 16px; 
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px; /* Increased gap */
}

/* Transcript Bubbles (New) */
.msg-interviewer {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-left: 4px solid #6366f1; /* Left accent */
  color: #374151;
  padding: 12px 16px;
  border-radius: 8px 8px 8px 0;
  margin-bottom: 4px;
  width: fit-content;
  max-width: 85%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.msg-candidate {
  background: #eef2ff; /* Light purple tint */
  border: 1px solid #e0e7ff;
  color: #312e81;
  padding: 12px 16px;
  border-radius: 8px 8px 0 8px;
  margin-bottom: 4px;
  margin-left: auto; /* Align right */
  width: fit-content;
  max-width: 85%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.interim-text {
  color: #9ca3af;
  font-style: italic;
  font-size: 0.9rem;
  padding: 8px;
  text-align: center;
}

/* Question Identification Box (New) */
.question-section { background: #fff; }
#ai-question-box {
  padding: 16px;
  background: #fffbeb; /* Light yellow */
  border: 1px solid #fcd34d;
  border-radius: 8px;
  color: #92400e;
  line-height: 1.5;
  margin-top: 8px;
  font-size: 1rem;
}

.edit-bar { display: flex; gap: 8px; }
.transcript-edit { 
  flex-grow: 1; min-height: 60px; border: 1px solid var(--border); border-radius: 8px; padding: 8px; font-family: inherit;
}

.answer-box { 
  width: 100%; min-height: 400px; padding: 20px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 1rem; line-height: 1.6; resize: vertical;
  background: #fff;
  color: #1f2937;
}

.btn.xsmall { padding: 6px 12px; font-size: 0.85rem; }
.meta-text { font-size: 0.8rem; color: #9ca3af; margin-top: 8px; text-align: right; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 100; }
.modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: #fff; padding: 24px; border-radius: 12px; width: 90%; max-width: 600px;
  z-index: 101; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* NEW: Saving spinner inside modal while final sync runs.
   Usage example in HTML:
   <div class="modal">
     ...
     <div class="modal-actions">
       <div class="saving" aria-live="polite">
         <span class="throbber saving-spinner" aria-hidden="true"></span>
         <span class="saving-text">Saving…</span>
       </div>
       <button class="btn end">End</button>
     </div>
   </div>
*/
.modal .saving {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: auto; /* push actions to the right if used inside modal-actions */
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
}

/* reuse global .throbber but create a slightly smaller variant for inline usage */
.modal .saving .saving-spinner,
.throbber.saving-spinner {
  width: 0.9em;
  height: 0.9em;
  border-width: 2px;
  border-top-color: var(--red); /* spinner color for saving state */
}

/* Make the saving text slightly red to emphasize the saving status, but keep subdued */
.modal .saving .saving-text {
  color: #b91c1c; /* darker red, readable on white */
  font-weight: 700;
}

/* Make sure any icon inside modal buttons also aligns */
.modal .btn .icon { margin-right: 6px; }

/* =========================================
   4. CRITICAL UTILITY OVERRIDES (FIX FOR STACKING UI)
   ========================================= */
/* These rules must be at the BOTTOM of the file.
   They override the specific 'display: block !important' rules 
   that were added to .card and #view-* IDs for layout fixes.
   This ensures that when the '.hidden' class is added, 
   the element is actually hidden.
*/
.hidden, 
.card.hidden,
#view-welcome.hidden,
#view-setup.hidden,
#view-audio.hidden,
#view-main.hidden {
  display: none !important;
}