/* ==========================================================================
   Mental Math Speed Training (Luyện Tính Nhẩm Nhanh) - Privacy Policy Stylesheet
   Designed for Innofly
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
  /* Brand Palette (Mental Math App Colors: Vivid Blue, Math Gold & Mint Green) */
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --primary-light: #3b82f6;
  --primary-soft: #eff6ff;
  --primary-subtle: #dbeafe;
  --accent-gold: #f59e0b;
  --accent-gold-soft: #fef3c7;
  --accent-mint: #10b981;
  --accent-mint-soft: #ecfdf5;

  /* Surfaces & Backgrounds */
  --bg: #f8fafc;
  --bg-band: #0f172a;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --surface-hover: #f1f5f9;

  /* Typography & Neutral Shades */
  --text: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --border: #e2e8f0;
  --border-light: #f1f5f9;

  /* Elevation & Shape */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px -4px rgba(37, 99, 235, 0.08), 0 3px 8px -2px rgba(15, 23, 42, 0.03);
  --shadow-card: 0 20px 48px -12px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.02);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 9999px;

  /* Typography Stacks */
  --font-heading: 'Fredoka', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* --------------------------------------------------------------------------
   Dark Mode Support
   -------------------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --bg-band: #030712;
    --surface: #1e293b;
    --surface-subtle: #162032;
    --surface-hover: #26354a;

    --text: #f8fafc;
    --text-muted: #94a3b8;
    --text-subtle: #64748b;
    --border: #334155;
    --border-light: #1e293b;

    --primary-soft: #172554;
    --primary-subtle: #1e3a8a;
    --accent-gold-soft: #451a03;
    --accent-mint-soft: #064e3b;

    --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.5);
    --shadow-card: 0 20px 48px -12px rgba(0, 0, 0, 0.6);
  }
}

/* --------------------------------------------------------------------------
   Base & Resets
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: 72px;
}

a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease, text-decoration 0.15s ease;
  overflow-wrap: anywhere;
}

a:hover {
  color: var(--primary-strong);
  text-decoration: underline;
}

a:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   Header / Hero Banner
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  background:
    radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.35) 0%, transparent 40%),
    radial-gradient(circle at 88% 85%, rgba(245, 158, 11, 0.22) 0%, transparent 42%),
    linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #2563eb 100%);
  color: #ffffff;
  padding: 56px 20px 84px;
  overflow: hidden;
}

/* Geometric math accents in hero background */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(rgba(255, 255, 255, 0.08) 1.5px, transparent 1.5px);
  background-size: 32px 32px;
  opacity: 0.6;
  pointer-events: none;
}

.hero-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  position: relative;
  z-index: 1;
}

.app-icon {
  width: 92px;
  height: 92px;
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(255, 255, 255, 0.2);
  background: #ffffff;
  object-fit: cover;
  flex: none;
  transition: transform 0.25s ease;
}

.app-icon:hover {
  transform: translateY(-2px) scale(1.03);
}

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

.eyebrow {
  margin: 0 0 6px;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #93c5fd;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.eyebrow-badge {
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  color: #ffffff;
}

h1 {
  margin: 0 0 10px;
  font-family: var(--font-heading);
  font-size: clamp(32px, 5.5vw, 46px);
  font-weight: 700;
  line-height: 1.15;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.updated {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e0e7ff;
  font-size: 13.5px;
  font-weight: 600;
  width: fit-content;
}

.updated::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
}

/* --------------------------------------------------------------------------
   Layout & Card
   -------------------------------------------------------------------------- */
.page {
  max-width: 860px;
  margin: -48px auto 0;
  padding: 0 18px 40px;
  position: relative;
  z-index: 2;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: clamp(26px, 5vw, 54px);
}

.card > p:first-child {
  margin-top: 0;
}

/* --------------------------------------------------------------------------
   Summary Highlights Box (Executive Overview)
   -------------------------------------------------------------------------- */
.summary-box {
  background: var(--primary-soft);
  border: 1px solid var(--primary-subtle);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  margin: 0 0 34px;
}

.summary-title {
  margin: 0 0 10px;
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.summary-title svg {
  flex-shrink: 0;
}

.summary-box p {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 15.5px;
  line-height: 1.65;
}

.summary-box p:last-child {
  margin-bottom: 0;
}

.summary-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.summary-badge-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-strong);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

/* --------------------------------------------------------------------------
   Table of Contents
   -------------------------------------------------------------------------- */
.toc {
  margin: 0 0 38px;
  padding: 22px 26px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  position: relative;
}

