/* Supreme Court of India Chambers - Main Stylesheet */
:root {
  --primary-navy: #0b1a30;
  --secondary-navy: #15294a;
  --dark-navy: #060e1a;
  --gold-accent: #c5a059;
  --gold-light: #dfbe7d;
  --gold-hover: #b38e45;
  --gold-subtle: rgba(197, 160, 89, 0.12);
  --gold-border: rgba(197, 160, 89, 0.3);
  
  --bg-parchment: #f9fbfd;
  --bg-card: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --border-subtle: #e2e8f0;
  --shadow-sm: 0 2px 8px rgba(11, 26, 48, 0.04);
  --shadow-md: 0 8px 24px rgba(11, 26, 48, 0.08);
  --shadow-lg: 0 16px 40px rgba(11, 26, 48, 0.12);
  --shadow-gold: 0 8px 25px rgba(197, 160, 89, 0.25);
  
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-parchment);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 26, 48, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gold-border);
  padding: 0.95rem 2rem;
}

.nav-container {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-emblem {
  display: flex;
  align-items: center;
  gap: 14px;
}

.court-crest {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--gold-accent), #8b6b2a);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0b1a30;
  font-size: 1.35rem;
  box-shadow: 0 0 16px rgba(197, 160, 89, 0.4);
}

.brand-text h1 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  color: #ffffff;
  font-weight: 700;
}

.brand-text p {
  font-size: 0.76rem;
  color: var(--gold-light);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.8rem;
}

.nav-links a {
  color: #e2e8f0;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a:hover {
  color: var(--gold-light);
}

.btn-header-track {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(197, 160, 89, 0.35);
  color: var(--gold-light) !important;
  font-size: 0.88rem !important;
  font-weight: 600;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-header-track:hover {
  background: var(--gold-subtle);
  border-color: var(--gold-accent);
}

/* Hero Section */
.hero-section {
  position: relative;
  background: linear-gradient(180deg, var(--primary-navy) 0%, var(--secondary-navy) 65%, #183354 100%);
  color: #ffffff;
  padding: 3.5rem 2rem 4rem;
  overflow: hidden;
}

.hero-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(rgba(197, 160, 89, 0.12) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.hero-container {
  max-width: 1300px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 3rem;
  align-items: center;
}

.hero-intro {
  display: flex;
  flex-direction: column;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(197, 160, 89, 0.15);
  border: 1px solid var(--gold-border);
  color: var(--gold-light);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.35rem 1rem;
  border-radius: 50px;
  margin-bottom: 1.2rem;
  align-self: flex-start;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  line-height: 1.22;
  margin-bottom: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hero-title span {
  background: linear-gradient(135deg, #ffffff 40%, var(--gold-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.08rem;
  color: #cbd5e1;
  line-height: 1.65;
  margin-bottom: 1.8rem;
}

.hero-trust-badges {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 2rem;
}

.trust-badge-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: #e2e8f0;
}

.trust-badge-row span.icon {
  font-size: 1.2rem;
}

/* Key Highlights Counter */
.hero-stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  border-top: 1px solid rgba(197, 160, 89, 0.25);
  padding-top: 1.5rem;
}

.stat-item h3 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--gold-light);
  margin-bottom: 0.2rem;
}

.stat-item p {
  font-size: 0.78rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Privacy & Security Guarantee Banner */
.privacy-banner-section {
  max-width: 1300px;
  margin: -1.5rem auto 3rem;
  padding: 0 1.5rem;
  position: relative;
  z-index: 10;
}

.privacy-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 1.4rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.privacy-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.privacy-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #ecfdf5;
  color: #059669;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.privacy-text h4 {
  font-size: 1rem;
  color: var(--primary-navy);
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.privacy-text p {
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.privacy-features {
  display: flex;
  gap: 1.8rem;
  font-size: 0.82rem;
  color: #334155;
  font-weight: 600;
}

.privacy-feat-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* About AOR Section (Simple English) */
.about-aor-section {
  max-width: 1200px;
  margin: 4rem auto;
  padding: 0 1.5rem;
}

.aor-card {
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  border: 1px solid var(--border-subtle);
  border-left: 6px solid var(--gold-accent);
  border-radius: var(--radius-md);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
}

.aor-card h2 {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  color: var(--primary-navy);
  margin-bottom: 1rem;
}

.aor-card p {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.4rem;
}

.aor-benefits-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.aor-benefit {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1.2rem;
}

.aor-benefit h4 {
  font-size: 0.95rem;
  color: var(--primary-navy);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.aor-benefit p {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-bottom: 0;
  line-height: 1.5;
}

/* Practice Areas Grid (Everyday Citizens) */
.practice-section {
  background: #ffffff;
  padding: 5rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 3.5rem;
}

.section-subtitle {
  color: var(--gold-hover);
  font-size: 0.85rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  color: var(--primary-navy);
  margin-bottom: 0.8rem;
}

.section-desc {
  font-size: 1rem;
  color: var(--text-secondary);
}

.practice-grid {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.8rem;
}

.practice-card {
  padding: 1.8rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: #fafcff;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.practice-card:hover {
  border-color: var(--gold-border);
  box-shadow: var(--shadow-md);
  background: #ffffff;
  transform: translateY(-4px);
}

.practice-icon {
  font-size: 2.2rem;
  margin-bottom: 1rem;
}

.practice-card h3 {
  font-family: var(--font-serif);
  font-size: 1.22rem;
  color: var(--primary-navy);
  margin-bottom: 0.6rem;
}

.practice-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.2rem;
  flex: 1;
}

.btn-card-consult {
  margin-top: auto;
  background: transparent;
  border: 1px solid var(--primary-navy);
  color: var(--primary-navy);
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
}

.btn-card-consult:hover {
  background: var(--primary-navy);
  color: #ffffff;
}

/* How It Works (3 Steps) */
.steps-section {
  max-width: 1200px;
  margin: 5rem auto;
  padding: 0 1.5rem;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.step-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2rem 1.8rem;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold-accent);
  color: var(--primary-navy);
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.2rem;
}

.step-card h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--primary-navy);
  margin-bottom: 0.6rem;
}

