@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --primary: #e53935;
  --primary-hover: #d32f2f;
  --primary-light: rgba(229, 57, 53, 0.1);
  --primary-glow: rgba(229, 57, 53, 0.25);
  
  --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
  --bg-color: #f8fafc;
  --card-bg: rgba(255, 255, 255, 0.85);
  --card-border: rgba(226, 232, 240, 0.8);
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;
  --sidebar-bg: rgba(255, 255, 255, 0.7);
  --header-bg: rgba(255, 255, 255, 0.9);
  
  --badge-bg: #fee2e2;
  --badge-text: #991b1b;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 20px -2px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.12);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #090d16 100%);
  --bg-color: #0f172a;
  --card-bg: rgba(30, 41, 59, 0.75);
  --card-border: rgba(51, 65, 85, 0.6);
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-light: #94a3b8;
  --sidebar-bg: rgba(30, 41, 59, 0.6);
  --header-bg: rgba(15, 23, 42, 0.85);
  --badge-bg: rgba(229, 57, 53, 0.2);
  --badge-text: #fca5a5;
  --shadow-md: 0 4px 20px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
}

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

html {
  scroll-behavior: smooth;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.65;
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* Header & Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
  padding: 0.85rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary) 0%, #b91c1c 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  box-shadow: 0 4px 12px var(--primary-glow);
}

img.brand-icon {
  width: 120px;
  height: 38px;
  background: #ffffff;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  object-fit: contain;
  transition: var(--transition);
}

img.brand-icon:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.brand-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-title span {
  color: var(--primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-tabs {
  display: flex;
  background: var(--primary-light);
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 4px;
}

.tab-btn {
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tab-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.theme-toggle {
  background: var(--primary-light);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition);
}

.theme-toggle:hover {
  transform: translateY(-2px);
  background: var(--primary-glow);
}

/* Container & Layout */
.hero {
  text-align: center;
  padding: 3rem 1.5rem 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--badge-bg);
  color: var(--badge-text);
  padding: 0.35rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.15rem;
  max-width: 680px;
  margin: 0 auto 1.5rem;
}

.meta-info {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  color: var(--text-light);
  font-size: 0.88rem;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Search Bar */
.search-container {
  max-width: 600px;
  margin: 1.5rem auto 0;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.9rem 1.2rem 0.9rem 2.8rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-main);
  font-size: 0.95rem;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
}

/* Main Content Layout */
.main-wrapper {
  max-width: 1240px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
}

@media (max-width: 992px) {
  .main-wrapper {
    grid-template-columns: 1fr;
  }
}

/* Sidebar Navigation */
.sidebar {
  position: sticky;
  top: 90px;
  height: fit-content;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  background: var(--sidebar-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
}

.sidebar h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.toc-item a {
  display: block;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.toc-item a:hover,
.toc-item a.active {
  background: var(--primary-light);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}

/* Document Content */
.doc-content {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.policy-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  scroll-margin-top: 100px;
}

.policy-card:hover {
  box-shadow: var(--shadow-lg);
}

.policy-card h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.policy-card h2 .sec-num {
  color: var(--primary);
}

.policy-card p {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.policy-card ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.policy-card li {
  position: relative;
  padding-left: 1.6rem;
  color: var(--text-muted);
  font-size: 0.96rem;
}

.policy-card li::before {
  content: "•";
  color: var(--primary);
  font-size: 1.4rem;
  position: absolute;
  left: 0.4rem;
  top: -0.25rem;
}

/* Callout Alert Box (Account Deletion & DPDP Compliance) */
.callout {
  background: var(--primary-light);
  border: 1px solid rgba(229, 57, 53, 0.3);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 1rem 0;
}

.callout h4 {
  color: var(--primary);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.callout p {
  color: var(--text-main);
  font-size: 0.94rem;
  margin-bottom: 0.5rem;
}

.callout-steps {
  background: rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
}

[data-theme="dark"] .callout-steps {
  background: rgba(0, 0, 0, 0.2);
}

/* Grid Box */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

@media (max-width: 600px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.grid-box {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
}

[data-theme="dark"] .grid-box {
  background: rgba(255, 255, 255, 0.03);
}

.grid-box h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.grid-box p {
  font-size: 0.88rem;
  margin-bottom: 0;
}

/* Footer */
footer {
  background: var(--header-bg);
  border-top: 1px solid var(--card-border);
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--text-light);
  font-size: 0.9rem;
}

footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

footer a:hover {
  text-decoration: underline;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

/* Quick Floating Action Button for Back to Top */
.back-to-top {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 15px var(--primary-glow);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 99;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-3px);
  background: var(--primary-hover);
}

/* Print CSS */
@media print {
  .navbar, .sidebar, .theme-toggle, .search-container, .back-to-top, footer {
    display: none !important;
  }
  body {
    background: white !important;
    color: black !important;
  }
  .main-wrapper {
    display: block !important;
    padding: 0 !important;
  }
  .policy-card {
    border: none !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    padding: 1rem 0 !important;
  }
}
