/* =========================================================
   HPV Vaccine Saathi — Web UI Styles
   ========================================================= */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f4f6fb;
  color: #222;
  min-height: 100vh;
}

/* ----- Screen system & fade transitions ----- */
.screen {
  min-height: 100vh;
  transition: opacity 0.3s ease;
}

.fade-hidden {
  display: none !important;
  opacity: 0;
}

.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* =========================================================
   SCREEN 1 — LANDING
   ========================================================= */

.screen-landing {
  background: linear-gradient(135deg, #fce4ec 0%, #ffd7c4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.landing-content {
  text-align: center;
  max-width: 480px;
}

.mascot-img {
  width: 140px;
  height: auto;
  margin-bottom: 24px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.12));
}

.landing-title {
  font-size: 2rem;
  font-weight: 800;
  color: #c0395a;
  margin-bottom: 10px;
}

.landing-subtitle {
  font-size: 1.1rem;
  color: #6d3250;
  margin-bottom: 14px;
  font-weight: 500;
}

.landing-desc {
  font-size: 0.95rem;
  color: #7a4a5e;
  margin-bottom: 32px;
  line-height: 1.6;
}

.cta-btn {
  background: #c0395a;
  color: #fff;
  border: none;
  border-radius: 30px;
  padding: 14px 40px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(192,57,90,.35);
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
}

.cta-btn:hover {
  background: #a82e4c;
  box-shadow: 0 6px 18px rgba(192,57,90,.45);
}

.cta-btn:active {
  transform: scale(0.97);
}

/* =========================================================
   SCREEN 2 — ONBOARDING FORM
   ========================================================= */

.screen-onboarding {
  background: linear-gradient(135deg, #fce4ec 0%, #ffd7c4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.onboarding-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(192,57,90,.14);
  padding: 40px 36px;
  max-width: 460px;
  width: 100%;
  text-align: center;
}

.onboarding-mascot {
  width: 72px;
  height: auto;
  margin-bottom: 16px;
}

.onboarding-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #c0395a;
  margin-bottom: 28px;
}

.field-group {
  text-align: left;
  margin-bottom: 18px;
}

.field-label {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  color: #4a2030;
  margin-bottom: 6px;
}

.required-star {
  color: #c0395a;
}

.optional-tag {
  font-weight: 400;
  color: #888;
  font-size: 0.85rem;
}

.field-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #e8c5ce;
  border-radius: 10px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
  background: #fff9fb;
}

.field-input:focus {
  border-color: #c0395a;
  background: #fff;
}

.field-helper {
  font-size: 0.82rem;
  color: #999;
  margin-top: 5px;
}

.checkbox-group {
  margin-top: 6px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  color: #5a3040;
  cursor: pointer;
  line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 2px;
  accent-color: #c0395a;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.onboarding-error {
  background: #fdecea;
  color: #c0395a;
  border: 1px solid #f5b5be;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.88rem;
  margin-bottom: 14px;
  text-align: left;
}

.onboarding-card .cta-btn {
  width: 100%;
  margin-top: 8px;
}

/* =========================================================
   SCREEN 3 — TRANSITION + VIDEO
   ========================================================= */

