/* ============================
   NODAAR APP GUIDE - STYLES
============================ */

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

:root {
  --navy: #0B1E3F;
  --navy-light: #142B57;
  --orange: #F59E0B;
  --orange-light: #FBBF24;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-500: #6B7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --white: #FFFFFF;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
  --radius: 14px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Poppins', sans-serif;
  background: #525659; /* Document viewer background */
  color: var(--gray-900);
  line-height: 1.6;
  counter-reset: page 1;
}

/* ============================
   PAGE HEADER & FOOTER
============================ */
.page-header {
  position: absolute;
  top: 30px;
  left: 60px;
  right: 60px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--gray-500);
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.page-footer {
  position: absolute;
  bottom: 30px;
  left: 60px;
  right: 60px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--gray-500);
  border-top: 1px solid var(--gray-200);
  padding-top: 10px;
}

/* ============================
   FLOATING PRINT BTN
============================ */
.print-btn {
  position: fixed;
  top: 30px;
  right: 30px;
  z-index: 1000;
  padding: 12px 24px;
  background: var(--orange);
  color: var(--navy);
  border: none;
  border-radius: 50px;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  transition: transform 0.2s, background 0.2s;
}

.print-btn:hover {
  background: var(--orange-light);
  transform: translateY(-2px);
}

/* ============================
   MAIN
============================ */
main {
  width: 100%;
  padding: 40px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

/* ============================
   COVER PAGE
============================ */
.cover {
  width: 100%;
  max-width: 850px;
  min-height: 1100px; /* A4 aspect approximation */
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  border-radius: 4px;
}

.cover::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(245,158,11,0.15) 0%, transparent 70%);
  top: -200px;
  right: -200px;
  border-radius: 50%;
}

.cover::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(245,158,11,0.1) 0%, transparent 70%);
  bottom: -100px;
  left: -100px;
  border-radius: 50%;
}

.cover-content {
  position: relative;
  z-index: 2;
}

.cover h1 {
  font-family: 'Poppins', sans-serif;
  font-size: 96px;
  font-weight: 800;
  letter-spacing: -2px;
  margin-bottom: 10px;
}

.cover h1::first-letter {
  color: var(--orange);
}

.cover h2 {
  font-size: 36px;
  font-weight: 300;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 20px;
}

.cover p {
  font-size: 18px;
  opacity: 0.8;
  margin-bottom: 40px;
}

.version {
  display: inline-block;
  padding: 8px 20px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50px;
  font-size: 13px;
  letter-spacing: 2px;
}

/* ============================
   CHAPTERS
============================ */
.chapter {
  width: 100%;
  max-width: 850px;
  min-height: 1100px;
  padding: 100px 60px 80px 60px;
  background: var(--white);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  border-radius: 4px;
  position: relative;
  counter-increment: page;
}

.page-footer .page-num::after {
  content: "Page " counter(page);
}

.chapter-tag {
  display: inline-block;
  background: var(--orange);
  color: var(--navy);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.chapter h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 42px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 20px;
  letter-spacing: -1px;
}

.chapter h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 20px;
  color: var(--navy);
  margin: 24px 0 12px;
  font-weight: 600;
}

.chapter h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 10px;
}

.chapter ul {
  list-style: none;
  padding: 0;
}

.chapter ul li {
  padding: 8px 0 8px 28px;
  position: relative;
  color: var(--gray-700);
  font-size: 15px;
}

.chapter ul li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--orange);
  font-weight: 700;
  background: rgba(245,158,11,0.1);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  top: 10px;
}

.lead {
  font-size: 18px;
  color: var(--gray-700);
  margin-bottom: 30px;
  max-width: 800px;
}

/* ============================
   TOC LIST
============================ */
.toc-list {
  list-style: none;
  padding: 0;
}
.toc-list li {
  margin-bottom: 12px;
}
.toc-list a {
  text-decoration: none;
  color: var(--navy);
  font-size: 18px;
  font-weight: 500;
  display: block;
  transition: color 0.2s;
  border-bottom: 1px dotted var(--gray-300);
  padding-bottom: 4px;
}
.toc-list a:hover {
  color: var(--orange);
}

/* ============================
   SCREEN ROW (screenshot + info)
============================ */
.screen-row {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 50px;
  align-items: start;
  margin-top: 30px;
}

.screen-img {
  background: linear-gradient(135deg, var(--gray-100), var(--white));
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
}

.screen-img img {
  width: 100%;
  border-radius: 12px;
  display: block;
}

.screen-info {
  padding-top: 10px;
}

/* ============================
   CARDS GRID
============================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--orange);
}

.card-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 18px;
}

.card h3 {
  margin-bottom: 10px;
  color: var(--navy);
}

.card p {
  color: var(--gray-500);
  font-size: 14px;
}

/* ============================
   TWO COLUMN MINI CARDS
============================ */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.mini-card {
  padding: 20px;
  border-radius: 12px;
  background: var(--gray-50);
  border-left: 4px solid var(--navy);
}

