/* ============================================
   THE SABET BLUEPRINT - QUEST MODE
   Gamified Web App Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* --- CSS Variables --- */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a28;
  --bg-card-hover: #22223a;
  --bg-input: #14141f;

  --text-primary: #f0f0f5;
  --text-secondary: #b0b0c8;
  --text-muted: #8b8ba6;

  --accent-gold: #f5c542;
  --accent-orange: #ff6b35;
  --accent-pink: #ff3c83;
  --accent-purple: #2d7ff9;
  --accent-blue: #5a9cf5;
  --accent-cyan: #22c8d6;
  --accent-green: #34d470;
  --accent-red: #f55a5a;

  --gradient-fire: linear-gradient(135deg, #ff6b35, #ff3c83);
  --gradient-royal: linear-gradient(135deg, #1a5fd4, #2d7ff9);
  --gradient-gold: linear-gradient(135deg, #f5c542, #ff6b35);
  --gradient-ocean: linear-gradient(135deg, #22c8d6, #2d7ff9);
  --gradient-emerald: linear-gradient(135deg, #34d470, #22c8d6);

  --border-color: #1e2a3e;
  --border-glow: rgba(45, 127, 249, 0.3);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 30px rgba(45, 127, 249, 0.15);

  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

/* --- Focus Visible (Accessibility) --- */
*:focus-visible {
  outline: 2px solid var(--accent-purple);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent-purple);
  outline-offset: 2px;
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

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

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(45, 127, 249, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(255, 60, 131, 0.03) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

/* --- Top Bar --- */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  border-bottom: 1px solid var(--border-color);
  gap: 16px;
  flex-wrap: wrap;
}

.top-bar-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 2px;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-purple);
  text-transform: uppercase;
  letter-spacing: 3px;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.streak-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: default;
  transition: border-color 0.3s;
}

.streak-badge:hover {
  border-color: var(--accent-orange);
}

.streak-icon {
  font-size: 1rem;
}

.streak-count {
  color: var(--accent-orange);
}

.xp-bar-container {
  width: 200px;
}

.level-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  margin-bottom: 4px;
  font-weight: 600;
}

#levelName {
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 1px;
}

#xpText {
  color: var(--text-secondary);
}

.xp-bar {
  height: 6px;
  background: var(--bg-card);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.xp-fill {
  height: 100%;
  background: var(--gradient-gold);
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Navigation --- */
.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  position: relative;
  z-index: 50;
  overflow: visible;
}

.nav-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-btn:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.nav-btn.active {
  color: var(--accent-purple);
  background: rgba(45, 127, 249, 0.1);
}

.nav-icon {
  font-size: 1rem;
}

/* --- Views --- */
.view {
  display: none;
  padding-top: 24px;
  animation: fadeIn 0.3s ease;
}

.view.active {
  display: block;
}

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

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 0.3s;
}

.card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
}

.card h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

/* --- Dashboard Grid --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Hero Card */
.hero-card {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 32px;
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(45, 127, 249, 0.08) 100%);
  border-color: rgba(45, 127, 249, 0.2);
}

.hero-avatar {
  flex-shrink: 0;
}

.avatar-ring {
  position: relative;
  width: 100px;
  height: 100px;
}

.ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: var(--border-color);
  stroke-width: 4;
}

.ring-fill {
  fill: none;
  stroke: url(#ringGradient);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 339.292;
  stroke-dashoffset: 339.292;
  transition: stroke-dashoffset 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.avatar-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--gradient-royal);
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-level {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: white;
}

.hero-info {
  flex: 1;
}

.hero-info h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  color: var(--text-secondary);
  margin: 4px 0 20px;
  font-size: 0.9rem;
}