.toc-title {
  margin: 0 0 14px;
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.toc-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 20px;
  border-radius: 4px;
  background: var(--primary);
}

.toc ol {
  margin: 0;
  padding-left: 20px;
  columns: 2 270px;
  column-gap: 32px;
}

.toc li {
  break-inside: avoid;
  padding: 3px 0;
  color: var(--text-muted);
}

.toc a {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}

.toc a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Headings & Content Typography
   -------------------------------------------------------------------------- */
h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--text);
  line-height: 1.3;
  scroll-margin-top: 24px;
}

h2 {
  font-size: clamp(23px, 3.5vw, 29px);
  font-weight: 700;
  margin: 48px 0 16px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

h2::before {
  content: '';
  width: 8px;
  height: 26px;
  border-radius: var(--radius-full);
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-light) 100%);
  flex: none;
}

h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 30px 0 10px;
  color: var(--text);
}

h4 {
  font-size: 17px;
  font-weight: 600;
  margin: 22px 0 8px;
  color: var(--text-muted);
}

p {
  margin: 0 0 16px;
  color: var(--text-muted);
}

strong {
  color: var(--text);
  font-weight: 600;
}

/* Lists & Bullets */
ul {
  margin: 0 0 20px;
  padding-left: 0;
  list-style: none;
}

li {
  position: relative;
  padding-left: 26px;
  margin: 8px 0;
  color: var(--text-muted);
}

li::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 0.65em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
}

li > p {
  margin: 0 0 6px;
}

li ul {
  margin: 8px 0 0;
}

li li::before {
  background: transparent;
  border: 2px solid var(--primary-light);
  width: 6px;
  height: 6px;
}

.toc li {
  padding-left: 0;
}

.toc li::before {
  content: none;
}

/* Code & Permission Tags */
code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  color: var(--primary-strong);
}

/* --------------------------------------------------------------------------
   Definitions List (Grid Format)
   -------------------------------------------------------------------------- */
ul.defs {
  display: grid;
  gap: 12px;
  margin: 20px 0 28px;
}

ul.defs > li {
  margin: 0;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

ul.defs > li:hover {
  transform: translateX(3px);
  border-color: var(--primary-subtle);
}

ul.defs > li::before {
  content: none;
}

ul.defs > li p {
  margin: 0;
  color: var(--text-muted);
  font-size: 15.5px;
}

ul.defs > li strong {
  color: var(--text);
  font-family: var(--font-heading);
  font-size: 16.5px;
  display: inline-block;
  margin-bottom: 2px;
}

/* --------------------------------------------------------------------------
   Third-Party SDK Table
   -------------------------------------------------------------------------- */
.table-container {
  overflow-x: auto;
  margin: 24px 0 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 15px;
}

th, td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

th {
  background: var(--surface-subtle);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 15.5px;
  color: var(--text);
  letter-spacing: 0.01em;
}

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

tbody tr:hover {
  background-color: var(--surface-hover);
}

td small {
  color: var(--text-subtle);
  display: block;
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
footer {
  text-align: center;
  color: var(--text-subtle);
  font-size: 14px;
  padding: 32px 18px 12px;
}

footer p {
  margin: 0 0 6px;
  color: var(--text-subtle);
}

footer a {
  color: var(--text-muted);
}

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

/* --------------------------------------------------------------------------
   Mobile Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  body {
    font-size: 15.5px;
  }

  .hero {
    padding: 38px 16px 68px;
  }

  .hero-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .app-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
  }

  .page {
    margin-top: -38px;
    padding: 0 12px 32px;
  }

  .card {
    padding: 24px 18px;
    border-radius: 18px;
  }

  .toc ol {
    columns: 1;
  }

  ul.defs > li {
    padding: 12px 14px;
  }
}

/* --------------------------------------------------------------------------
   Print Stylesheet
   -------------------------------------------------------------------------- */
@media print {
  :root {
    --bg: #ffffff;
    --bg-band: #ffffff;
    --surface: #ffffff;
    --text: #000000;
    --text-muted: #333333;
    --border: #cccccc;
    --shadow-card: none;
    --shadow-md: none;
  }

  .hero {
    background: #ffffff;
    color: #000000;
    padding: 0 0 20px;
    border-bottom: 2px solid #000000;
  }

  .hero h1, .hero .eyebrow {
    color: #000000;
  }

  .page {
    margin-top: 0;
    max-width: 100%;
    padding: 0;
  }

  .card {
    border: none;
    box-shadow: none;
    padding: 0;
  }

  .toc, .summary-box {
    display: none;
  }

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