@import url("https://fonts.googleapis.com/css2?family=Berkshire+Swash&family=Google+Sans+Flex:opsz,wght@6..144,1..1000&family=Varela+Round&display=swap");

:root {
  --primary-color: #371011;
  --primary-light: #5c2022;
  --primary-rgb: 55, 16, 17;
  --surface-color: #fbfaf3;
  --surface-card: #ffffff;
  --text-primary: #212529;
  --text-muted: #6c757d;
  --accent-color: #d4af37; /* Metallic Gold */
  --accent-warm: #e6b940;
  --border-color: rgba(55, 16, 17, 0.08);
  --hover-transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --font-sans:
    "Google Sans Flex", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --font-serif: "Berkshire Swash", cursive;
}

html,
body {
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--surface-color);
  color: var(--text-primary);
  line-height: 1.7;
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--surface-color);
}
::-webkit-scrollbar-thumb {
  background: rgba(55, 16, 17, 0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* Premium Typography styling */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--primary-color);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-x {
  font-family: var(--font-serif);
  color: inherit;
  display: inline-block;
  font-weight: normal;
  text-transform: none;
  margin-left: 2px;
}

/* Navbar */
.navbar {
  background-color: var(--surface-card);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 15px rgba(55, 16, 17, 0.03);
  padding: 1rem 0;
  z-index: 1030;
}

.navbar-brand {
  font-weight: 800;
  font-size: 1.85rem;
  color: var(--primary-color);
  display: flex;
  align-items: center;
}

.navbar-brand img {
  height: 52px;
  margin-right: 14px;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(55, 16, 17, 0.08);
}

.nav-btn {
  background-color: var(--primary-color);
  color: #ffffff;
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  transition: var(--hover-transition);
}

.nav-btn:hover {
  background-color: var(--primary-light);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(55, 16, 17, 0.15);
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, var(--primary-color) 0%, #1e0506 100%);
  color: #ffffff;
  padding: 5rem 0 4rem 0;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    circle at 80% 20%,
    rgba(212, 175, 55, 0.15) 0%,
    transparent 50%
  );
  pointer-events: none;
}

.hero-section h1 {
  color: #ffffff;
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.hero-section p {
  color: rgba(251, 250, 243, 0.8);
  font-size: 1.15rem;
  max-width: 600px;
}

.badge-update {
  background-color: rgba(212, 175, 55, 0.2);
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  padding: 0.4rem 0.8rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 1.5rem;
}

/* Search bar styling */
.search-wrapper {
  position: relative;
  max-width: 500px;
  margin-top: 1.5rem;
}

.search-input {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border-radius: 30px;
  padding: 0.75rem 1.5rem 0.75rem 3rem;
  font-size: 0.95rem;
  width: 100%;
  backdrop-filter: blur(10px);
  transition: var(--hover-transition);
}

.search-input:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--accent-color);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
  outline: none;
  color: #ffffff;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.search-icon {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.5);
}

/* Content Layout */
.main-container {
  padding: 3rem 0;
}

/* Sidebar Navigation */
.sidebar-sticky {
  position: sticky;
  top: 30px;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  padding-right: 1rem;
}

.toc-card {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(55, 16, 17, 0.02);
}

.toc-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toc-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-left: 3px solid transparent;
  transition: var(--hover-transition);
  border-radius: 0 8px 8px 0;
}

.toc-link:hover {
  color: var(--primary-color);
  background-color: rgba(55, 16, 17, 0.03);
  border-left-color: rgba(55, 16, 17, 0.3);
  padding-left: 0.9rem;
}

.toc-link.active {
  color: var(--primary-color);
  background-color: rgba(55, 16, 17, 0.05);
  border-left-color: var(--primary-color);
  font-weight: 700;
  padding-left: 0.9rem;
}

/* Policy Content Layout */

/* Policy Content Details */
.policy-card {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 4px 30px rgba(55, 16, 17, 0.02);
}

