@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  body {
    min-height: max(884px, 100dvh);
  }
}

@layer utilities {
  .fill-1 {
    font-variation-settings: 'FILL' 1;
  }
}

/* TipTap / ProseMirror editor styles */
.ProseMirror {
  outline: none;
  min-height: 300px;
}

.ProseMirror p {
  margin: 0.5em 0;
}

/* Bullet lists */
.ProseMirror ul {
  list-style-type: disc;
  padding-left: 1.5em;
  margin: 0.5em 0;
}

.ProseMirror ul li {
  list-style-type: disc;
  margin: 0.25em 0;
}

.ProseMirror ul li p {
  margin: 0;
}

/* Numbered lists */
.ProseMirror ol {
  list-style-type: decimal;
  padding-left: 1.5em;
  margin: 0.5em 0;
}

.ProseMirror ol li {
  list-style-type: decimal;
  margin: 0.25em 0;
}

.ProseMirror ol li p {
  margin: 0;
}

/* Blockquote */
.ProseMirror blockquote {
  position: relative;
  padding: 0.75em 1em 0.75em 2.5em;
  margin: 0.75em 0;
  color: #52525b;
  font-style: italic;
  border-left: 3px solid #10b981;
  border-radius: 0 0.5rem 0.5rem 0;
}

.ProseMirror blockquote::before {
  content: "\201C";
  position: absolute;
  left: 0.15em;
  top: 0.05em;
  font-size: 2em;
  line-height: 1;
  color: #10b981;
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 700;
}

.ProseMirror blockquote::after {
  content: "\201D";
  font-size: 2em;
  line-height: 0;
  vertical-align: -0.3em;
  color: #10b981;
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 700;
  margin-left: 0.05em;
}

.ProseMirror blockquote p {
  display: inline;
  margin: 0;
}








/* Code block */
.ProseMirror pre {
  background: #18181b;
  color: #e4e4e7;
  border-radius: 0.75rem;
  padding: 1em;
  margin: 0.5em 0;
  overflow-x: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
}

.ProseMirror code {
  background: #f4f4f5;
  border-radius: 0.25rem;
  padding: 0.125rem 0.25rem;
  font-size: 0.875rem;
}

.ProseMirror pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

/* Headings */
.ProseMirror h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0.75em 0 0.5em;
  line-height: 1.2;
}

.ProseMirror h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0.75em 0 0.5em;
  line-height: 1.3;
}

.ProseMirror h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0.75em 0 0.5em;
  line-height: 1.4;
}

/* Italic / Emphasis */
.ProseMirror em {
  font-style: italic !important;
}

/* Underline */
.ProseMirror u {
  text-decoration: underline !important;
}

/* Bold */
.ProseMirror strong {
  font-weight: 700 !important;
}

/* Links */
.ProseMirror a {
  color: #059669;
  text-decoration: underline;
  cursor: pointer;
}


/* Images */
.ProseMirror img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 0.5em 0;
}

/* Resizable images — drag handle on bottom-right corner */
.ProseMirror .resizable-image-wrapper {
  display: inline-block;
  position: relative;
  max-width: 100%;
}

.ProseMirror .resizable-image-wrapper img {
  display: block;
  max-width: 100%;
  height: auto;
}

.ProseMirror .resizable-image-wrapper .resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  background: #10b981;
  border: 2px solid white;
  border-radius: 2px;
  cursor: se-resize;
  opacity: 0;
  transition: opacity 0.2s;
}

.ProseMirror .resizable-image-wrapper:hover .resize-handle {
  opacity: 1;
}


/* Placeholder */
.ProseMirror p.is-editor-empty:first-child::before {
  color: #a1a1aa;
  content: attr(data-placeholder);
  float: left;
  height: 0;
  pointer-events: none;
}

/* Premium article typography for Detail View preview */
.article-content {
  font-size: 15px;
  color: #27272a;
  line-height: 1.8;
}

.article-content h1 {
  font-size: 28px;
  color: #064e3b;
  margin: 32px 0 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  border-bottom: 2px solid #d1fae5;
  padding-bottom: 8px;
}

