/* ==========================================================================
   THE DROPPER EXPRESS — DESK SHEET STYLESHEET (sheet-base.css)
   A4 Print-Optimized, Broadsheet Editorial Aesthetic for NEET 2027
   Designed for High-Contrast B&W and Color Printing + Wall Mounting
   ========================================================================== */

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

:root {
  --ink-black: #090d16;
  --ink-primary: #1e293b;
  --ink-secondary: #475569;
  --ink-muted: #64748b;
  --ink-light: #94a3b8;
  
  --paper-white: #ffffff;
  --paper-cream: #faf9f6;
  --paper-warm: #f8fafc;
  --paper-newsprint: #faf6ee;
  
  --border-dark: #090d16;
  --border-mid: #cbd5e1;
  --border-light: #e2e8f0;
  
  --accent-red: #b91c1c;
  --accent-red-bg: #fef2f2;
  --accent-amber: #b45309;
  --accent-amber-bg: #fffbeb;
  --accent-green: #15803d;
  --accent-green-bg: #f0fdf4;
  --accent-blue: #1d4ed8;
  --accent-blue-bg: #eff6ff;

  --font-masthead: 'Cinzel', Georgia, 'Times New Roman', serif;
  --font-body: 'Newsreader', Georgia, serif;
  --font-ui: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* Base resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background: #0f172a;
  background-image: 
    radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
  font-family: var(--font-ui);
  color: var(--ink-primary);
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  padding: 32px 0 80px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Floating Action & Share Bar for Web Preview */
.web-actions-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #090d16;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 999px;
  box-shadow: 0 20px 40px -6px rgba(0, 0, 0, 0.6), 0 8px 16px -4px rgba(0, 0, 0, 0.4);
  border: 1.5px solid #334155;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  max-width: 96vw;
  box-sizing: border-box;
}

.web-actions-title {
  display: flex;
  align-items: center;
  gap: 8px;
  border-right: 1px solid #334155;
  padding-right: 12px;
  font-size: 12.5px;
  white-space: nowrap;
}

.web-actions-pill {
  background: #b91c1c;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.web-actions-name {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  color: #f1f5f9;
}

.web-actions-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-wa-share {
  background: #25D366;
  color: #043815 !important;
  text-decoration: none !important;
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn-wa-share:hover {
  background: #20bd5a;
  transform: translateY(-1px);
  color: #02240d !important;
}

.btn-copy-link {
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #475569;
  padding: 7px 13px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-copy-link:hover {
  background: #334155;
  color: #ffffff;
  border-color: #64748b;
  transform: translateY(-1px);
}

.btn-print-sheet {
  background: #ffffff;
  color: #090d16;
  border: none;
  padding: 7px 15px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn-print-sheet:hover {
  background: #f1f5f9;
  transform: translateY(-1px);
}

.btn-close-preview {
  color: #94a3b8;
  text-decoration: none;
  font-size: 11.5px;
  padding-left: 8px;
  border-left: 1px solid #334155;
  white-space: nowrap;
}

.btn-close-preview:hover {
  color: #ffffff;
  text-decoration: underline;
}

.share-toast {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  background: #15803d;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  z-index: 10000;
  animation: fadeInToast 0.2s ease-out;
  border: 1px solid #4ade80;
}

@keyframes fadeInToast {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@media (max-width: 640px) {
  .web-actions-bar {
    bottom: 12px;
    padding: 7px 10px;
    gap: 6px;
    width: calc(100% - 20px);
    justify-content: space-around;
  }
  .web-actions-title {
    display: none;
  }
  .web-actions-btns {
    width: 100%;
    justify-content: space-around;
    gap: 5px;
  }
  .btn-wa-share, .btn-copy-link, .btn-print-sheet {
    padding: 6px 10px;
    font-size: 11px;
  }
  .btn-close-preview {
    display: none;
  }
}

/* A4 Page Container — Tactile Tabloid / Broadsheet Newsprint Aesthetic */
.sheet-page {
  width: 210mm;
  min-height: 297mm;
  padding: 13mm 15mm 13mm 15mm;
  margin: 0 auto 20mm auto;
  background-color: #faf6ee;
  /* Newsprint tactile grain + micro-stipple texture */
  background-image: 
    radial-gradient(rgba(30, 20, 10, 0.05) 0.75px, transparent 0.75px),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.045'/%3E%3C/svg%3E");
  background-size: 8px 8px, 180px 180px;
  border: 3.5px double var(--ink-black);
  outline: 1px solid rgba(17, 24, 39, 0.25);
  outline-offset: -5px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25), 0 2px 6px rgba(0, 0, 0, 0.12);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

/* Corner Tape & Alignment Guides */
.sheet-page::before {
  content: '┌── [ TAPE HERE / DEEWAR PE CHIPKAO ]';
  position: absolute;
  top: 4.5mm;
  left: 5.5mm;
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--ink-muted);
  pointer-events: none;
}

.sheet-page::after {
  content: '[ TAPE HERE ] ──┐';
  position: absolute;
  top: 4.5mm;
  right: 5.5mm;
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--ink-muted);
  pointer-events: none;
}

/* Masthead Header */
.sheet-header {
  border-bottom: 2px solid var(--border-dark);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.sheet-header-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-ui);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-secondary);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 4px;
  margin-bottom: 6px;
}