.mini-card.reseller {
  border-left-color: var(--orange);
}

.mini-card h4 {
  margin-bottom: 12px;
}

/* ============================
   FLOW DIAGRAM
============================ */
.flow-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 30px 0;
  padding: 30px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.flow-box {
  background: var(--navy);
  color: var(--white);
  padding: 14px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}

.flow-box:nth-child(even) {
  background: var(--orange);
  color: var(--navy);
}

.arrow {
  font-size: 22px;
  color: var(--gray-300);
  font-weight: 700;
}

/* ============================
   STEPS
============================ */
.step-flow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0;
}

.step {
  background: var(--white);
  border: 2px solid var(--navy);
  color: var(--navy);
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
  text-align: center;
  min-width: 90px;
  font-size: 18px;
}

.step span {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-500);
  margin-top: 4px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ============================
   QUICK ACTIONS
============================ */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.quick-actions div {
  text-align: center;
  background: var(--gray-50);
  padding: 18px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}

/* ============================
   TIPS & NOTES
============================ */
.tip, .note {
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.6;
}

.tip {
  background: rgba(245,158,11,0.1);
  border-left: 4px solid var(--orange);
  color: var(--gray-700);
}

.note {
  background: rgba(11,30,63,0.05);
  border-left: 4px solid var(--navy);
  color: var(--gray-700);
}

/* ============================
   FLOW TREE (Complete Flow)
============================ */
.flow-tree {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 40px 0;
  text-align: center;
}

.flow-node {
  background: var(--white);
  border: 2px solid var(--navy);
  color: var(--navy);
  padding: 12px 26px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  min-width: 200px;
  box-shadow: var(--shadow-sm);
}

.flow-node.root {
  background: var(--orange);
  color: var(--navy);
  border-color: var(--orange);
  font-size: 16px;
}

.flow-line {
  width: 2px;
  height: 30px;
  background: var(--gray-300);
  margin: 0 auto;
}

.flow-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 30px;
  width: 100%;
  max-width: 700px;
}

.flow-branch {
  background: var(--gray-50);
  padding: 25px;
  border-radius: 14px;
  border: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.flow-branch h4 {
  background: var(--navy);
  color: var(--white);
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.flow-branch:nth-child(2) h4 {
  background: var(--orange);
  color: var(--navy);
}

/* ============================
   FOOTER
============================ */
.end {
  text-align: center;
  margin-top: 60px;
  padding: 50px 20px;
  background: var(--navy);
  color: var(--white);
  border-radius: 12px;
}

.end h2 {
  color: var(--white);
  margin-bottom: 14px;
}

.end p {
  opacity: 0.8;
  font-size: 14px;
  margin: 6px 0;
}

/* ============================
   RESPONSIVE
============================ */
@media (max-width: 900px) {
  body, html {
    overflow-x: hidden;
  }
  .cover, .chapter {
    max-width: 100%;
    border-radius: 0;
    min-height: auto;
    padding: 80px 24px 60px 24px;
  }
  .page-header {
    top: 20px;
    left: 24px;
    right: 24px;
  }
  .page-footer {
    bottom: 20px;
    left: 24px;
    right: 24px;
  }
  .cards-grid {
    grid-template-columns: 1fr;
  }
  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }
  .two-col {
    grid-template-columns: 1fr;
  }
  .screen-row {
    grid-template-columns: 1fr;
  }
  .screen-img {
    order: 2;
  }
  .screen-img img {
    max-width: 100%;
    height: auto;
  }
  .screen-info {
    order: 1;
  }
  .flow-split {
    grid-template-columns: 1fr;
  }
  .print-btn {
    top: auto;
    bottom: 20px;
    right: 20px;
  }
}

/* ============================
   PRINT
============================ */
@media print {
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  body {
    background: white;
  }
  main {
    padding: 0;
    gap: 0;
    display: block;
  }
  .print-btn {
    display: none;
  }
  .cover, .chapter {
    box-shadow: none;
    border-radius: 0;
    margin: 0;
    padding: 20px 40px;
    page-break-after: always;
    min-height: auto;
    width: 100%;
    max-width: 100%;
  }
  .page-header, .page-footer {
    display: none;
  }
  .screen-row, .card, .mini-card, .flow-box, .step, .quick-actions, .note, .tip {
    page-break-inside: avoid;
    break-inside: avoid;
  }
  /* Fix Chromium Grid Print Bugs */
  .cards-grid, .screen-row, .two-col, .flow-split, .quick-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 20px !important;
  }
  .card {
    flex: 1 1 30% !important;
  }
  .screen-img {
    flex: 0 0 250px !important;
  }
  .screen-info {
    flex: 1 !important;
  }
  .mini-card, .flow-branch {
    flex: 1 1 45% !important;
  }
  .quick-actions div {
    flex: 1 1 20% !important;
  }
}