.article-content h2 {
  font-size: 22px;
  color: #065f46;
  margin: 28px 0 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.article-content h3 {
  font-size: 18px;
  color: #047857;
  margin: 24px 0 10px;
  font-weight: 600;
  line-height: 1.4;
}

.article-content p {
  margin: 12px 0;
  line-height: 1.8;
}

.article-content ul {
  list-style-type: disc;
  padding-left: 24px;
  margin: 12px 0;
}

.article-content ol {
  list-style-type: decimal;
  padding-left: 24px;
  margin: 12px 0;
}

.article-content li {
  margin: 6px 0;
  line-height: 1.7;
}

.article-content blockquote {
  border-left: 4px solid #10b981;
  padding: 12px 20px;
  margin: 16px 0;
  color: #52525b;
  font-style: italic;
  background: #f0fdf4;
  border-radius: 0 8px 8px 0;
}

.article-content blockquote::before {
  content: open-quote;
  font-size: 2.5em;
  color: #10b981;
  font-family: Georgia, serif;
  line-height: 0.5;
  vertical-align: -0.3em;
  margin-right: 4px;
}

.article-content blockquote p {
  display: inline;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 16px 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.article-content a {
  color: #059669;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-content a:hover {
  color: #047857;
}

.article-content strong {
  font-weight: 700;
  color: #18181b;
}

.article-content em {
  font-style: italic;
}

.article-content u {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-content code {
  background: #18181b;
  color: #e4e4e7;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.article-content pre {
  background: #18181b;
  color: #e4e4e7;
  padding: 16px 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 16px 0;
  font-size: 13px;
  line-height: 1.6;
}

.article-content pre code {
  background: none;
  padding: 0;
}

/* Larger typography for Product Preview modal article content */
.preview-article-content {
  font-size: 20px;
  line-height: 1.7;
}

.preview-article-content h1 {
  font-size: 34px;
  margin: 36px 0 18px;
  line-height: 1.3;
}

.preview-article-content h2 {
  font-size: 28px;
  margin: 32px 0 14px;
  line-height: 1.35;
}

.preview-article-content h3 {
  font-size: 24px;
  margin: 28px 0 12px;
  line-height: 1.4;
}

.preview-article-content p {
  margin: 14px 0;
  line-height: 1.7;
}

.preview-article-content li {
  margin: 8px 0;
  line-height: 1.7;
}

.preview-article-content blockquote {
  padding: 16px 24px;
  margin: 20px 0;
}

.preview-article-content img {
  margin: 20px 0;
}

/* Pointing hand animation for workout mode */
@keyframes pointLeft {
  0%, 100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(-8px);
  }
}

/* ── Reports & Progress Page ─────────────────────────────────── */
/* BMI Scale Ruler */
.bmi-scale-track {
  position: relative;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}
.bmi-scale-track .bmi-marker {
  position: absolute;
  top: -6px;
  width: 14px;
  height: 20px;
  border-radius: 50%;
  transform: translateX(-50%);
  z-index: 2;
  transition: left 0.5s ease;
}
.bmi-scale-track .bmi-start-marker {
  position: absolute;
  top: -4px;
  width: 10px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 50%;
  transform: translateX(-50%);
  z-index: 1;
  opacity: 0.6;
}

/* SVG Chart styles */
.reports-chart {
  width: 100%;
  height: auto;
}
.reports-chart .chart-line {
  fill: none;
  stroke: #059669;
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.reports-chart .chart-area {
  fill: url(#weightGradient);
  opacity: 0.15;
}
.reports-chart .chart-dot {
  fill: #059669;
  r: 4;
  transition: r 0.2s;
}
.reports-chart .chart-dot:hover {
  r: 6;
  fill: #064e3b;
}
.reports-chart .target-line {
  stroke: #dc2626;
  stroke-width: 1.5;
  stroke-dasharray: 6 3;
}
.reports-chart .starting-line {
  stroke: #6b7280;
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
}

/* Print styles for PDF export */
@media print {
  body * {
    visibility: hidden;
  }
  .reports-print-section,
  .reports-print-section * {
    visibility: visible;
  }
  .reports-print-section {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: white !important;
    color: black !important;
  }
  .reports-print-section .no-print {
    display: none !important;
  }
  .reports-print-section .dashboard-card {
    break-inside: avoid;
    page-break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
  .reports-print-section .print-only {
    display: block !important;
  }
  .reports-print-section .print-hide {
    display: none !important;
  }
}
.print-only {
  display: none;
}

/* Achievement badge animations */
@keyframes badgeUnlock {
  0% { transform: scale(0.8); opacity: 0.5; }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}
.badge-unlocked {
  animation: badgeUnlock 0.4s ease-out;
}


