/* Government of India — Welfare Schemes Portal | UPES Major Project */
:root {
  /* Tricolor */
  --saffron: #FF9933;
  --white: #FFFFFF;
  --green: #138808;
  --navy: #0d1f3c;
  /* Theme (white, professional) */
  --bg: #FFFFFF;
  --surface: #f8fafc;
  --surface2: #f1f5f9;
  --text: #1e293b;
  --text-muted: #475569;
  --accent: #0d47a1;
  --accent-dim: #1565c0;
  --success: #138808;
  --border: #e2e8f0;
  --radius: 8px;
  --font: 'Noto Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-devanagari: 'Noto Sans Devanagari', var(--font);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Tricolor strips */
.tricolor-strip {
  display: flex;
  height: 6px;
  width: 100%;
}
.tricolor-saffron { flex: 1; background: var(--saffron); }
.tricolor-white     { flex: 1; background: var(--white); border-left: 1px solid #e2e8f0; border-right: 1px solid #e2e8f0; }
.tricolor-green     { flex: 1; background: var(--green); }
.tricolor-bottom    { margin-top: auto; }

/* Branding below navbar (Indian flag theme – colourful) */
.branding-bar {
  border-bottom: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 2px 8px rgba(255,153,51,0.08), 0 2px 8px rgba(19,136,8,0.08);
  background: linear-gradient(180deg, rgba(255,153,51,0.06) 0%, #ffffff 12%, #ffffff 88%, rgba(19,136,8,0.06) 100%);
}

.branding-tricolor {
  display: flex;
  height: 6px;
  width: 100%;
}
.branding-tricolor .tricolor-saffron { flex: 1; background: var(--saffron); }
.branding-tricolor .tricolor-white   { flex: 1; background: var(--white); border-left: 1px solid #e2e8f0; border-right: 1px solid #e2e8f0; }
.branding-tricolor .tricolor-green   { flex: 1; background: var(--green); }
.branding-tricolor-top { margin-bottom: 0; }
.branding-tricolor-bottom { margin-top: 0; }

.branding-content-wrap {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.branding-saffron {
  height: 8px;
  background: linear-gradient(180deg, var(--saffron) 0%, #ffb366 100%);
  width: 100%;
}

.branding-white {
  background: linear-gradient(to right, rgba(255,153,51,0.18) 0%, rgba(255,153,51,0.06) 30%, rgba(19,136,8,0.06) 70%, rgba(19,136,8,0.18) 100%);
  padding: 0.6rem 0;
  border-left: 4px solid var(--saffron);
  border-right: 4px solid var(--green);
  box-sizing: content-box;
}

.branding-green {
  height: 8px;
  background: linear-gradient(180deg, #2a9a14 0%, var(--green) 100%);
  width: 100%;
}

.branding-inner {
  padding: 0.25rem 1.5rem;
  text-align: center;
}

.branding-text {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.branding-text .branding-hindi {
  font-family: var(--font-devanagari);
  color: var(--saffron);
  font-weight: 700;
}

.branding-text .branding-sep {
  margin: 0 0.5rem;
  color: var(--green);
  font-weight: 400;
}

.branding-text .branding-english {
  color: var(--navy);
}

.branding-tagline {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--green);
}

.branding-tagline::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 10px;
  margin-right: 0.4rem;
  vertical-align: middle;
  background: linear-gradient(to bottom, var(--saffron) 0%, var(--saffron) 33.33%, var(--white) 33.33%, var(--white) 66.66%, var(--green) 66.66%, var(--green) 100%);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 2px;
}

.branding-hindi-text {
  margin: 0.35rem 0 0;
  font-family: var(--font-devanagari);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--navy);
  line-height: 1.4;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.branding-marquee-wrap {
  background: linear-gradient(90deg, var(--saffron) 0%, var(--white) 15%, var(--white) 85%, var(--green) 100%);
  border-top: 1px solid rgba(0,0,0,0.06);
  padding: 0.35rem 0;
  overflow: hidden;
}

.branding-marquee {
  margin: 0;
  padding: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--navy);
  display: block;
}

.branding-marquee .marquee-item {
  margin-right: 3rem;
  white-space: nowrap;
}

.branding-marquee .marquee-item:first-child {
  color: var(--green);
  font-family: var(--font-devanagari);
}

.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: var(--navy);
}

.brand-logos {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.logo-ashoka-chakra,
.logo-national-emblem {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
}

.logo-ashoka-chakra svg {
  display: block;
  height: auto;
}

.logo-national-emblem .logo-emblem-img {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: contain;
  object-position: center;
}

.logo-ashoka-chakra { margin-right: 0.25rem; }
.logo-national-emblem { margin-left: 0.25rem; }
.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.brand-hindi {
  font-family: var(--font-devanagari);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--navy);
  line-height: 1.2;
}
.brand-english {
  font-weight: 600;
  font-size: 1rem;
  color: var(--navy);
  letter-spacing: 0.02em;
}
.brand-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.main-nav a {
  color: var(--navy);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}
.main-nav a:hover {
  background: var(--surface2);
  color: var(--accent);
}

.main-content {
  flex: 1;
  padding: 2rem 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.hero {
  text-align: center;
  padding: 2rem 0 3rem;
}
.hero-small {
  padding: 1.5rem 0 2rem;
}
.hero h1, .hero-small h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  margin: 0 0 0.5rem;
  color: var(--navy);
  font-weight: 700;
}
.hero p, .hero-small p {
  color: var(--text-muted);
  margin: 0;
  font-size: 1rem;
}
.hero a, .hero-small a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.hero a:hover, .hero-small a:hover { text-decoration: underline; }

/* Form + results layout */
.layout-with-details {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .layout-with-details {
    grid-template-columns: 1fr;
  }
}

.form-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: sticky;
  top: 1rem;
}

.scheme-form .form-row {
  margin-bottom: 1rem;
}

.scheme-form label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.scheme-form input,
.scheme-form select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
}

.scheme-form input:focus,
.scheme-form select:focus {
  outline: none;
  border-color: var(--accent);
}

.scheme-form select:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Toggle: Include Central schemes */
.form-row-toggle {
  margin-top: 0.5rem;
}
.toggle-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
  padding: 0.5rem 0.75rem;
  margin: -0.5rem -0.75rem;
  border-radius: var(--radius);
  transition: background 0.2s;
}
.toggle-label:hover {
  background: var(--surface2);
}
.toggle-label:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.toggle-text {
  user-select: none;
  flex: 1;
  min-width: 0;
}
.toggle-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.toggle-slider {
  position: relative;
  flex-shrink: 0;
  width: 2.75rem;
  height: 1.375rem;
  background: #000;
  border: 1px solid #000;
  border-radius: 999px;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
}
.toggle-label:hover .toggle-slider {
  background: #1a1a1a;
  border-color: #1a1a1a;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.3);
}
.toggle-slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(1.375rem - 6px);
  height: calc(1.375rem - 6px);
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: transform 0.2s;
}
.toggle-label input:checked + .toggle-slider {
  background: var(--accent);
  border-color: var(--accent);
}
.toggle-label:hover input:checked + .toggle-slider {
  background: var(--accent-dim);
  border-color: var(--accent-dim);
}
.toggle-label input:checked + .toggle-slider::after {
  transform: translateX(1.375rem);
  background: #fff;
}
.form-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  margin-left: 0.75rem;
  line-height: 1.3;
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary {
  background: var(--navy);
  color: var(--white);
  width: 100%;
  margin-top: 0.5rem;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Results + fixed scrollable details */
.results-panel {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
  min-height: 420px;
}

@media (max-width: 1100px) {
  .results-panel {
    grid-template-columns: 1fr;
  }
}

.results-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  min-height: 320px;
  overflow-y: auto;
  max-height: 70vh;
}