.hero-stats {
  display: flex;
  gap: 32px;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

/* Quote Card */
.quote-card {
  grid-column: 1 / -1;
  text-align: center;
  background: linear-gradient(135deg, rgba(245, 197, 66, 0.05) 0%, rgba(255, 107, 53, 0.05) 100%);
  border-color: rgba(245, 197, 66, 0.15);
  padding: 32px;
}

.quote-icon {
  font-size: 2rem;
  color: var(--accent-gold);
  margin-bottom: 8px;
}

.quote-text {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  font-style: italic;
  color: var(--text-primary);
  max-width: 600px;
  margin: 0 auto 8px;
  line-height: 1.6;
}

.quote-attr {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Progress Card */
.quest-progress-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quest-progress-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quest-progress-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.quest-progress-info {
  flex: 1;
  min-width: 0;
}

.quest-progress-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quest-progress-bar {
  height: 4px;
  background: var(--bg-primary);
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
}

.quest-progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}

.quest-progress-pct {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  width: 36px;
  text-align: right;
}

/* Activity Card */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  font-size: 0.8rem;
}

.activity-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.activity-text {
  flex: 1;
  color: var(--text-secondary);
}

.activity-xp {
  font-weight: 700;
  color: var(--accent-gold);
  font-size: 0.75rem;
}

.activity-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 20px;
}

/* Next Actions Card */
.next-card {
  grid-column: 1 / -1;
}

.next-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.next-action-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s;
}

.next-action-item:hover {
  border-color: var(--accent-purple);
  background: var(--bg-card-hover);
}

.next-action-quest {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.next-action-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.next-action-xp {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-gold);
  margin-left: auto;
  white-space: nowrap;
}

/* ============================================
   QUEST MAP
   ============================================ */

.quest-map {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quest-line {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s;
}

.quest-line:hover {
  border-color: var(--border-glow);
}

.quest-line.completed {
  border-color: rgba(34, 197, 94, 0.3);
}

.quest-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  cursor: pointer;
  background: var(--bg-card);
  transition: background 0.2s;
  user-select: none;
}

.quest-header:hover {
  background: var(--bg-card-hover);
}

.quest-number {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}

.quest-title-area {
  flex: 1;
  min-width: 0;
}

.quest-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.quest-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.quest-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.quest-task-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.quest-xp-reward {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-gold);
  background: rgba(245, 197, 66, 0.1);
  padding: 4px 10px;
  border-radius: 12px;
}

.quest-chevron {
  color: var(--text-muted);
  transition: transform 0.3s;
  font-size: 1.2rem;
}

.quest-line.expanded .quest-chevron {
  transform: rotate(180deg);
}

.quest-completion-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: white;
}

/* Quest Tasks */
.quest-tasks {
  display: none;
  padding: 0 24px 20px;
  background: var(--bg-card);
}

.quest-line.expanded .quest-tasks {
  display: block;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.quest-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-purple);
}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  transition: all 0.2s;
  cursor: pointer;
}

.task-item:hover {
  background: var(--bg-primary);
}

.task-checkbox {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  margin-top: 1px;
  cursor: pointer;
}

.task-item.completed .task-checkbox {
  background: var(--accent-green);
  border-color: var(--accent-green);
}

.task-checkbox-mark {
  opacity: 0;
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
  transition: opacity 0.2s;
}

.task-item.completed .task-checkbox-mark {
  opacity: 1;
}

.task-info {
  flex: 1;
}

.task-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: color 0.2s;
}

.task-item.completed .task-name {
  color: var(--text-muted);
  text-decoration: line-through;
}

.task-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.4;
}

.task-item.completed .task-desc {
  color: var(--text-muted);
}

.task-xp {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-gold);
  flex-shrink: 0;
  margin-top: 2px;
}

.task-item.completed .task-xp {
  color: var(--text-muted);
}

/* Quest Mini Progress */
.quest-mini-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
}

.quest-mini-bar {
  flex: 1;
  height: 6px;
  background: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
}

.quest-mini-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.quest-mini-text {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ============================================
   ACHIEVEMENTS
   ============================================ */

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.achievement-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.achievement-card.locked {
  opacity: 0.5;
}

.achievement-card.locked:hover {
  opacity: 0.7;
}

.achievement-card.unlocked {
  border-color: rgba(245, 197, 66, 0.3);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(245, 197, 66, 0.05) 100%);
}

.achievement-card.unlocked:hover {
  border-color: rgba(245, 197, 66, 0.5);
  box-shadow: 0 0 30px rgba(245, 197, 66, 0.1);
}

.achievement-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: block;
}

.achievement-card.locked .achievement-icon {
  filter: grayscale(1);
}