.step-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Footer */
.site-footer {
  background: var(--dark-navy);
  color: #94a3b8;
  padding: 4rem 2rem 2rem;
  border-top: 1px solid rgba(197, 160, 89, 0.2);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
  margin-bottom: 2.5rem;
}

.footer-brand h2 {
  font-family: var(--font-serif);
  color: #ffffff;
  font-size: 1.35rem;
  margin-bottom: 0.8rem;
}

.footer-brand p {
  font-size: 0.88rem;
  line-height: 1.6;
}

.footer-disclaimer h4 {
  color: var(--gold-light);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.8rem;
}

.footer-disclaimer p {
  font-size: 0.78rem;
  line-height: 1.65;
  color: #64748b;
  text-align: justify;
}

.disclaimer-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  line-height: 1.6;
  max-width: 1200px;
  margin: 0 auto 2rem;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1.5rem;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(6, 14, 26, 0.75);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  max-width: 580px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  animation: modalIn 0.25s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header {
  padding: 1.2rem 1.6rem;
  background: var(--primary-navy);
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--gold-light);
}

.modal-close-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 1.6rem;
}

.modal-footer {
  padding: 1rem 1.6rem;
  background: #f8fafc;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
}

/* Responsive */
@media (max-width: 1024px) {
  .hero-container { grid-template-columns: 1fr; gap: 2.5rem; }
  .aor-benefits-grid { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .hero-title { font-size: 2.1rem; }
  .privacy-card { flex-direction: column; align-items: flex-start; }
  .footer-content { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .nav-links { display: none; }
  .footer-content { grid-template-columns: 1fr; }
}

/* Markdown Rendered Typography */
.markdown-body {
  font-family: inherit;
  font-size: inherit;
  line-height: 1.6;
  color: inherit;
  word-break: break-word;
}
.markdown-body p {
  margin: 0 0 0.6rem 0;
}
.markdown-body p:last-child {
  margin-bottom: 0;
}
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
  font-family: var(--font-serif);
  font-weight: 700;
  margin: 0.9rem 0 0.4rem 0;
  color: inherit;
  line-height: 1.35;
}
.markdown-body h1:first-child, .markdown-body h2:first-child, .markdown-body h3:first-child, .markdown-body h4:first-child {
  margin-top: 0;
}
.markdown-body h1 { font-size: 1.25rem; }
.markdown-body h2 { font-size: 1.15rem; }
.markdown-body h3 { font-size: 1.05rem; }
.markdown-body h4 { font-size: 0.95rem; }
.markdown-body ul, .markdown-body ol {
  margin: 0.4rem 0 0.7rem 1.4rem;
  padding: 0;
}
.markdown-body li {
  margin-bottom: 0.3rem;
  line-height: 1.55;
}
.markdown-body strong {
  font-weight: 700;
}
.markdown-body hr {
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  margin: 0.9rem 0;
}
.markdown-body blockquote {
  border-left: 3px solid var(--gold-accent);
  padding-left: 0.8rem;
  margin: 0.6rem 0;
  color: #475569;
  font-style: italic;
}
.markdown-body code {
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
  font-family: monospace;
}

/* ===== Shared polish: scrollbars, toasts, chat helpers ===== */
.chat-window, .chat-messages-body, #adminChatMessages, #modalTranscriptContent {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.chat-window::-webkit-scrollbar, .chat-messages-body::-webkit-scrollbar,
#adminChatMessages::-webkit-scrollbar, #modalTranscriptContent::-webkit-scrollbar { width: 8px; }
.chat-window::-webkit-scrollbar-thumb, .chat-messages-body::-webkit-scrollbar-thumb,
#adminChatMessages::-webkit-scrollbar-thumb, #modalTranscriptContent::-webkit-scrollbar-thumb {
  background: #cbd5e1; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box;
}
.chat-window::-webkit-scrollbar-thumb:hover, .chat-messages-body::-webkit-scrollbar-thumb:hover,
#adminChatMessages::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: padding-box; border: 2px solid transparent; }