.results-list .placeholder-text,
.results-list .loading,
.results-list .error {
  color: var(--text-muted);
  padding: 1rem;
  margin: 0;
}

.results-list .error {
  color: #f85149;
}

.scheme-card {
  padding: 1rem;
  margin-bottom: 0.5rem;
  background: var(--surface2);
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.scheme-card:hover {
  border-color: var(--border);
  background: var(--surface2);
}

.scheme-card.active {
  border-color: var(--navy);
  background: var(--surface2);
}

.scheme-card h4 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

.scheme-card .badge {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Fixed scrollable details panel */
.details-panel.fixed-scrollable {
  position: sticky;
  top: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 400px;
  max-height: 70vh;
}

.details-panel .details-inner {
  padding: 1rem;
  overflow-y: auto;
  flex: 1;
  height: 100%;
}

.details-panel .details-inner h3 {
  font-size: 1rem;
  margin: 0 0 0.75rem;
  color: var(--text-muted);
}

.details-placeholder {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.details-content .loading {
  color: var(--text-muted);
  margin: 0;
}

.details-content .error {
  color: #f85149;
  margin: 0;
}

.details-link-row {
  margin: 0 0 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.details-link-row:last-of-type {
  border-bottom: none;
}
.details-link-loading {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin: 0 0 0.5rem;
}
.details-link-secondary {
  padding-bottom: 0.5rem;
}
.btn-link {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--white);
  background: var(--navy);
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-link:hover {
  background: var(--accent);
}
.btn-link-secondary {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  transition: border-color 0.2s;
}
.btn-link-secondary:hover {
  border-color: var(--accent);
}

.details-content .details-markdown,
.details-markdown {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.details-markdown br {
  display: block;
  content: "";
  margin-top: 0.5em;
}

/* New schemes page (List of Schemes / news live section) */
.new-schemes-section {
  padding: 0 0 3rem;
}

.new-schemes-section .container {
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.new-schemes-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem 0.25rem 0.5rem 0;
  margin: 0 -0.25rem 0 0;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.new-schemes-list::-webkit-scrollbar {
  width: 8px;
}
.new-schemes-list::-webkit-scrollbar-track {
  background: var(--surface2);
  border-radius: 4px;
}
.new-schemes-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
.new-schemes-list::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.new-scheme-item {
  display: block;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.2s;
  flex-shrink: 0;
}

.new-scheme-item:hover {
  border-color: var(--accent);
  background: var(--white);
  box-shadow: 0 4px 12px rgba(13, 31, 60, 0.12);
  transform: translateY(-2px);
}
.new-scheme-item:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(13, 31, 60, 0.08);
}

.new-scheme-item h4 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--navy);
}

.new-scheme-item p {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.new-scheme-item time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.new-scheme-item .scheme-meta {
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0.35rem;
}
.new-scheme-item .scheme-link-label { color: var(--accent); }

.new-scheme-item .scheme-summary {
  margin-bottom: 0.5rem;
}

.new-scheme-item .scheme-link-label {
  font-size: 0.8rem;
}

.new-schemes-list .loading,
.new-schemes-list .placeholder-text,
.new-schemes-list .error {
  color: var(--text-muted);
  padding: 1rem;
}

.new-schemes-list .error {
  color: #f85149;
}

.new-schemes-list .debug-info {
  margin: 1rem 0 0;
  padding: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--surface2);
  border-radius: 8px;
  word-break: break-word;
}

.new-schemes-list .debug-errors {
  color: #f85149;
}

.site-footer {
  margin-top: auto;
  padding: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.footer-disclaimer {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 1rem;
  text-align: center;
  max-width: 720px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}
.footer-nav a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
}
.footer-nav a:hover { text-decoration: underline; }

.footer-copy {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* About & How it works */
.content-section {
  padding: 0 0 3rem;
}
.narrow {
  max-width: 720px;
}
.content-block {
  margin-bottom: 2rem;
}
.content-block h2 {
  font-size: 1.25rem;
  color: var(--navy);
  margin: 0 0 0.75rem;
  font-weight: 700;
}
.content-block p {
  margin: 0;
  color: var(--text);
  line-height: 1.7;
}
.content-block a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.content-block a:hover { text-decoration: underline; }
.content-block.disclaimer {
  padding: 1rem 1.25rem;
  background: var(--surface2);
  border-left: 4px solid var(--navy);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.content-block.disclaimer p {
  font-size: 0.9375rem;
  margin: 0;
}
.back-link {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.back-link a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.back-link a:hover { text-decoration: underline; }

.steps-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  counter-reset: step;
}
.step-item {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  counter-increment: step;
}
.step-num {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--navy);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
}
.step-item h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: var(--navy);
  font-weight: 700;
}
.step-item p {
  margin: 0;
  color: var(--text);
  line-height: 1.7;
  font-size: 0.9375rem;
}
.step-item a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.step-item a:hover { text-decoration: underline; }