.achievement-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.achievement-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.achievement-card.locked .achievement-name,
.achievement-card.locked .achievement-desc {
  color: var(--text-muted);
}

.achievement-unlocked-tag {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 8px;
}

/* ============================================
   JOURNAL
   ============================================ */

.journal-container {
  max-width: 700px;
  margin: 0 auto;
}

.journal-header {
  text-align: center;
  margin-bottom: 24px;
}

.journal-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--gradient-ocean);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.journal-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}

.journal-input {
  margin-bottom: 32px;
}

.journal-input textarea {
  width: 100%;
  min-height: 120px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.9rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.3s;
  margin-bottom: 12px;
}

.journal-input textarea:focus {
  border-color: var(--accent-purple);
}

.journal-input textarea::placeholder {
  color: var(--text-muted);
}

.btn-primary {
  background: var(--gradient-royal);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(45, 127, 249, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.journal-entries {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.journal-entry-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}

.journal-entry-date {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.journal-entry-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* ============================================
   MODALS & TOASTS
   ============================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.modal-overlay.show {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.level-up-modal {
  background: var(--bg-card);
  border: 1px solid rgba(245, 197, 66, 0.3);
  border-radius: var(--radius-xl);
  padding: 48px;
  text-align: center;
  position: relative;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 0 60px rgba(245, 197, 66, 0.15);
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.level-up-icon {
  font-size: 4rem;
  color: var(--accent-gold);
  margin-bottom: 8px;
  display: block;
  animation: starSpin 1s ease;
}

@keyframes starSpin {
  from { transform: rotate(-180deg) scale(0); }
  to { transform: rotate(0) scale(1); }
}

.level-up-modal h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 4px;
  margin-bottom: 8px;
}

.level-up-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.level-up-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

/* Toast */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid rgba(245, 197, 66, 0.4);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.fade-out {
  animation: slideOutRight 0.3s ease forwards;
}

@keyframes slideOutRight {
  to { transform: translateX(100%); opacity: 0; }
}

.toast-icon {
  font-size: 1.5rem;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.toast-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.toast-xp {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--accent-gold);
}

/* Confetti */
.confetti-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: confettiFall 2s ease forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(-20px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(400px) rotate(720deg);
    opacity: 0;
  }
}

/* ============================================
   XP POP ANIMATION
   ============================================ */

.xp-pop {
  position: fixed;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent-gold);
  pointer-events: none;
  z-index: 1200;
  animation: xpFloat 1.2s ease forwards;
  text-shadow: 0 0 10px rgba(245, 197, 66, 0.5);
}

@keyframes xpFloat {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  50% {
    opacity: 1;
    transform: translateY(-30px) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translateY(-60px) scale(0.8);
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  #app {
    padding: 0 12px 40px;
  }

  .top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .top-bar-right {
    width: 100%;
  }

  .xp-bar-container {
    flex: 1;
  }

  .main-nav {
    flex-wrap: wrap;
    overflow: visible;
  }

  .nav-btn {
    white-space: nowrap;
    padding: 8px 14px;
    font-size: 0.8rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .hero-card {
    flex-direction: column;
    text-align: center;
  }

  .hero-stats {
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
  }

  .quest-header {
    padding: 16px;
  }

  .quest-meta {
    display: none;
  }

  .achievements-grid {
    grid-template-columns: 1fr 1fr;
  }

  .next-actions {
    grid-template-columns: 1fr;
  }

  .toast {
    min-width: auto;
    right: 12px;
    left: 12px;
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 1rem;
  }

  .achievements-grid {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    gap: 16px;
  }

  .stat-value {
    font-size: 1.2rem;
  }
}

/* ============================================
   LESSON CARDS & INLINE QUOTES
   ============================================ */

/* Lesson Card */
.lesson-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color 0.3s;
}

.lesson-card.lesson {
  border-left: 3px solid var(--accent-purple);
}

.lesson-card.story {
  border-left: 3px solid var(--accent-orange);
}

.lesson-card.read {
  opacity: 0.7;
  border-color: rgba(34, 197, 94, 0.2);
}

.lesson-card.read.lesson {
  border-left-color: var(--accent-green);
}

.lesson-card.read.story {
  border-left-color: var(--accent-green);
}

.lesson-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px 0;
  flex-wrap: wrap;
}

.lesson-type-badge {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 3px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

.lesson-type-badge.lesson {
  background: rgba(45, 127, 249, 0.15);
  color: var(--accent-purple);
}

.lesson-type-badge.story {
  background: rgba(255, 107, 53, 0.15);
  color: var(--accent-orange);
}

.lesson-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

.lesson-card.read .lesson-title {
  color: var(--text-secondary);
}

.lesson-xp {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-gold);
  flex-shrink: 0;
}

.lesson-read-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent-green);
  flex-shrink: 0;
}

