/* ==========================================================================
   VNote - Design Tokens & 4 Theme Palettes
   ========================================================================== */

:root, [data-theme="editorial"] {
  --bg-base: #fcfbf9;
  --bg-card: #ffffff;
  --bg-subtle: #f6f4ee;
  --border-color: #e8e4d8;
  --text-primary: #1c1917;
  --text-secondary: #57534e;
  --text-muted: #a8a29e;
  --accent: #d97706;
  --accent-hover: #b45309;
  --accent-soft: rgba(217, 119, 6, 0.12);
  --btn-text: #ffffff;
  --badge-bg: #fef3c7;
  --badge-text: #92400e;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
}

[data-theme="cyber"] {
  --bg-base: #090d16;
  --bg-card: #111827;
  --bg-subtle: #1f2937;
  --border-color: #374151;
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --accent: #38bdf8;
  --accent-hover: #0284c7;
  --accent-soft: rgba(56, 189, 248, 0.15);
  --btn-text: #090d16;
  --badge-bg: rgba(56, 189, 248, 0.2);
  --badge-text: #38bdf8;
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

[data-theme="ocean"] {
  --bg-base: #f0f7fa;
  --bg-card: #ffffff;
  --bg-subtle: #e0f2fe;
  --border-color: #bae6fd;
  --text-primary: #082f49;
  --text-secondary: #0369a1;
  --text-muted: #7dd3fc;
  --accent: #0284c7;
  --accent-hover: #0369a1;
  --accent-soft: rgba(2, 132, 199, 0.12);
  --btn-text: #ffffff;
  --badge-bg: #e0f2fe;
  --badge-text: #0284c7;
  --shadow-sm: 0 1px 2px 0 rgba(2, 132, 199, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(2, 132, 199, 0.1);
}

[data-theme="forest"] {
  --bg-base: #f4f7f4;
  --bg-card: #ffffff;
  --bg-subtle: #e8f0e8;
  --border-color: #cedece;
  --text-primary: #143314;
  --text-secondary: #2d5a27;
  --text-muted: #82a882;
  --accent: #15803d;
  --accent-hover: #166534;
  --accent-soft: rgba(21, 128, 61, 0.12);
  --btn-text: #ffffff;
  --badge-bg: #dcfce7;
  --badge-text: #166534;
  --shadow-sm: 0 1px 2px 0 rgba(21, 128, 61, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(21, 128, 61, 0.1);
}

/* Base resets & typography */
body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  transition: background-color 0.25s ease, color 0.25s ease;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: 'Noto Serif SC', serif;
}

/* ==========================================================================
   VNote Feed Card Component
   ========================================================================== */

.vnote-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  overflow: hidden;
}

.vnote-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.card-thumbnail {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background-color: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
}

@media (min-width: 768px) {
  .card-thumbnail-side {
    width: 280px;
    height: 180px;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
  }
}

/* ==========================================================================
   Markdown Renderer Typography Tokens
   ========================================================================== */

.markdown-body {
  color: var(--text-primary);
  line-height: 1.75;
}

.markdown-body h1 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-top: 1rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.4rem;
}

.markdown-body h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 1.25rem;
  margin-bottom: 0.6rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.markdown-body h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 1rem;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.markdown-body p {
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.markdown-body ul, .markdown-body ol {
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.markdown-body ul {
  list-style-type: disc;
}

.markdown-body ol {
  list-style-type: decimal;
}

.markdown-body li {
  margin-bottom: 0.35rem;
}

.markdown-body blockquote {
  border-left: 4px solid var(--accent);
  background-color: var(--accent-soft);
  padding: 0.6rem 1rem;
  border-radius: 0 0.75rem 0.75rem 0;
  margin: 0.75rem 0;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.markdown-body hr {
  border: none;
  border-top: 1px dashed var(--border-color);
  margin: 1.25rem 0;
}

.markdown-body strong {
  color: var(--text-primary);
  font-weight: 700;
}

.markdown-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 0.15rem 0.35rem;
  border-radius: 0.35rem;
  font-size: 0.8rem;
}

/* ==========================================================================
   Collapsible Drawer Animation
   ========================================================================== */

.drawer-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.drawer-content.open {
  max-height: 5000px;
  opacity: 1;
}

/* ==========================================================================
   Modal Dialogs & Floating Elements
   ========================================================================== */

.raw-modal {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.raw-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.raw-modal-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1.5rem;
  max-width: 42rem;
  width: 100%;
  padding: 1.75rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.raw-modal.open .raw-modal-card {
  transform: scale(1);
}

/* Toast Box */
.toast-box {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 0.75rem 1.5rem;
  border-radius: 1rem;
  background-color: var(--text-primary);
  color: var(--bg-base);
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  z-index: 70;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast-box.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