.sheet-masthead-title {
  font-family: var(--font-masthead);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: var(--ink-black);
  text-transform: uppercase;
  line-height: 1.1;
  margin-bottom: 3px;
}

.sheet-subtitle {
  font-family: var(--font-body);
  font-size: 11.5px;
  font-style: italic;
  color: var(--ink-secondary);
  line-height: 1.35;
  margin-bottom: 6px;
}

/* Student Target Strip */
.student-target-strip {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 12px;
  background: var(--paper-cream);
  border: 1px solid var(--border-mid);
  padding: 5px 10px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--ink-primary);
  border-radius: 2px;
  margin-top: 4px;
}

.student-target-strip span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.student-target-strip strong {
  color: var(--ink-black);
  font-weight: 700;
}

/* Main Sheet Content */
.sheet-content {
  flex: 1;
}

/* Grid Layouts for Content */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.grid-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

/* Section Box / Card */
.sheet-section {
  border: 1px solid var(--border-dark);
  margin-bottom: 10px;
  background: #ffffff;
}

.sheet-section-title {
  background: var(--ink-black);
  color: #ffffff;
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 4px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sheet-section-title.accent-red {
  background: var(--accent-red);
}

.sheet-section-title.accent-amber {
  background: var(--accent-amber);
}

.sheet-section-title.accent-blue {
  background: var(--accent-blue);
}

.sheet-section-body {
  padding: 6px 8px;
}

/* Checkbox Items */
.check-group {
  margin-bottom: 6px;
}

.check-parent {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-black);
  padding: 2px 0;
  border-bottom: 1px dotted var(--border-light);
}

.check-box {
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 1.5px solid var(--border-dark);
  border-radius: 1.5px;
  margin-top: 1px;
  flex-shrink: 0;
  background: #ffffff;
}

.check-box.checked {
  background: var(--ink-black);
}

.check-subitems {
  padding-left: 18px;
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.check-subitem {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  font-size: 9px;
  color: var(--ink-secondary);
  line-height: 1.25;
}

.check-box-sm {
  display: inline-block;
  width: 9px;
  height: 9px;
  border: 1px solid var(--border-dark);
  border-radius: 1px;
  margin-top: 1px;
  flex-shrink: 0;
}

.tag-badge {
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 2px;
  text-transform: uppercase;
  margin-left: 4px;
}

.tag-badge.high-yield {
  background: var(--accent-red-bg);
  color: var(--accent-red);
  border: 1px solid #fca5a5;
}

.tag-badge.new {
  background: var(--accent-amber-bg);
  color: var(--accent-amber);
  border: 1px solid #fcd34d;
}

.tag-badge.safe {
  background: var(--accent-green-bg);
  color: var(--accent-green);
  border: 1px solid #86efac;
}

/* Kill List Styling */
.kill-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 10px;
  border-bottom: 1px solid var(--border-light);
}

.kill-cross {
  color: var(--accent-red);
  font-weight: 900;
  font-size: 13px;
  line-height: 1;
}

.kill-title {
  text-decoration: line-through;
  color: var(--ink-muted);
  font-weight: 600;
}

.kill-reason {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--ink-light);
}

/* Tables in Sheets */
.sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9px;
  line-height: 1.3;
}

.sheet-table th {
  background: var(--paper-warm);
  border: 1px solid var(--border-mid);
  padding: 4px 6px;
  font-family: var(--font-ui);
  font-weight: 800;
  text-transform: uppercase;
  text-align: left;
  font-size: 8.5px;
  color: var(--ink-primary);
}

.sheet-table td {
  border: 1px solid var(--border-light);
  padding: 4px 6px;
  vertical-align: top;
}

.sheet-table tr:nth-child(even) td {
  background: #fafafa;
}

/* ==========================================================================
   SHIV WHATSAPP QR FOOTER BAR (Non-Negotiable on Every Sheet)
   ========================================================================== */
.sheet-footer-shiv {
  border-top: 2px solid var(--border-dark);
  padding-top: 8px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #ffffff;
}

.shiv-coach-info {
  flex: 1;
}

.shiv-header-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.shiv-pill {
  background: #25d366;
  color: #052e16;
  font-family: var(--font-ui);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 1.5px 5px;
  border-radius: 2px;
  letter-spacing: 0.5px;
}

.shiv-phone {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 800;
  color: var(--ink-black);
}

.shiv-coach-title {
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 800;
  color: var(--ink-black);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  line-height: 1.2;
}