.lesson-body {
  padding: 12px 18px 6px;
}

.lesson-body p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 10px;
}

.lesson-card.read .lesson-body p {
  color: var(--text-secondary);
}

.btn-mark-read {
  display: block;
  width: calc(100% - 36px);
  margin: 4px 18px 14px;
  padding: 10px;
  background: rgba(45, 127, 249, 0.1);
  border: 1px solid rgba(45, 127, 249, 0.25);
  color: var(--accent-purple);
  font-family: var(--font-main);
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-mark-read:hover {
  background: rgba(45, 127, 249, 0.2);
  border-color: var(--accent-purple);
}

/* Inline Quote */
.inline-quote {
  text-align: center;
  padding: 16px 24px;
  margin: 6px 0 10px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  font-style: italic;
  color: var(--accent-gold);
  line-height: 1.5;
  position: relative;
}

.iq-mark {
  font-size: 1.2rem;
  opacity: 0.5;
  vertical-align: middle;
}

/* Adjust task items in new flow */
.quest-tasks .task-item {
  margin-bottom: 4px;
}

/* Adjust quest-desc removal (replaced by lessons) */
.quest-desc {
  display: none;
}

/* ============================================
   EXPAND / COLLAPSE (Continue Reading)
   ============================================ */

.lesson-full-content {
  display: none;
  padding: 0 18px;
}

.lesson-card.expanded .lesson-full-content {
  display: block;
  animation: fadeIn 0.3s ease;
}

.lesson-full-content p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 10px;
}

.lesson-card.read .lesson-full-content p {
  color: var(--text-secondary);
}

.btn-continue-reading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: calc(100% - 36px);
  margin: 0 18px 8px;
  padding: 8px;
  background: none;
  border: 1px dashed var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}

.btn-continue-reading:hover {
  border-color: var(--accent-purple);
  color: var(--accent-purple);
  background: rgba(45, 127, 249, 0.05);
}

.btn-continue-reading .chevron {
  transition: transform 0.3s;
  font-size: 0.65rem;
}

.lesson-card.expanded .btn-continue-reading .chevron {
  transform: rotate(180deg);
}

.lesson-card.expanded .btn-continue-reading {
  border-style: solid;
  border-color: var(--border-color);
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* Fade for preview truncation */
.lesson-preview-fade {
  position: relative;
}

.lesson-preview-fade::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: linear-gradient(transparent, var(--bg-primary));
  pointer-events: none;
}

.lesson-card.expanded .lesson-preview-fade::after,
.lesson-card.read .lesson-preview-fade::after {
  display: none;
}

/* ============================================
   MEDIA VAULT
   ============================================ */

.media-container {
  max-width: 1000px;
  margin: 0 auto;
}

.media-header {
  text-align: center;
  margin-bottom: 32px;
}

.media-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--gradient-fire);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.media-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}

.media-category {
  margin-bottom: 32px;
}

.media-category-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.media-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.3s;
}

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

.media-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-primary);
}

.media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s, filter 0.3s;
}

.media-card:hover .media-thumb img {
  transform: scale(1.05);
  filter: brightness(0.8);
}

.media-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: white;
  padding-left: 3px;
  transition: all 0.3s;
}

.media-card:hover .media-play-btn {
  background: var(--accent-pink);
  border-color: var(--accent-pink);
  transform: translate(-50%, -50%) scale(1.1);
}

.media-thumb.playing {
  cursor: default;
}