.screen-transition {
  background: linear-gradient(135deg, #fce4ec 0%, #ffd7c4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.transition-content {
  text-align: center;
  max-width: 640px;
  width: 100%;
}

.thank-you-msg {
  font-size: 2rem;
  font-weight: 800;
  color: #c0395a;
  margin-bottom: 10px;
}

.transition-sub {
  font-size: 1.05rem;
  color: #7a4a5e;
  margin-bottom: 28px;
}

.video-wrapper {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(0,0,0,.14);
  background: #000;
  margin-bottom: 28px;
}

.intro-video {
  width: 100%;
  display: block;
  max-height: 380px;
  object-fit: contain;
}

/* =========================================================
   SCREEN 4 — MAIN APP
   ========================================================= */

.screen-app-active {
  display: block;
}

/* ----- Header ----- */
.app-header {
  background: linear-gradient(135deg, #c0395a 0%, #7a1c3a 100%);
  color: #fff;
  padding: 14px 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 900px;
  margin: 0 auto;
}

.header-mascot {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

.header-text {
  flex: 1;
}

.header-title {
  font-size: 1.3rem;
  font-weight: 700;
}

.header-subtitle {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-top: 2px;
}

.header-greeting {
  font-size: 0.95rem;
  font-weight: 600;
  opacity: 0.92;
  white-space: nowrap;
}

/* ----- Tab navigation ----- */
.tab-nav {
  display: flex;
  justify-content: center;
  gap: 0;
  background: #fff;
  border-bottom: 2px solid #f0d0d8;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 13px 28px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  color: #555;
  transition: color 0.2s, border-color 0.2s;
}

.tab-btn:hover {
  color: #c0395a;
}

.tab-btn.active {
  color: #c0395a;
  border-bottom-color: #c0395a;
  font-weight: 700;
}

/* ----- Main area ----- */
.app-main {
  max-width: 900px;
  margin: 28px auto 60px;
  padding: 0 16px;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ----- Chat ----- */
.chat-container {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  display: flex;
  flex-direction: column;
  height: 520px;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.message {
  display: flex;
}

.user-message {
  justify-content: flex-end;
}

.message-bubble {
  max-width: 72%;
  padding: 11px 16px;
  border-radius: 18px;
  font-size: 0.94rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.user-message .message-bubble {
  background: #c0395a;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.assistant-message .message-bubble {
  background: #fdeef2;
  color: #222;
  border-bottom-left-radius: 4px;
}

/* ----- Prompt chips ----- */
.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px 4px;
  border-top: 1px solid #f0dde2;
}

.prompt-chip {
  background: #fff0f4;
  border: 1.5px solid #e8c5ce;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.83rem;
  color: #c0395a;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  font-weight: 500;
}

.prompt-chip:hover {
  background: #fce4ec;
  border-color: #c0395a;
}

.chat-form {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid #f0dde2;
  background: #fffbfc;
}

.chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid #e8c5ce;
  border-radius: 24px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input:focus {
  border-color: #c0395a;
}

.send-btn {
  background: #c0395a;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.send-btn:hover {
  background: #a82e4c;
}

.chat-actions {
  padding: 8px 14px 10px;
  background: #fffbfc;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid #f0dde2;
}

/* ----- Buttons ----- */
.action-btn {
  background: #f9f0f3;
  border: 1.5px solid #e8c5ce;
  border-radius: 8px;
  padding: 7px 16px;
  font-size: 0.9rem;
  cursor: pointer;
  color: #444;
  transition: background 0.2s, border-color 0.2s;
}

.action-btn:hover {
  background: #fce4ec;
  border-color: #c0395a;
}

/* ----- Content panels (Myth, Eligibility) ----- */
.content-panel {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  padding: 28px 32px;
}

.myth-content {
  line-height: 1.7;
  font-size: 0.96rem;
}

.myth-content h1, .myth-content h2, .myth-content h3 {
  margin-top: 1.2em;
  margin-bottom: 0.4em;
  color: #7a1c3a;
}

.myth-content ul, .myth-content ol {
  padding-left: 1.4em;
  margin: 0.5em 0;
}

.myth-content p { margin: 0.5em 0; }

.loading-text { color: #999; font-style: italic; }

/* ----- Eligibility Form ----- */
.section-heading {
  font-size: 1.25rem;
  color: #7a1c3a;
  margin-bottom: 8px;
}

.section-info {
  font-size: 0.91rem;
  color: #555;
  margin-bottom: 20px;
  line-height: 1.6;
}

.eligibility-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 480px;
}

.form-label {
  font-weight: 600;
  font-size: 0.93rem;
  margin-top: 6px;
}

.form-input {
  padding: 9px 12px;
  border: 1.5px solid #e8c5ce;
  border-radius: 8px;
  font-size: 0.94rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: #c0395a;
}

.radio-group {
  display: flex;
  gap: 24px;
  font-size: 0.93rem;
}

.submit-btn {
  margin-top: 14px;
  padding: 11px 28px;
  background: #c0395a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.96rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  width: fit-content;
}

.submit-btn:hover {
  background: #a82e4c;
}

.eligibility-result {
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: 10px;
  font-size: 0.93rem;
  line-height: 1.6;
}

.eligibility-result.eligible {
  background: #e8f5e9;
  border: 1.5px solid #66bb6a;
  color: #1b5e20;
}

.eligibility-result.not-eligible {
  background: #fff8e1;
  border: 1.5px solid #ffb300;
  color: #5d4037;
}

.eligibility-result ul {
  padding-left: 1.3em;
  margin-top: 8px;
}

/* ----- Sidebar ----- */
.sidebar-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  background: #c0395a;
  color: #fff;
  border-radius: 8px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  z-index: 200;
  user-select: none;
}

.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  height: 100vh;
  background: #fff;
  box-shadow: -4px 0 20px rgba(0,0,0,.12);
  padding: 24px 20px;
  z-index: 300;
  overflow-y: auto;
  transition: transform 0.25s ease;
}

.sidebar.hidden {
  transform: translateX(110%);
}

.sidebar-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #888;
}

.sidebar-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #7a1c3a;
  margin-bottom: 10px;
}

.sidebar-section-title {
  font-size: 0.97rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.sidebar-info {
  font-size: 0.88rem;
  color: #666;
  margin-bottom: 10px;
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-input {
  font-size: 0.88rem;
}

.upload-btn {
  width: 100%;
  text-align: center;
}

.upload-result {
  margin-top: 10px;
  font-size: 0.88rem;
  color: #c0395a;
}

/* ----- Thinking indicator ----- */
.thinking {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #999;
  font-style: italic;
  font-size: 0.9rem;
  padding: 6px 14px;
}

.thinking::after {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid #e8c5ce;
  border-top-color: #c0395a;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.hidden { display: none !important; }
