/* ==========================================================================
   Ideas - Design Tokens, 4 Themes & Glassmorphism Styling
   ========================================================================== */

:root, [data-theme="editorial"] {
  --bg-base: #faf8f5;
  --bg-card: #ffffff;
  --bg-subtle: #f5f2eb;
  --border: #e7e2d6;
  --text-main: #1c1917;
  --text-sub: #57534e;
  --text-muted: #a8a29e;
  --accent: #c2410c;
  --accent-hover: #9a3412;
  --accent-soft: rgba(194, 65, 12, 0.12);
  --btn-text: #ffffff;
  --nav-bg: rgba(255, 255, 255, 0.88);
  --shadow-card: 0 2px 8px -2px rgba(28, 25, 23, 0.05), 0 1px 3px 0 rgba(28, 25, 23, 0.03);
  --shadow-hover: 0 12px 24px -6px rgba(194, 65, 12, 0.12), 0 4px 8px -2px rgba(28, 25, 23, 0.04);
}

[data-theme="cyber"] {
  --bg-base: #0a0e17;
  --bg-card: #111827;
  --bg-subtle: #1f2937;
  --border: #374151;
  --text-main: #f9fafb;
  --text-sub: #9ca3af;
  --text-muted: #6b7280;
  --accent: #38bdf8;
  --accent-hover: #0284c7;
  --accent-soft: rgba(56, 189, 248, 0.15);
  --btn-text: #0a0e17;
  --nav-bg: rgba(17, 24, 39, 0.88);
  --shadow-card: 0 2px 8px -2px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 12px 24px -6px rgba(56, 189, 248, 0.2);
}

[data-theme="forest"] {
  --bg-base: #f4f7f4;
  --bg-card: #ffffff;
  --bg-subtle: #e8f0e8;
  --border: #cedece;
  --text-main: #143314;
  --text-sub: #2d5a27;
  --text-muted: #82a882;
  --accent: #15803d;
  --accent-hover: #166534;
  --accent-soft: rgba(21, 128, 61, 0.12);
  --btn-text: #ffffff;
  --nav-bg: rgba(255, 255, 255, 0.88);
  --shadow-card: 0 2px 8px -2px rgba(20, 51, 20, 0.05);
  --shadow-hover: 0 12px 24px -6px rgba(21, 128, 61, 0.12);
}

[data-theme="ocean"] {
  --bg-base: #f0f7fa;
  --bg-card: #ffffff;
  --bg-subtle: #e0f2fe;
  --border: #bae6fd;
  --text-main: #082f49;
  --text-sub: #0369a1;
  --text-muted: #7dd3fc;
  --accent: #0284c7;
  --accent-hover: #0369a1;
  --accent-soft: rgba(2, 132, 199, 0.12);
  --btn-text: #ffffff;
  --nav-bg: rgba(255, 255, 255, 0.88);
  --shadow-card: 0 2px 8px -2px rgba(8, 47, 73, 0.05);
  --shadow-hover: 0 12px 24px -6px rgba(2, 132, 199, 0.12);
}

/* Base Body */
body {
  background-color: var(--bg-base);
  color: var(--text-main);
  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;
}

/* Tab Pane Transitions */
.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Idea Card Component */
.idea-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-card);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.idea-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.idea-card.archived {
  opacity: 0.85;
  background-color: var(--bg-subtle);
}

/* Fixed Bottom Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 2rem;
  padding: 0.4rem 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.2);
  z-index: 50;
  max-width: 90vw;
}

.bottom-nav-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border-radius: 1.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.bottom-nav-item:hover {
  color: var(--accent);
  background-color: var(--accent-soft);
}

.bottom-nav-item.active {
  color: var(--btn-text);
  background-color: var(--accent);
  box-shadow: 0 4px 12px -2px var(--accent-soft);
}

.bottom-nav-item i {
  font-size: 1.15rem;
}

/* Modals */
.auth-modal-overlay, .modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-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;
}

.auth-modal-overlay.open, .modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.auth-modal-card, .modal-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1.75rem;
  max-width: 26rem;
  width: 100%;
  padding: 2rem;
  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);
}

.auth-modal-overlay.open .auth-modal-card,
.modal-overlay.open .modal-card {
  transform: scale(1);
}

/* Markdown styling inside card / modal */
.markdown-body {
  color: var(--text-main);
  line-height: 1.6;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
  font-weight: 800;
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.markdown-body h1 { font-size: 1.15rem; border-bottom: 2px solid var(--accent); padding-bottom: 0.25rem; }
.markdown-body h2 { font-size: 1.05rem; color: var(--accent); }
.markdown-body h3 { font-size: 0.95rem; }
.markdown-body p { margin-bottom: 0.5rem; font-size: 0.85rem; color: var(--text-sub); }
.markdown-body ul, .markdown-body ol { padding-left: 1.25rem; margin-bottom: 0.5rem; font-size: 0.85rem; color: var(--text-sub); }
.markdown-body ul { list-style-type: disc; }
.markdown-body ol { list-style-type: decimal; }
.markdown-body blockquote {
  border-left: 3px solid var(--accent);
  background-color: var(--accent-soft);
  padding: 0.4rem 0.8rem;
  border-radius: 0 0.5rem 0.5rem 0;
  margin: 0.5rem 0;
  font-size: 0.8rem;
}

/* Toast */
.toast-box {
  position: fixed;
  bottom: 5.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 0.6rem 1.25rem;
  border-radius: 1rem;
  background-color: var(--text-main);
  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;
}