.media-thumb.playing iframe {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.media-info {
  padding: 14px 16px;
}

.media-title {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.media-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .media-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   DROP BUILDER
   ============================================ */

.drops-container {
  max-width: 900px;
  margin: 0 auto;
}

.drops-header {
  text-align: center;
  margin-bottom: 28px;
}

.drops-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #f5c542, #ff3c83);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.drops-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* Idea Generator */
.drop-generator-card {
  margin-bottom: 20px;
}

.dg-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.dg-top h3 {
  margin-bottom: 0;
}

.drop-spin-btn {
  padding: 10px 24px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.generated-idea {
  margin-top: 16px;
}

.gi-card {
  background: var(--bg-primary);
  border: 1px solid rgba(245, 197, 66, 0.2);
  border-radius: var(--radius-md);
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.gi-type {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-gold);
  margin-bottom: 6px;
}

.gi-icon {
  font-size: 1rem;
  margin-right: 4px;
}

.gi-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.gi-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.gi-meta {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.gi-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 4px 10px;
  border-radius: 6px;
}

.btn-secondary {
  background: rgba(245, 197, 66, 0.1);
  border: 1px solid rgba(245, 197, 66, 0.3);
  color: var(--accent-gold);
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: rgba(245, 197, 66, 0.2);
  border-color: var(--accent-gold);
}

/* Wizard */
.drop-wizard-card {
  margin-bottom: 20px;
}

.wizard-sub {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.wizard-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.wiz-row {
  display: flex;
  gap: 14px;
}

.wiz-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: relative;
}

.wiz-field label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.wiz-field input,
.wiz-field select {
  padding: 10px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.3s;
}

.wiz-field input:focus,
.wiz-field select:focus {
  border-color: var(--accent-purple);
}

.wiz-field select {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23707088' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.wiz-field select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.wiz-field input[type="range"] {
  padding: 0;
  border: none;
  background: none;
  -webkit-appearance: auto;
  appearance: auto;
  accent-color: var(--accent-purple);
}

.range-val {
  position: absolute;
  right: 0;
  top: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-purple);
}

/* Revenue Projection */
.revenue-projection {
  margin-top: 20px;
  padding: 20px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.revenue-projection h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.rev-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.rev-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rev-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.rev-value {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
}

.rev-neg {
  color: var(--accent-red);
}

.rev-profit {
  color: var(--accent-green);
}

.margin-warning {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.5;
}

.margin-warning.warn {
  background: rgba(245, 197, 66, 0.1);
  color: var(--accent-gold);
  border: 1px solid rgba(245, 197, 66, 0.2);
}

.margin-warning.danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.drop-build-btn {
  margin-top: 20px;
  width: 100%;
  padding: 14px;
  font-size: 0.9rem;
}

/* Launch Playbook */
.playbook-card {
  margin-bottom: 20px;
}

.pb-header {
  margin-bottom: 24px;
}

.pb-header h3 {
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.pb-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.pb-phase {
  margin-bottom: 28px;
}

.pb-phase-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.pb-phase-num {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--gradient-royal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}

.pb-phase-header h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.pb-phase-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.pb-timeline {
  margin-left: 17px;
  border-left: 2px solid var(--border-color);
  padding-left: 24px;
}

.pb-day {
  margin-bottom: 18px;
  position: relative;
}

.pb-day::before {
  content: '';
  position: absolute;
  left: -30px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-purple);
  border: 2px solid var(--bg-card);
}

.pb-day-label {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-purple);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.pb-day-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pb-task {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
  padding: 8px 12px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.pb-task strong {
  color: var(--text-primary);
}

.pb-check {
  margin-right: 6px;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
  .wiz-row {
    flex-direction: column;
  }

  .rev-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dg-top {
    flex-direction: column;
    align-items: stretch;
  }

  .pb-timeline {
    margin-left: 10px;
    padding-left: 16px;
  }
}

/* ============================================
   FOOTER
   ============================================ */

.app-footer {
  margin-top: 60px;
  padding: 24px 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.app-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  margin: 0 12px;
  transition: color 0.2s;
}

.app-footer a:hover {
  color: var(--accent-purple);
}

.app-footer .footer-links {
  margin-bottom: 8px;
}

.app-footer .footer-copy {
  font-size: 0.68rem;
}
