/* ==========================================================================
   CIRCULARTRACE - Global Design System & UI Styles
   Warm Coffee + Sustainable Forest Green + Crisp High-Contrast Minimalist
   ========================================================================== */

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

:root {
  --coffee-900: #1a0f0a;
  --coffee-800: #2c1810;
  --coffee-700: #3d2314;
  --coffee-600: #5c3822;
  --coffee-500: #7c4d32;
  --coffee-100: #f7f1ec;
  --coffee-50:  #fcfaf8;

  --eco-900: #0d381e;
  --eco-800: #134e2c;
  --eco-700: #15803d;
  --eco-600: #16a34a;
  --eco-100: #dcfce7;
  --eco-50:  #f0fdf4;

  --amber-500: #d97706;
  --amber-100: #fef3c7;
  --cherry-600: #dc2626;

  --bg-primary: #fcfbfa;
  --card-bg: #ffffff;
  --border-light: #e5e0d8;
  --text-main: #1c1917;
  --text-muted: #78716c;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

code, .font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1ede8;
}
::-webkit-scrollbar-thumb {
  background: #d6cebf;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #b5a995;
}

/* Badges & Status */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.badge-recorded {
  background-color: #fff7ed;
  color: #c2410c;
  border: 1px solid #ffedd5;
}

.badge-verified {
  background-color: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.badge-published {
  background-color: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.badge-revision {
  background-color: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* Glassmorphism & Elevation */
.glass-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(229, 224, 216, 0.8);
}

.card-elevation {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 1rem;
  box-shadow: 0 4px 20px -2px rgba(44, 24, 16, 0.04), 0 2px 6px -1px rgba(44, 24, 16, 0.02);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-elevation:hover {
  box-shadow: 0 10px 25px -3px rgba(44, 24, 16, 0.08), 0 4px 10px -2px rgba(44, 24, 16, 0.03);
}

/* Interactive Node in Genealogy */
.tree-node {
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}
.tree-node:hover {
  transform: translateY(-2px);
}

/* Packaging Sticker Label Styling */
.packaging-label-preview {
  background: #ffffff;
  border: 2px solid #2c1810;
  border-radius: 1rem;
  box-shadow: 0 8px 30px rgba(44, 24, 16, 0.12);
  position: relative;
  transition: all 0.3s ease;
}

.packaging-label-preview::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 12px;
  right: 12px;
  height: 4px;
  background: repeating-linear-gradient(90deg, #15803d, #15803d 8px, #d97706 8px, #d97706 16px, #2c1810 16px, #2c1810 24px);
  border-radius: 2px 2px 0 0;
}

/* Modal Animation */
.modal-overlay {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  animation: scaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Circular Score Gauge Ring */
.score-circle {
  transition: stroke-dashoffset 0.8s ease-in-out;
}

/* ==========================================================================
   PRINT MEDIA STYLES - CLEAN PACKAGING STICKER ONLY
   ========================================================================== */
@media print {
  /* Hide all page chrome */
  body {
    background: #ffffff !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  header, footer, nav, #app-header, .no-print, button, input {
    display: none !important;
  }

  body * {
    visibility: hidden;
  }

  /* Single label print mode (Consumer or Export Bag) */
  #packaging-label-printable, 
  #packaging-label-printable *,
  #export-label-printable,
  #export-label-printable * {
    visibility: visible !important;
  }

  #packaging-label-printable,
  #export-label-printable {
    position: absolute !important;
    left: 50% !important;
    top: 15mm !important;
    transform: translateX(-50%) !important;
    width: 90mm !important;
    max-width: 90mm !important;
    border: 2px solid #000000 !important;
    border-radius: 6mm !important;
    padding: 6mm !important;
    background: #ffffff !important;
    box-shadow: none !important;
    margin: 0 !important;
    page-break-inside: avoid !important;
  }

  /* When printing sheet of multiple labels */
  body.print-sheet-mode #label-sheet-container,
  body.print-sheet-mode #label-sheet-container * {
    visibility: visible !important;
  }

  body.print-sheet-mode #label-sheet-container {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(2, 85mm) !important;
    gap: 8mm 12mm !important;
    justify-content: center !important;
    padding: 10mm !important;
  }
}