/* Markdown inside chat bubbles: never inherit pre-wrap (stops blank-line stretching) */
.markdown-body { white-space: normal; }
.markdown-body > :first-child { margin-top: 0 !important; }
.markdown-body > :last-child { margin-bottom: 0 !important; }
.markdown-body a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.markdown-body table { border-collapse: collapse; margin: 0.5rem 0; font-size: 0.9em; }
.markdown-body th, .markdown-body td { border: 1px solid rgba(100,116,139,0.35); padding: 0.3rem 0.6rem; }
.markdown-body pre { background: rgba(0,0,0,0.06); padding: 0.6rem 0.8rem; border-radius: 6px; overflow-x: auto; }

/* Day separators in chat threads */
.chat-date-sep {
  align-self: center; display: flex; align-items: center; gap: 10px; width: 100%;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #94a3b8;
}
.chat-date-sep::before, .chat-date-sep::after { content: ''; flex: 1; height: 1px; background: #e2e8f0; }

/* Toast notifications */
.toast-stack { position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 3000; display: flex; flex-direction: column; gap: 0.6rem; }
.toast {
  display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 380px;
  padding: 0.8rem 1.1rem; border-radius: 10px; background: #0b1a30; color: #fff; font-size: 0.88rem; font-weight: 600;
  border-left: 4px solid var(--gold-accent); box-shadow: 0 12px 32px rgba(6,14,26,0.35);
  animation: toastIn 0.28s ease-out; transition: opacity 0.3s, transform 0.3s;
}
.toast.success { border-left-color: #10b981; }
.toast.error { border-left-color: #ef4444; }
.toast.hide { opacity: 0; transform: translateX(20px); }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