.shiv-coach-tagline {
  font-family: var(--font-body);
  font-size: 9.5px;
  font-style: italic;
  color: var(--ink-secondary);
  line-height: 1.3;
  margin-top: 2px;
}

.shiv-qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
}

.shiv-qr-box {
  width: 58px;
  height: 58px;
  border: 1px solid var(--border-dark);
  padding: 2px;
  background: #ffffff;
}

.shiv-qr-box svg, .shiv-qr-box img {
  width: 100%;
  height: 100%;
  display: block;
}

.shiv-qr-caption {
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--ink-secondary);
  text-transform: uppercase;
}

.sheet-edition-foot {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 7.5px;
  color: var(--ink-light);
  border-top: 1px dotted var(--border-light);
  padding-top: 4px;
  margin-top: 6px;
}

/* ==========================================================================
   PRINT MEDIA RULES (Crucial for 100% Perfect A4 Tabloid / Broadsheet Output)
   ========================================================================== */
@page {
  size: A4 portrait;
  margin: 0;
}

@media print {
  html, body {
    background: #ffffff !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 210mm !important;
    height: 100% !important;
  }

  .web-actions-bar, .no-print, .share-toast {
    display: none !important;
  }

  .sheet-page {
    width: 210mm !important;
    height: 297mm !important;
    max-height: 297mm !important;
    margin: 0 !important;
    padding: 6mm 8mm 4mm 8mm !important;
    background-color: #ffffff !important;
    background-image: none !important;
    border: 2px double #000000 !important;
    outline: 1px solid #000000 !important;
    outline-offset: -3px !important;
    box-shadow: none !important;
    page-break-after: always !important;
    break-after: page !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
  }

  .sheet-page:last-of-type {
    page-break-after: avoid !important;
    break-after: avoid !important;
  }

  .sheet-page::before {
    content: '┌── [ TAPE HERE / DEEWAR PE CHIPKAO ]' !important;
    color: #000000 !important;
    top: 3mm !important;
    left: 4mm !important;
    font-size: 6.5px !important;
  }

  .sheet-page::after {
    content: '[ TAPE HERE ] ──┐' !important;
    color: #000000 !important;
    top: 3mm !important;
    right: 4mm !important;
    font-size: 6.5px !important;
  }

  /* Compact header in print */
  .sheet-header {
    margin-bottom: 4px !important;
    padding-bottom: 3px !important;
  }

  .sheet-header-top {
    font-size: 7.5px !important;
    margin-bottom: 2px !important;
    padding-bottom: 2px !important;
  }

  .sheet-masthead-title {
    font-size: 15px !important;
    margin-bottom: 1.5px !important;
    line-height: 1.1 !important;
  }

  .sheet-subtitle {
    font-size: 8.5px !important;
    margin-bottom: 3px !important;
    line-height: 1.2 !important;
  }

  .student-target-strip {
    margin-top: 2px !important;
    padding: 2.5px 6px !important;
    font-size: 8px !important;
  }

  /* Content and section containers */
  .sheet-content {
    flex: 1 !important;
  }

  .grid-2col {
    gap: 7px !important;
  }

  .grid-3col {
    gap: 5px !important;
  }

  .sheet-section {
    margin-bottom: 3px !important;
  }

  .sheet-section-title {
    font-size: 8.5px !important;
    padding: 2px 5px !important;
    letter-spacing: 0.4px !important;
  }

  .sheet-section-body {
    padding: 2px 4px !important;
  }

  .check-group {
    margin-bottom: 2px !important;
  }

  .check-parent {
    font-size: 8.5px !important;
    padding: 1px 0 !important;
    line-height: 1.15 !important;
  }

  .check-box {
    width: 8.5px !important;
    height: 8.5px !important;
  }

  .check-box-sm {
    width: 6.5px !important;
    height: 6.5px !important;
  }

  .check-subitems {
    padding-left: 8px !important;
    gap: 0.5px !important;
  }

  .check-subitem {
    font-size: 7.2px !important;
    line-height: 1.12 !important;
  }

  .tag-badge {
    font-size: 6px !important;
    padding: 0.5px 2.5px !important;
  }

  /* Footer compacting */
  .sheet-footer-shiv {
    margin-top: 3px !important;
    padding-top: 3px !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .shiv-header-badge {
    margin-bottom: 1px !important;
  }

  .shiv-coach-title {
    font-size: 8.5px !important;
  }

  .shiv-coach-tagline {
    font-size: 7px !important;
    line-height: 1.12 !important;
    margin-top: 1px !important;
  }

  .shiv-qr-box {
    width: 40px !important;
    height: 40px !important;
    padding: 1px !important;
  }

  .shiv-qr-caption {
    font-size: 5.5px !important;
  }

  .sheet-edition-foot {
    font-size: 6px !important;
    margin-top: 2px !important;
    padding-top: 1.5px !important;
  }

  .page-break {
    page-break-before: always !important;
    break-before: page !important;
  }

  /* Force exact color printing */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

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

