/* ==========================================================================
   Recipe2Anytype - Japandi & Scandinavian Design System
   Warm Linen, Ceramic White, Deep Charcoal & Soothing Olive Accents
   ========================================================================== */

:root {
  /* Japandi Palette */
  --bg-canvas: #fbf9f5;
  --bg-canvas-subtle: #f5f2ea;
  --bg-surface: #ffffff;
  --bg-surface-soft: #fcfbfa;
  --bg-surface-elevated: #ffffff;
  
  /* Borders */
  --border-subtle: #e8e4db;
  --border-divider: #ede9e1;
  --border-focus: #4a5b3a;

  /* Botanical Olive Green Accents */
  --color-olive: #4a5b3a;
  --color-olive-hover: #3d4c2f;
  --color-olive-light: #eef3ea;
  --color-olive-border: #d4decb;
  --color-olive-text: #334027;

  /* Warm Ochre / Wood Accents (Monsieur Cuisine) */
  --color-mc: #b87333;
  --color-mc-hover: #9e6027;
  --color-mc-light: #fbf4ec;
  --color-mc-border: #edd6bd;
  --color-mc-text: #824716;

  /* Typography */
  --text-primary: #20241e;
  --text-secondary: #585d50;
  --text-muted: #8a9082;

  /* Shadows */
  --shadow-sm: 0 1px 3px 0 rgba(40, 35, 25, 0.04), 0 1px 2px 0 rgba(40, 35, 25, 0.02);
  --shadow-card: 0 4px 20px -2px rgba(45, 40, 30, 0.05), 0 2px 6px -1px rgba(45, 40, 30, 0.02);
  --shadow-float: 0 12px 32px -4px rgba(40, 35, 25, 0.08), 0 4px 12px -2px rgba(40, 35, 25, 0.04);
}

/* Base Body Styles */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  background-image: 
    radial-gradient(at 15% 10%, rgba(74, 91, 58, 0.04) 0px, transparent 50%),
    radial-gradient(at 85% 85%, rgba(184, 115, 51, 0.035) 0px, transparent 50%);
  background-attachment: fixed;
}

/* Japandi Ceramic Surface Panel */
.glass-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-canvas-subtle);
}
::-webkit-scrollbar-thumb {
  background: #d4cebe;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #b5ad9b;
}

/* Pulse animation for header loader */
.pulse-aura {
  animation: pulse-aura 2.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-aura {
  0%, 100% {
    opacity: 0.2;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.06);
  }
}

/* ==========================================================================
   Anytype Rendered Markdown Typography (Japandi Warm Style)
   ========================================================================== */

.anytype-preview {
  color: var(--text-secondary);
  line-height: 1.75;
}

.anytype-preview h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 0.25rem;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-divider);
}

.anytype-preview h2 {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.anytype-preview h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-olive);
  margin-top: 1.5rem;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.anytype-preview h4 {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 1.15rem;
  margin-bottom: 0.45rem;
}

.anytype-preview p {
  margin-bottom: 1rem;
}

.anytype-preview blockquote {
  border-left: 3.5px solid var(--color-olive);
  background: var(--color-olive-light);
  padding: 0.85rem 1.1rem;
  border-radius: 0 0.65rem 0.65rem 0;
  margin: 1.25rem 0;
  color: var(--color-olive-text);
  font-style: italic;
}

/* Anytype Checklists */
.anytype-preview ul {
  list-style: none;
  padding-left: 0;
  margin: 0.75rem 0 1.25rem 0;
}

.anytype-preview li {
  position: relative;
  padding-left: 0.25rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: flex-start;
  color: var(--text-primary);
}

.anytype-preview li input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.15rem;
  height: 1.15rem;
  border: 1.5px solid #8e9486;
  border-radius: 0.35rem;
  background-color: #fcfbfa;
  cursor: pointer;
  margin-right: 0.65rem;
  margin-top: 0.22rem;
  flex-shrink: 0;
  display: grid;
  place-content: center;
  transition: all 0.15s ease-in-out;
}

.anytype-preview li input[type="checkbox"]::before {
  content: "";
  width: 0.65rem;
  height: 0.65rem;
  transform: scale(0);
  transition: 120ms transform ease-in-out;
  box-shadow: inset 1em 1em #ffffff;
  transform-origin: center;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.anytype-preview li input[type="checkbox"]:checked {
  background-color: var(--color-olive);
  border-color: var(--color-olive);
}

.anytype-preview li input[type="checkbox"]:checked::before {
  transform: scale(1);
}

.anytype-preview li.task-checked {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Anytype Ordered Lists (Steps) */
.anytype-preview ol {
  list-style: none;
  counter-reset: anytype-counter;
  padding-left: 0;
  margin: 1rem 0;
}

.anytype-preview ol > li {
  counter-increment: anytype-counter;
  position: relative;
  padding-left: 2.35rem;
  margin-bottom: 0.95rem;
  display: block;
}

.anytype-preview ol > li::before {
  content: counter(anytype-counter);
  position: absolute;
  left: 0;
  top: 0.15rem;
  width: 1.6rem;
  height: 1.6rem;
  background: var(--color-olive-light);
  border: 1px solid var(--color-olive-border);
  color: var(--color-olive);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Anytype Tables */
.anytype-preview table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.25rem 0;
  border-radius: 0.65rem;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

.anytype-preview th {
  background: #f5f2ea;
  padding: 0.65rem 0.95rem;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.anytype-preview td {
  padding: 0.65rem 0.95rem;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border-divider);
  color: var(--text-primary);
}

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

.anytype-preview tr:hover td {
  background: #faf8f3;
}

/* Horizontal Divider */
.anytype-preview hr {
  border: none;
  height: 1px;
  background-color: var(--border-divider);
  margin: 1.75rem 0;
}

/* Raw Markdown Textarea */
.raw-markdown-editor {
  resize: vertical;
  min-height: 380px;
  tab-size: 2;
  background-color: #faf8f4 !important;
  color: #242921 !important;
  border-color: #e5dfd2 !important;
}

.raw-markdown-editor:focus {
  border-color: var(--color-olive) !important;
  box-shadow: 0 0 0 2px rgba(74, 91, 58, 0.15) !important;
}