.policy-section {
  padding-top: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.policy-section:first-child {
  padding-top: 0;
}

.policy-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.policy-section h2 {
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background-color: rgba(55, 16, 17, 0.06);
  color: var(--primary-color);
  border-radius: 8px;
  font-size: 1.1rem;
  transition: var(--hover-transition);
}

.policy-section:hover .section-icon {
  background-color: var(--primary-color);
  color: #ffffff;
  transform: rotate(5deg) scale(1.05);
}

/* Highlight style for search functionality */
.search-highlight {
  background-color: rgba(212, 175, 55, 0.3);
  border-bottom: 2px solid var(--accent-color);
  padding: 0 2px;
  border-radius: 2px;
}

/* Tables in Policy */
.policy-table-wrapper {
  margin: 1.5rem 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.policy-table {
  margin-bottom: 0;
  width: 100%;
}

.policy-table th {
  background-color: rgba(55, 16, 17, 0.04);
  color: var(--primary-color);
  font-weight: 700;
  border-bottom: 2px solid var(--border-color);
  padding: 0.85rem 1.2rem;
}

.policy-table td {
  padding: 0.85rem 1.2rem;
  border-bottom: 1px solid var(--border-color);
}

.policy-table tr:last-child td {
  border-bottom: none;
}

/* Cards & Alerts */
.policy-alert {
  background-color: rgba(212, 175, 55, 0.08);
  border-left: 4px solid var(--accent-color);
  color: #584a22;
  padding: 1.25rem;
  border-radius: 0 12px 12px 0;
  margin: 1.5rem 0;
}

.policy-alert-danger {
  background-color: rgba(220, 53, 69, 0.05);
  border-left: 4px solid #dc3545;
  color: #842029;
  padding: 1.25rem;
  border-radius: 0 12px 12px 0;
  margin: 1.5rem 0;
}

.card-item-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.list-item-card {
  background-color: rgba(55, 16, 17, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: var(--hover-transition);
}

.list-item-card:hover {
  transform: translateY(-2px);
  background-color: rgba(55, 16, 17, 0.04);
  border-color: rgba(55, 16, 17, 0.15);
}

.list-item-card i {
  color: var(--accent-color);
  font-size: 1.2rem;
}

/* Modals */
.modal-content {
  background-color: var(--surface-color);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 40px rgba(55, 16, 17, 0.15);
}

.modal-header {
  border-bottom: 1px solid var(--border-color);
  padding: 1.5rem;
}

.modal-footer {
  border-top: 1px solid var(--border-color);
  padding: 1.5rem;
}

.form-control,
.form-select {
  border: 1px solid rgba(55, 16, 17, 0.15);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  transition: var(--hover-transition);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem rgba(55, 16, 17, 0.1);
}

/* Footer styling */
footer {
  background-color: #1e0506;
  color: #ffffff;
  padding: 4rem 0 2rem 0;
  margin-top: 5rem;
  position: relative;
}

footer h1,
footer h2,
footer h3,
footer h4,
footer h5,
footer h6 {
  color: #ffffff !important;
}

footer a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: var(--hover-transition);
}

footer a:hover {
  color: var(--accent-color);
}

.footer-logo {
  font-weight: 800;
  font-size: 1.5rem;
  color: #ffffff;
  margin-bottom: 1rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 2rem;
  margin-top: 3rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.5);
}

/* WebView / Mobile App Mode overrides */
body.webview-mode {
  background-color: var(--surface-color);
}
body.webview-mode .navbar,
body.webview-mode .hero-section,
body.webview-mode footer {
  display: none !important;
}
body.webview-mode .main-container {
  padding: 1rem 0 !important;
}
body.webview-mode .policy-card {
  border: none !important;
  box-shadow: none !important;
  padding: 1rem !important;
  background: transparent !important;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
  aside.col-lg-3 {
    position: sticky;
    top: 0;
    z-index: 1020;
    background-color: var(--surface-color);
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 10px rgba(55, 16, 17, 0.02);
    max-width: 100vw;
    width: 100%;
    overflow-x: hidden;
  }

  body.webview-mode aside.col-lg-3 {
    top: 0 !important;
  }

  .sidebar-sticky {
    position: static !important;
    margin-bottom: 0 !important;
    padding: 0.5rem 0;
    max-height: none;
    overflow-y: visible;
    max-width: 100%;
  }

  .toc-card {
    padding: 0.25rem 0.5rem;
    border: none;
    box-shadow: none;
    background: transparent;
    border-radius: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .toc-title {
    display: none;
  }

  .toc-nav {
    display: flex;
    flex-direction: row !important;
    overflow-x: auto;
    white-space: nowrap;
    gap: 0.5rem;
    padding-bottom: 0.25rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  .toc-nav::-webkit-scrollbar {
    display: none; /* Hide scrollbar for a cleaner mobile app look */
  }

  .toc-link {
    border-left: none !important;
    border-bottom: 2px solid transparent;
    border-radius: 20px !important;
    padding: 0.4rem 1rem !important;
    font-size: 0.85rem;
    background-color: rgba(55, 16, 17, 0.04);
    scroll-snap-align: start;
  }

  .toc-link:hover {
    padding-left: 1rem !important;
    background-color: rgba(55, 16, 17, 0.08);
  }

  .toc-link.active {
    border-bottom-color: var(--primary-color);
    background-color: var(--primary-color);
    color: #ffffff !important;
    padding-left: 1rem !important;
    font-weight: 600;
  }

  .hero-section {
    padding: 3rem 0;
  }

  .hero-section h1 {
    font-size: 2.25rem;
  }

  .search-wrapper {
    margin-top: 1rem;
    max-width: 100%;
  }

  .policy-card {
    padding: 1.5rem;
    border-radius: 16px;
  }

  .policy-section h2 {
    font-size: 1.35rem;
  }

  /* Wrap tables on small devices to prevent overflow */
  .policy-table-wrapper {
    overflow-x: auto;
  }

  .policy-table th,
  .policy-table td {
    padding: 0.75rem 0.9rem;
    font-size: 0.88rem;
  }

  .card-item-list {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 0.75rem;
  }

  .list-item-card {
    padding: 0.85rem 1rem;
  }
}

@media (max-width: 575.98px) {
  .hero-section h1 {
    font-size: 1.85rem;
  }
  .hero-section p {
    font-size: 1rem;
  }
  .policy-card {
    padding: 1rem;
    border: none;
    box-shadow: none;
    background: transparent;
  }
  .policy-section {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }
}

/* ==========================================================================
   Landing Page specific styles (index.html)
   ========================================================================== */

:root {
  --saffron: #e8600a;
  --gold-lt: #f0b435;
  --brown: #5c2e0e;
  --brown-md: #7a3f18;
  --x-red: #371011;
  --white: #ffffff;
  --white-dim: rgba(255, 255, 255, 0.55);
  --white-faint: rgba(255, 255, 255, 0.18);
}

/* Scoped Landing HTML/Body resets */
html.landing-html {
  height: 100%;
  overflow: hidden;
}

body.landing-page {
  height: 100%;
  background: var(--brown) !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-family: "Google Sans Flex", "Google Sans", sans-serif !important;
  position: relative;
  margin: 0;
  padding: 0;
}

body.landing-page *,
body.landing-page *::before,
body.landing-page *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.landing-page .glow {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 700px;
  height: 700px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(232, 96, 10, 0.16) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

.landing-page .bg-mandala {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 0;
  opacity: 0.08;
}

.landing-page .bg-mandala svg {
  width: min(960px, 140vw);
  height: min(960px, 140vw);
  animation: slow-spin 140s linear infinite;
}

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

.landing-page .grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.28;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
}

.landing-page .center {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem;
  animation: rise 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  transform: translateY(28px);
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.landing-page .app-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: contain;
  margin-bottom: 2rem;
  opacity: 0;
  animation: logo-in 1s 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  outline: 1.5px solid var(--white-faint);
  background: var(--brown-md);
}

@keyframes logo-in {
  to {
    opacity: 1;
  }
}

.landing-page .om {
  font-family: "Berkshire Swash", serif;
  font-size: 1.6rem;
  color: var(--gold-lt);
  line-height: 1;
  margin-bottom: 1rem;
  animation: glow-pulse 4s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%,
  100% {
    opacity: 0.75;
  }
  50% {
    opacity: 1;
  }
}

.landing-page .rule {
  width: 48px;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--saffron),
    transparent
  );
  margin-bottom: 1.4rem;
}

.landing-page .brand {
  font-size: clamp(3.2rem, 11vw, 6rem);
  line-height: 1;
  color: var(--white);
  display: flex;
  align-items: baseline;
  gap: 0.3em;
}

.landing-page .brand .sanathan {
  font-family: "Google Sans Flex", "Google Sans", sans-serif;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.landing-page .brand .x {
  font-family: "Berkshire Swash", serif;
  color: var(--x-red);
  text-shadow:
    -0.4px -0.8px 0 #ffffff,
    0.4px -0.8px 0 #ffffff,
    -0.4px 0.8px 0 #ffffff,
    0.4px 0.8px 0 #ffffff;
  font-size: 1.15em;
}

.landing-page .dot-rule {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 1.1rem 0 1rem;
}

.landing-page .dot-rule .d {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--white-faint);
}

.landing-page .dot-rule .d.mid {
  width: 6px;
  height: 6px;
  background: var(--saffron);
  opacity: 0.6;
}

.landing-page .tagline {
  font-family: "Google Sans Flex", "Google Sans", sans-serif;
  font-size: clamp(0.85rem, 2.5vw, 1.05rem);
  font-weight: 300;
  color: var(--white);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.65;
}

/* Nav buttons */
.landing-page .nav-buttons {
  display: flex;
  gap: 12px;
  margin-top: 2.2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.landing-page .nav-btn {
  font-family: "Google Sans Flex", "Google Sans", sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--white);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 0.5rem 1.2rem;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.2s,
    border-color 0.2s;
  opacity: 0;
  animation: fade-in 0.6s ease forwards;
}

.landing-page .nav-btn:nth-child(1) {
  animation-delay: 1.2s;
}

.landing-page .nav-btn:nth-child(2) {
  animation-delay: 1.4s;
}

.landing-page .nav-btn:nth-child(3) {
  animation-delay: 1.6s;
}

.landing-page .nav-btn:hover {
  background: rgba(232, 96, 10, 0.18);
  border-color: rgba(232, 96, 10, 0.5);
}

/* Store buttons */
.landing-page .store-buttons {
  display: flex;
  gap: 12px;
  margin-top: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  opacity: 0;
  animation: fade-in 0.6s 1.9s ease forwards;
}

.landing-page .store-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Google Sans Flex", "Google Sans", sans-serif;
  color: var(--white);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  padding: 0.55rem 1.1rem;
  transition:
    background 0.2s,
    border-color 0.2s;
}

.landing-page .store-btn:hover {
  background: rgba(232, 96, 10, 0.18);
  border-color: rgba(232, 96, 10, 0.5);
}

.landing-page .store-btn svg {
  flex-shrink: 0;
}

.landing-page .store-btn-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.landing-page .store-btn-text small {
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.7;
}

.landing-page .store-btn-text strong {
  font-size: 0.92rem;
  font-weight: 600;
}

/* Lotus row */
.landing-page .lotus-row {
  position: fixed;
  bottom: 2.2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  animation: fade-in 1s 1.2s ease forwards;
}

@keyframes fade-in {
  to {
    opacity: 1;
  }
}

.landing-page .lotus-row .ld {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(232, 96, 10, 0.4);
}

.landing-page .lotus-row .ld.c {
  width: 7px;
  height: 7px;
  background: rgba(232, 96, 10, 0.75);
}
