/* XP Toast Notification */
.xp-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-150%);
  background: linear-gradient(135deg, rgba(20, 20, 35, 0.95), rgba(30, 30, 50, 0.95));
  border: 2px solid var(--accent-primary);
  border-radius: 15px;
  padding: 15px 25px;
  z-index: 9999;
  box-shadow: 0 10px 40px rgba(74, 144, 226, 0.4);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  min-width: 280px;
  max-width: 95vw;
  box-sizing: border-box;
}

.xp-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.xp-toast-content {
  display: flex;
  align-items: center;
  gap: 15px;
}

.xp-toast-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  animation: xpPulse 0.5s ease-in-out;
}

@keyframes xpPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
  }
}

.xp-toast-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.xp-toast-title {
  font-size: 0.9rem;
  color: var(--accent-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.xp-toast-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: #ffd700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.xp-toast-stat {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: capitalize;
}

.xp-toast-bar {
  margin-top: 10px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.xp-toast-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary), #ffd700);
  width: 100%;
  animation: xpToastDrain 3s linear forwards;
}

@keyframes xpToastDrain {
  from {
    width: 100%;
  }

  to {
    width: 0%;
  }
}

/* Due Date Reminder Toast */
.due-date-reminder {
  position: fixed;
  top: 100px;
  right: 20px;
  min-width: 320px;
  max-width: 380px;
  z-index: 9998;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(20, 22, 40, 0.96), rgba(30, 28, 50, 0.96));
  border: 1px solid rgba(255, 209, 102, 0.25);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 209, 102, 0.1);
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

.due-date-reminder.show {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.due-date-reminder.hide {
  transform: translateX(120%);
  opacity: 0;
}

.due-date-reminder-content {
  display: flex;
  align-items: center;
  padding: 16px 18px;
  gap: 14px;
}

.due-date-reminder-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.2), rgba(255, 209, 102, 0.05));
  color: var(--accent-tertiary);
  border: 1px solid rgba(255, 209, 102, 0.2);
}

.due-date-reminder-icon.urgent {
  background: linear-gradient(135deg, rgba(255, 73, 97, 0.2), rgba(255, 73, 97, 0.05));
  color: var(--accent-quaternary);
  border-color: rgba(255, 73, 97, 0.2);
}

.due-date-reminder-icon.due-soon {
  background: linear-gradient(135deg, rgba(255, 146, 43, 0.2), rgba(255, 146, 43, 0.05));
  color: var(--accent-orange);
  border-color: rgba(255, 146, 43, 0.2);
}

.due-date-reminder-info {
  flex-grow: 1;
  min-width: 0;
}

.due-date-reminder-title {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--accent-tertiary);
  margin-bottom: 4px;
}

.due-date-reminder-title.urgent {
  color: var(--accent-quaternary);
}

.due-date-reminder-title.due-soon {
  color: var(--accent-orange);
}

.due-date-reminder-message {
  display: block;
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.due-date-reminder-count {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent-tertiary);
  text-shadow: 0 0 15px rgba(255, 209, 102, 0.3);
  flex-shrink: 0;
  line-height: 1;
}

.due-date-reminder-count.urgent {
  color: var(--accent-quaternary);
  text-shadow: 0 0 15px rgba(255, 73, 97, 0.3);
}

.due-date-reminder-count.due-soon {
  color: var(--accent-orange);
  text-shadow: 0 0 15px rgba(255, 146, 43, 0.3);
}

.due-date-reminder-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
}

.due-date-reminder-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-tertiary), var(--accent-orange));
  width: 100%;
  animation: reminderDrain 6s linear forwards;
}

.due-date-reminder-progress.urgent {
  background: linear-gradient(90deg, var(--accent-quaternary), var(--accent-coral));
}

.due-date-reminder-progress.due-soon {
  background: linear-gradient(90deg, var(--accent-orange), var(--accent-tertiary));
}

@keyframes reminderDrain {
  from { width: 100%; }
  to { width: 0%; }
}

.due-date-reminder-stacked {
  position: fixed;
  top: 100px;
  right: 20px;
  z-index: 9997;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
}

.due-date-reminder-stacked .due-date-reminder {
  position: relative;
  top: auto;
  right: auto;
}

/* Level Up Overlay */
.level-up-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  cursor: pointer;
}

.level-up-overlay.show {
  display: flex;
  animation: levelUpFadeIn 0.3s ease-out;
}

@keyframes levelUpFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.level-up-content {
  text-align: center;
  animation: levelUpBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes levelUpBounce {
  0% {
    transform: scale(0);
    opacity: 0;
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.level-up-icon {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 3rem;
  color: white;
  box-shadow: 0 0 50px rgba(255, 215, 0, 0.6);
  animation: levelUpGlow 1s ease-in-out infinite alternate;
}

@keyframes levelUpGlow {
  from {
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.4);
  }

  to {
    box-shadow: 0 0 60px rgba(255, 215, 0, 0.8);
  }
}

.level-up-text {
  font-size: 3rem;
  font-weight: 800;
  color: #ffd700;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
  margin: 0;
}

.level-up-number {
  font-size: 6rem;
  font-weight: 900;
  color: white;
  text-shadow: 0 0 40px rgba(255, 255, 255, 0.5);
  margin: 10px 0;
}

.level-up-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* Theme Variables */
:root {
  /* Dark Theme (Default) — Solo Leveling inspired palette */
  --bg-main: #0d0d14;
  --bg-card: rgba(22, 24, 35, 0.92);
  --bg-card-dark: rgba(16, 18, 28, 0.75);
  --bg-card-darker: rgba(12, 14, 22, 0.85);
  --bg-element: rgba(30, 32, 45, 0.7);
  --text-primary: #e8e8ee;
  --text-secondary: #9898b0;
  --text-tertiary: #a6a7b5;
  --accent-primary: #4a90e2;
  --accent-secondary: #4ecdc4;
  --accent-tertiary: #ffd166;
  --accent-quaternary: #ff4961;
  --accent-quinary: #b388ff;
  --accent-green: #51cf66;
  --accent-coral: #ff6b6b;
  --accent-orange: #ff922b;
  --border-light: rgba(74, 144, 226, 0.2);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --shadow-color: rgba(0, 0, 0, 0.7);
  --transition-speed: 0.3s;
  --border-radius-sm: 5px;
  --border-radius-md: 10px;
  --border-radius-lg: 15px;
  --box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
  --font-family: 'Poppins', sans-serif;
}

/* Light Theme */
.theme-light {
  --bg-main: #e8e8f0;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-card-dark: rgba(240, 240, 248, 0.85);
  --bg-card-darker: rgba(230, 230, 240, 0.9);
  --bg-element: rgba(245, 245, 252, 0.85);
  --text-primary: #1a1a28;
  --text-secondary: #555570;
  --accent-primary: #2970c3;
  --accent-secondary: #3aaa9c;
  --accent-tertiary: #d4a840;
  --accent-quaternary: #cc3350;
  --accent-quinary: #8a5cd9;
  --accent-green: #3da84e;
  --accent-coral: #d45555;
  --accent-orange: #e07a1a;
  --border-light: rgba(41, 112, 195, 0.18);
  --border-subtle: rgba(0, 0, 0, 0.08);
  --shadow-color: rgba(0, 0, 0, 0.1);
  --box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
}



/* Ensure proper top visibility and spacing */
.container {
  margin-top: 0;
  margin-bottom: 2rem;
}

/* Fix potential overflow issues */
body {
  overflow-x: hidden;
}

/* Ensure header is always at the top */
.app-header {
  position: relative;
  z-index: 10;
}

/* Add some breathing room at the very top */
.container>*:first-child {
  margin-top: 0;
}

/* Ensure proper spacing between top sections */
.level-up,
.view-toggle-container,
.streak-container {
  margin-top: 0;
}

/* Force top sections to be visible */
.app-header,
.level-up,
.view-toggle-container,
.streak-container {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Base Styles */
body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-primary);
  margin: 0;
  padding: 20px;
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(100, 100, 255, 0.05) 0%, transparent 25%),
    radial-gradient(circle at 90% 80%, rgba(255, 100, 100, 0.05) 0%, transparent 25%);
  background-attachment: fixed;
  transition: background-color var(--transition-speed) ease,
    color var(--transition-speed) ease;
  display: block;
  overflow-x: hidden;
}

.container {
  background-color: var(--bg-card);
  border-radius: var(--border-radius-lg);
  padding: 2.5rem;
  box-shadow: var(--box-shadow);
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  border: 1px solid var(--border-light);
  transition: background-color var(--transition-speed) ease,
    border-color var(--transition-speed) ease,
    box-shadow var(--transition-speed) ease;
  animation: fadeIn 0.8s ease-out;
  position: relative;
  box-sizing: border-box;
  margin-top: 0;
  margin-bottom: 2rem;
}

.container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary), var(--accent-tertiary));
  border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

/* Theme Toggle */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.theme-toggle button {
  background-color: transparent;
  border: none;
  color: var(--accent-primary);
  font-size: 1.5rem;
  cursor: pointer;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease, transform 0.3s ease;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  background-color: rgba(30, 30, 40, 0.5);
}

.theme-toggle button:hover {
  background-color: rgba(74, 144, 226, 0.1);
  transform: rotate(15deg);
}

.theme-dark .theme-toggle button i {
  color: #f1c40f;
}

.theme-light .theme-toggle button i {
  color: #3498db;
}

.theme-light .theme-toggle button i:before {
  content: "\f185";
  /* sun icon */
}

/* App Header */
.app-header {
  text-align: center;
  margin-bottom: 2.5rem;
  padding: 2rem 0;
  border-bottom: 2px solid rgba(74, 144, 226, 0.2);
  position: relative;
  background: rgba(40, 40, 50, 0.2);
  border-radius: var(--border-radius-md);
  margin-top: 0;
  z-index: 10;
}

.app-header::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 1px;
}

.app-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 10px rgba(74, 144, 226, 0.3);
  line-height: 1.2;
}

.user-profile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.avatar-wrapper {
  position: relative;
  margin-bottom: 1rem;
}

.avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background-color: var(--accent-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 0 15px var(--accent-primary);
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
  animation: pulse 3s infinite;
}

.avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px var(--accent-primary);
}

/* Typography */
h1,
h2,
h3 {
  color: var(--accent-primary);
  text-align: center;
  text-shadow: 0 0 10px rgba(74, 144, 226, 0.3);
  transition: color var(--transition-speed) ease;
  margin-top: 0;
}

h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  opacity: 0.9;
}

h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

p {
  line-height: 1.6;
  margin: 0.5rem 0;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 10px var(--accent-primary);
  }

  50% {
    box-shadow: 0 0 20px var(--accent-primary);
  }

  100% {
    box-shadow: 0 0 10px var(--accent-primary);
  }
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Updated Components with Theme Support */

.stats {
  margin-bottom: 3rem;
  padding: 2rem;
  background: rgba(40, 40, 50, 0.3);
  border-radius: var(--border-radius-lg);
  border: 1px solid rgba(74, 144, 226, 0.2);
  position: relative;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stats::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.stats-title {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--text-primary);
  font-size: 1.8rem;
  font-weight: 600;
  position: relative;
  padding-bottom: 1rem;
}

.stats-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 1px;
}

.stat {
  text-align: center;
  margin: 1rem;
  background-color: var(--bg-element);
  padding: 0.7rem 1.2rem;
  border-radius: var(--border-radius-sm);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(78, 205, 196, 0.1);
}

.stat:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.stat-value {
  font-size: 2.2rem;
  font-weight: bold;
  color: var(--accent-secondary);
  text-shadow: 0 0 5px rgba(78, 205, 196, 0.3);
  transition: color var(--transition-speed) ease;
}

@keyframes statPulse {
  0% {
    transform: scale(1);
    color: var(--accent-secondary);
  }

  50% {
    transform: scale(1.3);
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
  }

  100% {
    transform: scale(1);
    color: var(--accent-secondary);
  }
}

.stat-value.animate {
  animation: statPulse 0.5s ease-out;
}

.quests {
  margin-top: 2rem;
}

.quest {
  background-color: rgba(40, 40, 50, 0.7);
  border-radius: 5px;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(100, 100, 255, 0.2);
  transition: all 0.3s ease;
  position: relative;
  padding-bottom: 40px;
  /* Add padding to the bottom to make space for the button */
}

.quest:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.quest-title {
  font-weight: bold;
  color: var(--accent-tertiary);
}

.quest-difficulty {
  font-size: 0.8rem;
  color: #06d6a0;
}

.quest-xp {
  float: right;
  color: #118ab2;
}

.quest-stat {
  font-size: 0.8rem;
  color: var(--accent-secondary);
  margin-right: 0.5rem;
}

/* New: Category badge */
.quest-category {
  font-size: 0.7rem;
  background-color: rgba(74, 144, 226, 0.2);
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
  color: var(--accent-primary);
}

/* Category colors (legacy) */
.category-work {
  background-color: rgba(74, 144, 226, 0.15);
  color: var(--accent-primary);
}

.category-health {
  background-color: rgba(81, 207, 102, 0.15);
  color: var(--accent-green);
}

.category-learning {
  background-color: rgba(179, 136, 255, 0.15);
  color: var(--accent-quinary);
}

.category-personal {
  background-color: rgba(255, 107, 107, 0.15);
  color: var(--accent-coral);
}

.quest-check {
  cursor: pointer;
  color: var(--accent-primary);
  font-size: 1.2rem;
  margin-right: 0.5rem;
  transition: all 0.3s ease;
}

.quest-check:hover {
  transform: scale(1.2);
}

.delete-quest-btn {
  background-color: transparent;
  border: none;
  color: var(--accent-quaternary);
  /* Red color for delete action */
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
  transition: all 0.3s ease;
  position: absolute;
  bottom: 5px;
  right: 5px;
  opacity: 0.7;
}

.delete-quest-btn:hover {
  background-color: rgba(255, 73, 97, 0.1);
  color: #f44336;
  opacity: 1;
  transform: scale(1.1);
}

.default-quest-btn {
  background-color: transparent;
  border: none;
  color: #ccc;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
  transition: all 0.3s ease;
  opacity: 0.7;
}

.default-quest-btn:hover {
  color: var(--accent-quaternary);
  opacity: 1;
  transform: scale(1.1);
}

.default-quest-btn.favorited {
  color: var(--accent-quaternary);
}

button {
  background-color: var(--accent-primary);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px rgba(74, 144, 226, 0.5);
}

button:hover {
  background-color: #5a9ff2;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(74, 144, 226, 0.7);
}

.level-up {
  background: linear-gradient(135deg, rgba(74, 144, 226, 0.1), rgba(78, 205, 196, 0.1));
  border: 1px solid rgba(74, 144, 226, 0.3);
  border-radius: var(--border-radius-md);
  padding: 1.5rem;
  margin-bottom: 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(74, 144, 226, 0.1);
  margin-top: 0;
}

.level-up::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.05) 50%, transparent 70%);
  animation: shimmer 3s infinite;
}

.level-up .level {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 1rem;
  text-shadow: 0 2px 10px rgba(74, 144, 226, 0.3);
}

.level-up p {
  margin: 1rem 0 0 0;
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.level {
  font-size: 3rem;
  font-weight: bold;
  color: var(--accent-tertiary);
  text-shadow: 0 0 10px rgba(255, 209, 102, 0.5);
}

.xp-bar {
  width: 100%;
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  margin: 1rem 0;
  border: 1px solid rgba(74, 144, 226, 0.3);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.xp-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 10px;
  width: 0%;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.xp-progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

.edit-quest {
  background-color: var(--accent-secondary);
  margin-left: 0.5rem;
}

.edit-quest:hover {
  background-color: #5eddd4;
}

.quest-input {
  width: 100%;
  background-color: rgba(60, 60, 70, 0.7);
  color: #ffffff;
  border: none;
  padding: 0.5rem;
  margin-top: 0.5rem;
  border-radius: 3px;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.3);
}

.save-quest {
  background-color: #06d6a0;
  margin-top: 0.5rem;
}

.save-quest:hover {
  background-color: #16e6b0;
}

#add-quest-btn {
  display: none;
}

#penalty-zone {
  background-color: rgba(255, 0, 0, 0.1);
  border: 2px solid #ff0000;
  border-radius: 10px;
  padding: 1rem;
  margin-top: 2rem;
}

#penalty-zone h2 {
  color: #ff0000;
}

#penalty-quests li {
  margin-bottom: 0.5rem;
}

.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 25px;
  border-radius: 5px;
  color: white;
  z-index: 1000;
}

.notification.success {
  background-color: #4CAF50;
}

.notification.error {
  background-color: #f44336;
}

.settings-icon {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--accent-primary);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  z-index: 1000;
}

.settings-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(20, 20, 30, 0.95);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 2px solid var(--accent-primary);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  z-index: 2000;
  min-width: 300px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
}

.settings-modal.show {
  display: block;
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.settings-modal h2 {
  margin: 0 0 1.5rem 0;
  color: var(--text-primary);
  font-size: 1.6rem;
  font-weight: 600;
  text-align: center;
  position: relative;
  padding: 1rem 2rem 1rem 2rem;
  border-bottom: 1px solid rgba(74, 144, 226, 0.2);
}

.settings-modal button {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  border: none;
  border-radius: var(--border-radius-md);
  padding: 12px 20px;
  margin: 8px 0;
  width: 100%;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 1rem;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  margin: 8px 0;
  background: rgba(74, 144, 226, 0.1);
  border-radius: var(--border-radius-md);
  border: 1px solid rgba(74, 144, 226, 0.2);
}

.settings-row label {
  flex: 1;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
}

.settings-row select {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid rgba(74, 144, 226, 0.3);
  border-radius: var(--border-radius-sm);
  padding: 8px 12px;
  font-size: 0.95rem;
  cursor: pointer;
  min-width: 160px;
}

.settings-row select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.settings-modal button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(74, 144, 226, 0.3);
}

.settings-modal button:active {
  transform: translateY(0);
}

/* Auth Section in Settings */
.settings-section {
  padding: 12px 20px;
  margin: 8px 0;
  background: rgba(74, 144, 226, 0.08);
  border-radius: var(--border-radius-md);
  border: 1px solid rgba(74, 144, 226, 0.15);
}

.auth-section h3 {
  margin: 0 0 12px 0;
  font-size: 1rem;
  color: var(--text-primary);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-section h3 i {
  color: var(--accent-primary);
}

#google-signin-btn-container {
  display: flex;
  justify-content: center;
  min-height: 40px;
  align-items: center;
}

.google-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: rgba(74, 144, 226, 0.1);
  border-radius: var(--border-radius-md);
  margin-bottom: 8px;
}

.google-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--accent-primary);
  object-fit: cover;
}

.google-user-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.google-user-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.google-user-email {
  font-size: 0.8rem;
  color: var(--text-secondary);
  opacity: 0.7;
}

.settings-modal button.danger-btn {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  margin-top: 0;
}

.settings-modal button.danger-btn:hover {
  box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

.settings-divider {
  border: none;
  border-top: 1px solid rgba(74, 144, 226, 0.15);
  margin: 16px 0;
}

/* Modal Overlay */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  z-index: 1999;
}

.modal-overlay.show {
  display: block;
  animation: overlayFadeIn 0.3s ease-out;
  background: rgba(0, 0, 0, 0.35);
  /* lighter overlay to reduce haze */
}

@keyframes overlayFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-content {
  padding: 2rem;
}

.modal-content h2 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  font-size: 1.6rem;
  font-weight: 600;
  text-align: center;
  position: relative;
  padding-bottom: 1rem;
}

.modal-content h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 1px;
}

.modal-close {
  position: absolute;
  right: 10px;
  top: 10px;
  cursor: pointer;
  font-size: 24px;
  color: var(--accent-primary);
}

.glow {
  text-shadow: 0 0 10px var(--accent-primary), 0 0 20px var(--accent-primary), 0 0 30px var(--accent-primary);
  animation: glow 1.5s ease-in-out infinite alternate;
}

.stat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.stat-tag {
  background-color: var(--accent-primary);
  color: white;
  border: none;
  padding: 0.3rem 0.5rem;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.8rem;
}

.stat-tag:hover {
  background-color: #5a9ff2;
}

.stat-tag.selected {
  background-color: #06d6a0;
}

.status-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.status-tag {
  background-color: var(--accent-secondary);
  color: white;
  border: none;
  padding: 0.3rem 0.5rem;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.8rem;
}

.status-tag:hover {
  background-color: #5eddd4;
}

.tour-highlight {
  position: relative;
  z-index: 9999;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7);
}

.tour-tooltip {
  position: absolute;
  background: rgba(20, 22, 35, 0.96);
  border: 1px solid var(--accent-primary);
  color: var(--text-primary);
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(74, 144, 226, 0.15);
  z-index: 10000;
  max-width: 340px;
  min-width: 220px;
  backdrop-filter: blur(12px);
  font-size: 0.95rem;
  line-height: 1.5;
}

.tour-tooltip::after {
  content: "";
  position: absolute;
  border-style: solid;
  border-width: 10px;
  border-color: transparent;
}

.tour-tooltip.top::after {
  border-top-color: var(--accent-primary);
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
}

.tour-tooltip.bottom::after {
  border-bottom-color: var(--accent-primary);
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
}

.tour-tooltip.left::after {
  border-left-color: var(--accent-primary);
  right: -20px;
  top: 50%;
  transform: translateY(-50%);
}

.tour-tooltip.right::after {
  border-right-color: var(--accent-primary);
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
}

.tour-tooltip h3 {
  margin: 0 0 8px 0;
  font-size: 1.1rem;
  color: var(--accent-primary);
  text-align: left;
  text-shadow: 0 0 10px rgba(74, 144, 226, 0.3);
}

.tour-tooltip p {
  margin: 0 0 4px 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.tour-tooltip .tour-step-indicator {
  font-size: 0.75rem;
  color: var(--text-tertiary, #a6a7b5);
  white-space: nowrap;
}

/* Pagination dots */
.tour-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}

.tour-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.25s ease;
  display: inline-block;
  cursor: pointer;
}

.tour-dot.active {
  background: var(--accent-primary);
  box-shadow: 0 0 6px rgba(74, 144, 226, 0.6);
  width: 8px;
  height: 8px;
}

.tour-dismiss {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-secondary, #999);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: all 0.15s ease;
  z-index: 1;
}

.tour-dismiss:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.tour-buttons {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.tour-buttons button {
  padding: 6px 14px;
  background: var(--accent-primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.tour-buttons button:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.tour-buttons button.tour-prev {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

.tour-buttons button.tour-prev:hover {
  background: rgba(255, 255, 255, 0.25);
}

.tour-buttons button.tour-end {
  background: rgba(231, 76, 60, 0.8);
}

.tour-buttons button.tour-end:hover {
  background: rgba(231, 76, 60, 1);
}

/* Pagination area below buttons: step counter + dots */
.tour-pagination {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.tour-buttons .tour-end-silent {
  background: none;
  color: var(--text-secondary, #888);
  padding: 6px 8px;
  font-size: 0.8rem;
  border: none;
  cursor: pointer;
  transition: color 0.15s ease;
}

.tour-buttons .tour-end-silent:hover {
  color: var(--text-primary, #ccc);
  filter: none;
  transform: none;
}

.check-icon {
  fill: var(--accent-primary);
  transition: all 0.3s ease;
  filter: drop-shadow(0 0 5px rgba(74, 144, 226, 0.5));
}

.check-icon:hover {
  transform: scale(1.2);
  filter: drop-shadow(0 0 10px rgba(74, 144, 226, 0.8));
}


.difficulty-tag,
.stat-tag {
  background-color: transparent;
  color: #ffffff;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  cursor: pointer;
}

.difficulty-tag:hover,
.stat-tag:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(74, 144, 226, 0.5);
}

.difficulty-tag.selected,
.stat-tag.selected {
  border-color: #06d6a0;
  box-shadow: 0 0 10px rgba(6, 214, 160, 0.8);
}

/* Add these new styles */
.glow-button {
  border: 2px solid rgba(78, 205, 196, 0.5);
  box-shadow: 0 0 10px rgba(78, 205, 196, 0.5);
  animation: glowShadow 1.5s ease-in-out infinite alternate;
  transition: all 0.3s ease;
}

.glow-button.selected {
  background-color: #06d6a0;
  border-color: #06d6a0;
  box-shadow: 0 0 15px rgba(6, 214, 160, 0.8);
}

@keyframes glowShadow {
  from {
    box-shadow: 0 0 5px rgba(78, 205, 196, 0.5);
  }

  to {
    box-shadow: 0 0 15px rgba(78, 205, 196, 0.8);
  }
}

/* Quest Edit Panel */
.quest-edit-panel {
  background: rgba(22, 24, 38, 0.97);
  border: 1px solid var(--accent-primary);
  border-radius: var(--border-radius-md);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  position: relative;
  box-shadow: 0 4px 20px rgba(74, 144, 226, 0.15);
}

.quest-edit-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
}

.edit-panel-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.edit-title-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.edit-title-input {
  flex: 1;
}

.suggest-btn {
  background: rgba(255, 209, 102, 0.1);
  border: 1px solid rgba(255, 209, 102, 0.25);
  color: var(--accent-tertiary);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  flex-shrink: 0;
  padding: 0;
  transition: all 0.2s ease;
}

.suggest-btn:hover {
  background: rgba(255, 209, 102, 0.2);
  border-color: var(--accent-tertiary);
  transform: scale(1.05);
}

.suggest-btn.active {
  background: rgba(255, 209, 102, 0.25);
  border-color: var(--accent-tertiary);
  box-shadow: 0 0 10px rgba(255, 209, 102, 0.3);
}

.edit-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.edit-category-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.edit-diff-group {
  display: flex;
  gap: 4px;
  align-items: center;
}.edit-xp-group {
  display: flex;
  align-items: center;
  gap: 4px;
}
.edit-xp-group label {
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
}
.edit-repeat-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.edit-repeat-group label {
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  margin-right: 4px;
}

.edit-stat-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.edit-footer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.edit-date-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.edit-date-group label {
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.edit-date-group input {
  width: 140px;
}

.edit-comment-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 120px;
}

.edit-comment-group input {
  flex: 1;
  min-width: 80px;
}

.pin-checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.pin-checkbox input {
  display: none;
}

.pin-checkbox i {
  font-size: 0.85rem;
  transition: color 0.2s ease;
}

.pin-checkbox input:checked + i {
  color: var(--accent-tertiary);
}

.quest-input {
  background: rgba(40, 40, 50, 0.7);
  color: var(--text-primary);
  border: 1px solid rgba(78, 205, 196, 0.2);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.quest-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.xp-input {
  width: 50px;
  text-align: center;
  font-weight: 600;
  padding: 6px;
}

.tag-button {
  background: rgba(40, 40, 50, 0.7);
  color: var(--text-secondary);
  border: 1px solid rgba(78, 205, 196, 0.2);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: capitalize;
  font-family: inherit;
}

.tag-button.tag-sm {
  padding: 3px 8px;
  font-size: 0.72rem;
}

.tag-button:hover {
  background: rgba(78, 205, 196, 0.08);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.tag-button.selected {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(74, 144, 226, 0.25);
}

.action-buttons {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.action-buttons button {
  padding: 6px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s ease;
  font-family: inherit;
}

.save-quest {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

.save-quest:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
}

.cancel-quest {
  background: rgba(255, 73, 97, 0.15);
  color: var(--accent-quaternary);
  border: 1px solid rgba(255, 73, 97, 0.25) !important;
}

.cancel-quest:hover {
  background: rgba(255, 73, 97, 0.25);
}

.pin-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
}

.pin-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-primary);
}

.suggested-quests {
  background: rgba(40, 40, 50, 0.5);
  border: 1px solid rgba(78, 205, 196, 0.2);
  border-radius: var(--border-radius-md);
  padding: 1rem;
}

.suggested-quests h4 {
  margin: 0 0 0.8rem 0;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
}

.suggestions-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.suggested-quest-item {
  background: rgba(78, 205, 196, 0.1);
  border: 1px solid rgba(78, 205, 196, 0.3);
  border-radius: var(--border-radius-md);
  padding: 0.6rem 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.suggested-quest-item:hover {
  background: rgba(78, 205, 196, 0.2);
  border-color: var(--accent-primary);
  transform: translateX(5px);
}

.action-buttons {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.4rem;
  justify-content: flex-end;
  align-items: center;
}

.action-buttons button {
  flex: 0 1 auto;
  padding: 0.2rem 0.5rem;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.6rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0px;
  min-width: 45px;
  line-height: 1.1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.action-buttons button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.action-buttons button:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.save-quest {
  background: linear-gradient(135deg, #4caf50, #45a049);
  color: white;
  font-size: 0.6rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.save-quest:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.cancel-quest {
  background: linear-gradient(135deg, #f44336, #d32f2f);
  color: white;
  font-size: 0.6rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid rgba(244, 67, 54, 0.3);
}

.cancel-quest:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
}

/* Enhanced Quest Layout */
.quest {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 1.2rem;
  background: rgba(40, 40, 50, 0.6);
  border: 1px solid rgba(74, 144, 226, 0.2);
  border-radius: var(--border-radius-md);
  margin-bottom: 1rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.quest-content {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.quest-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.quest-title {
  flex: 1;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

/* Responsive Quest Edit Panel */
@media (max-width: 768px) {
  .quest-edit-panel {
    padding: 1rem;
  }

  .difficulty-tags,
  .stat-tags {
    justify-content: center;
  }

  .action-buttons {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .quest-edit-panel {
    padding: 0.8rem;
  }

  .difficulty-tag,
  .stat-tag {
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
  }

  .quest-input {
    padding: 0.6rem;
    font-size: 0.9rem;
  }
}

.stats-visualization {
  display: block;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(20, 20, 30, 0.95);
  padding: 1.5rem;
  border-radius: 15px;
  z-index: 1002;
  border: 1px solid rgba(100, 100, 255, 0.3);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.stats-chart {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid rgba(74, 144, 226, 0.5);
  border-radius: 10px;
  background-color: rgba(30, 30, 40, 0.8);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
  max-width: 100%;
  max-height: 100%;
}

.stats-axis {
  position: absolute;
  width: 1px;
  height: 100%;
  background: rgba(74, 144, 226, 0.3);
  top: 0%;
  left: 50%;
  transform-origin: center;
  z-index: 1;
}

.stats-value {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--accent-primary);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px var(--accent-primary);
  z-index: 2;
}

.stats-label {
  position: absolute;
  color: var(--accent-primary);
  font-size: 0.9rem;
  white-space: nowrap;
  text-shadow: 0 0 5px rgba(74, 144, 226, 0.5);
  font-weight: bold;
}

.stats-connection {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(78, 205, 196, 0.3);
  clip-path: polygon(
      /* Define points based on your chart data */
    );
  z-index: 0;
  pointer-events: none;
}

/* Optional: Add grid lines for better visualization */
.stats-chart::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  pointer-events: none;
  z-index: 0;
}

.close-visualization {
  position: absolute;
  top: 10px;
  right: 10px;
  color: var(--accent-primary);
  cursor: pointer;
  font-size: 1.5rem;
}

.spider-chart-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.25);
  /* lighter backdrop so modal isn't overly hazy */
  display: none;
  /* hidden by default; shown via JS */
  justify-content: center;
  align-items: center;
  z-index: 2000;
  /* ensure modal appears above the common overlay */
}

/* modal overlay used by various modals, keep below specific modals but above main UI */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1500;
}

.modal-overlay.show {
  display: block;
}

.modal-content {
  background-color: rgba(30, 30, 40, 0.95);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 2001;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  cursor: pointer;
  font-size: 24px;
  color: var(--accent-primary);
}

/* Streak System Styles */
.streak-container {
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.1), rgba(255, 193, 7, 0.1));
  border: 1px solid rgba(255, 152, 0, 0.3);
  border-radius: var(--border-radius-md);
  padding: 1.5rem;
  margin-bottom: 2rem;
  text-align: center;
  box-shadow: 0 4px 15px rgba(255, 152, 0, 0.1);
  margin-top: 0;
}

.streak-count {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.streak-count i {
  color: #ff9800;
  margin-right: 0.5rem;
}

#streak-title {
  margin-left: 10px;
}

.streak-bar {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.streak-day {
  width: 35px;
  height: 35px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 152, 0, 0.3);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  position: relative;
  line-height: 1.1;
}

.streak-day.active {
  background: linear-gradient(135deg, #ff9800, #ffc107);
  color: white;
  border-color: #ff9800;
  box-shadow: 0 0 10px rgba(255, 152, 0, 0.5);
}

.day-date {
  display: none; /* hidden by default */
  font-size: 0.7rem;
  font-weight: 400;
  opacity: 0.7;
  line-height: 1;
}

.day-date.today {
  font-weight: 700;
  opacity: 1;
}

.container.detailed-view .streak-day {
  width: 42px;
  height: 42px;
}

/* Expanded streak bar layout for detailed view */
.container.detailed-view .streak-bar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.6rem;
  justify-items: center;
  padding: 0.8rem;
  background: rgba(74, 144, 226, 0.04);
  border: 1px solid rgba(74, 144, 226, 0.1);
  border-radius: 12px;
}

.container.detailed-view .streak-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 140px;
  height: auto;
  min-height: 100px;
  padding: 0.6rem 0.4rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 152, 0, 0.15);
  transition: all 0.3s ease;
  position: relative;
}

.container.detailed-view .streak-day:hover {
  border-color: rgba(255, 152, 0, 0.4);
  background: rgba(255, 255, 255, 0.06);
}

.container.detailed-view .streak-day.active {
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.12), rgba(255, 193, 7, 0.08));
  border-color: rgba(255, 152, 0, 0.5);
  box-shadow: 0 0 12px rgba(255, 152, 0, 0.2);
}

.container.detailed-view .streak-day.has-quests {
  border-color: rgba(78, 205, 196, 0.4);
  background: rgba(78, 205, 196, 0.06);
  box-shadow: 0 0 10px rgba(78, 205, 196, 0.15);
}

.container.detailed-view .streak-day.has-quests.active {
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.12), rgba(78, 205, 196, 0.08));
  border-color: rgba(78, 205, 196, 0.5);
}

/* Day letter circle inside the expanded card */
.container.detailed-view .streak-day-letter {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 152, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.container.detailed-view .streak-day.active .streak-day-letter {
  background: linear-gradient(135deg, #ff9800, #ffc107);
  color: white;
}

.container.detailed-view .streak-day.has-quests .streak-day-letter {
  background: rgba(78, 205, 196, 0.2);
  color: var(--accent-secondary);
}

/* Per-day detail info inside expanded card */
.streak-day-info {
  display: none;
}

.container.detailed-view .streak-day-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  width: 100%;
  text-align: center;
}

.streak-day-date {
  font-size: 0.65rem;
  color: var(--text-secondary);
  opacity: 0.7;
}

.streak-day-quests {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-primary);
}

.streak-day-quests.zero {
  color: var(--text-secondary);
  opacity: 0.4;
}

.streak-day-xp {
  font-size: 0.6rem;
  color: var(--accent-tertiary);
  font-weight: 500;
}

.streak-day-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: center;
}

.streak-day-cat-label {
  font-size: 0.5rem;
  padding: 1px 4px;
  border-radius: 4px;
  text-transform: capitalize;
  background: rgba(74, 144, 226, 0.1);
  color: var(--accent-primary);
}

/* Override count badge position for expanded layout */
.container.detailed-view .streak-day-count {
  position: static;
  display: inline-flex;
  min-width: 14px;
  height: 14px;
  font-size: 0.5rem;
  margin-top: 0.15rem;
}

/* Override dots position for expanded layout */
.container.detailed-view .streak-day-dots {
  position: static;
  transform: none;
  margin-top: 0.15rem;
}

/* Hide the old day-date span in expanded view (replaced by streak-day-date) */
.container.detailed-view .day-date {
  display: none;
}

/* Responsive: stack on small screens */
@media (max-width: 768px) {
  .container.detailed-view .streak-bar {
    grid-template-columns: repeat(7, 1fr);
    gap: 0.3rem;
    padding: 0.5rem;
  }
  .container.detailed-view .streak-day {
    min-height: 80px;
    padding: 0.4rem 0.2rem;
  }
  .streak-day-cat-label { font-size: 0.4rem; padding: 0 3px; }
  .streak-day-xp { font-size: 0.5rem; }
  .streak-day-quests { font-size: 0.6rem; }
}

@media (max-width: 480px) {
  .container.detailed-view .streak-bar {
    grid-template-columns: repeat(4, 1fr);
  }
  .container.detailed-view .streak-day {
    min-height: 90px;
  }
}

.container.detailed-view .day-date {
  display: block; /* show in detailed view */
}

/* Streak day detail elements (detailed view only) */
.streak-day-count,
.streak-day-dots {
  display: none;
}

.container.detailed-view .streak-day-count {
  display: flex;
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  background: var(--accent-primary);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 700;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
  z-index: 2;
}

.container.detailed-view .streak-day.has-quests {
  border-color: var(--accent-secondary);
  box-shadow: 0 0 8px rgba(78, 205, 196, 0.3);
}

.container.detailed-view .streak-day-dots {
  display: flex;
  gap: 2px;
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.streak-day-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-primary);
}

.streak-day-dot.cat-spiritual { background: #bb86fc; }
.streak-day-dot.cat-fitness { background: #69f0ae; }
.streak-day-dot.cat-learning { background: #64b5f6; }
.streak-day-dot.cat-work { background: #ffb74d; }
.streak-day-dot.cat-health { background: #ef9a9a; }
.streak-day-dot.cat-personal { background: #80deea; }
.streak-day-dot.cat-social { background: #fff176; }
.streak-day-dot.cat-finance { background: #a5d6a7; }
.streak-day-dot.cat-creative { background: #ce93d8; }

.streak-day-dot-more {
  font-size: 0.45rem;
  color: var(--text-secondary);
  line-height: 1;
}

/* Streak details row — hidden by default, shown only in detailed view */
.streak-details {
  display: none;
  margin-top: 1rem;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 0.6rem 1rem;
}

.container.detailed-view .streak-details {
  display: flex;
}

.streak-detail-item {
  font-size: 0.8rem;
  color: var(--text-secondary, #aaa);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.streak-detail-item i {
  color: var(--accent-primary, #4a90e2);
  font-size: 0.75rem;
}

.streak-detail-item strong {
  color: var(--text-primary, #eee);
  font-weight: 700;
}

/* Quest Controls Styles */
.quest-controls {
  background: rgba(30, 32, 45, 0.5);
  border: 1px solid rgba(74, 144, 226, 0.15);
  border-radius: var(--border-radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  position: relative;
}

.quest-controls::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: var(--border-radius-md) var(--border-radius-md) 0 0;
}

.quest-controls-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.quest-controls-header h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
}

.quest-controls-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quest-stats {
  background: rgba(74, 144, 226, 0.1);
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(74, 144, 226, 0.2);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.quest-count {
  color: var(--accent-primary);
  font-weight: 600;
}

.add-quest-btn-header {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border: none;
  color: white;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 12px rgba(74, 144, 226, 0.4);
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}

.add-quest-btn-header:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(74, 144, 226, 0.5);
}

.add-quest-btn-header::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  opacity: 0.3;
  z-index: -1;
  animation: addBtnPulse 2s ease-in-out infinite;
}

@keyframes addBtnPulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.05); }
}

.quest-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.search-wrapper {
  position: relative;
  flex: 1 1 160px;
  min-width: 120px;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  z-index: 1;
  font-size: 0.8rem;
}

.search-wrapper .quest-input {
  padding: 6px 10px 6px 30px;
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(74, 144, 226, 0.2);
  background: rgba(40, 40, 50, 0.6);
  color: var(--text-primary);
  font-size: 0.85rem;
  transition: all 0.2s ease;
  height: 34px;
  box-sizing: border-box;
}

.search-wrapper .quest-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.search-wrapper .quest-input::placeholder {
  color: #666;
  font-size: 0.8rem;
}

.clear-search-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #666;
  padding: 4px 6px;
  cursor: pointer;
  font-size: 0.8rem;
  display: none;
}

.clear-search-btn:hover {
  color: var(--text-primary);
}

.filter-group select.quest-input {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(74, 144, 226, 0.2);
  background: rgba(40, 40, 50, 0.6);
  color: var(--text-primary);
  font-size: 0.8rem;
  cursor: pointer;
  height: 34px;
  min-width: 90px;
  transition: all 0.2s ease;
  appearance: auto;
}

.filter-group select.quest-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

/* Quest status filter (All / Uncompleted / Completed) */
.quest-status-filters {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  background: rgba(40, 40, 50, 0.6);
  border: 1px solid rgba(74, 144, 226, 0.2);
  border-radius: 8px;
}

.quest-status-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.quest-status-btn:hover {
  background: rgba(74, 144, 226, 0.12);
  color: #e0e0e0;
}

.quest-status-btn.active {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
  box-shadow: 0 2px 8px rgba(74, 144, 226, 0.35);
}

.filter-actions {
  position: relative;
}

.sort-btn {
  background: rgba(40, 40, 50, 0.6);
  border: 1px solid rgba(74, 144, 226, 0.2);
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.sort-btn:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
  background: rgba(74, 144, 226, 0.1);
}

.sort-options {
  display: none;
  background: rgba(25, 27, 40, 0.97);
  border: 1px solid rgba(74, 144, 226, 0.3);
  border-radius: 8px;
  padding: 6px;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 100;
  min-width: 140px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.sort-options.show {
  display: block;
}

.sort-option {
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: background 0.15s ease;
}

.sort-option:hover {
  background: rgba(74, 144, 226, 0.12);
  color: var(--text-primary);
}

.sort-option i {
  margin-right: 6px;
  color: var(--accent-primary);
  width: 14px;
  text-align: center;
}

.sort-option.active {
  color: var(--accent-primary);
  background: rgba(74, 144, 226, 0.08);
}

.quest-status.quest-selector {
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.quest-status.quest-selector:hover {
  transform: scale(1.3);
}

.quest-status.quest-selector.selected {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.8), 0 0 14px var(--accent-primary);
  transform: scale(1.2);
}

.quest.selected {
  border-color: var(--accent-primary);
  box-shadow: 0 0 12px rgba(74, 144, 226, 0.25);
}

.batch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  margin-top: 8px;
  background: rgba(74, 144, 226, 0.1);
  border: 1px solid rgba(74, 144, 226, 0.3);
  border-radius: var(--border-radius-md);
  animation: fadeIn 0.2s ease;
}

.batch-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.batch-actions {
  display: flex;
  gap: 6px;
}

.batch-btn {
  padding: 5px 10px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.batch-btn:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
}

.batch-complete:hover {
  border-color: #4caf50;
  color: #4caf50;
  background: rgba(76,175,80,0.1);
}

.batch-delete:hover {
  border-color: #f44336;
  color: #f44336;
  background: rgba(244,67,54,0.1);
}

/* Enhanced Achievements */
.achievements-container {
  background: rgba(40, 40, 50, 0.4);
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  position: relative;
}

.achievements-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #ffc107, #ff9800);
  border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.achievements-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 193, 7, 0.2);
}

.achievements-header h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.4rem;
  font-weight: 600;
  position: relative;
}

.achievements-header h3::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 0;
  width: 40px;
  height: 2px;
  background: #ffc107;
  border-radius: 1px;
}

.achievement-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.achievement-count {
  color: var(--accent-primary);
  font-weight: 600;
  font-size: 1.1rem;
}

.achievement-total {
  color: #888;
}

.achievement-progress-bar {
  width: 100px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.achievement-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 3px;
  width: 0%;
  transition: width 0.8s ease;
}

.achievement-categories {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.achievement-category {
  background: rgba(40, 40, 50, 0.7);
  border: 1px solid rgba(74, 144, 226, 0.3);
  color: #b0b0b0;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.achievement-category:hover {
  background: rgba(74, 144, 226, 0.1);
  color: #e0e0e0;
}

.achievement-category.active {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  border-color: transparent;
}

.achievement-category i {
  margin-right: 6px;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 12px;
}

.achievement-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(30, 30, 40, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 14px 16px;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(12px);
  animation: achievementFadeIn 0.4s ease forwards;
  position: relative;
  overflow: hidden;
}

.achievement-card:nth-child(1) {
  animation-delay: 0.02s;
}

.achievement-card:nth-child(2) {
  animation-delay: 0.06s;
}

.achievement-card:nth-child(3) {
  animation-delay: 0.10s;
}

.achievement-card:nth-child(4) {
  animation-delay: 0.14s;
}

.achievement-card:nth-child(5) {
  animation-delay: 0.18s;
}

.achievement-card:nth-child(6) {
  animation-delay: 0.22s;
}

.achievement-card:nth-child(7) {
  animation-delay: 0.26s;
}

.achievement-card:nth-child(8) {
  animation-delay: 0.30s;
}

.achievement-card:nth-child(9) {
  animation-delay: 0.34s;
}

.achievement-card:nth-child(10) {
  animation-delay: 0.38s;
}

.achievement-card:nth-child(11) {
  animation-delay: 0.42s;
}

.achievement-card:nth-child(12) {
  animation-delay: 0.46s;
}

.achievement-card:nth-child(13) {
  animation-delay: 0.50s;
}

.achievement-card:nth-child(14) {
  animation-delay: 0.54s;
}

.achievement-card:nth-child(15) {
  animation-delay: 0.58s;
}

.achievement-card:nth-child(16) {
  animation-delay: 0.62s;
}

.achievement-card:nth-child(17) {
  animation-delay: 0.66s;
}

.achievement-card:nth-child(18) {
  animation-delay: 0.70s;
}

.achievement-card:nth-child(19) {
  animation-delay: 0.74s;
}

.achievement-card:nth-child(20) {
  animation-delay: 0.78s;
}

.achievement-card:nth-child(21) {
  animation-delay: 0.82s;
}

.achievement-card:nth-child(22) {
  animation-delay: 0.86s;
}

.achievement-card:nth-child(23) {
  animation-delay: 0.90s;
}

.achievement-card:nth-child(24) {
  animation-delay: 0.94s;
}

.achievement-card:nth-child(25) {
  animation-delay: 0.98s;
}

.achievement-card:nth-child(26) {
  animation-delay: 1.02s;
}

.achievement-card:nth-child(27) {
  animation-delay: 1.06s;
}

.achievement-card:nth-child(28) {
  animation-delay: 1.10s;
}

.achievement-card:nth-child(29) {
  animation-delay: 1.14s;
}

.achievement-card:nth-child(30) {
  animation-delay: 1.18s;
}

.achievement-card:nth-child(31) {
  animation-delay: 1.22s;
}

.achievement-card:nth-child(32) {
  animation-delay: 1.26s;
}

.achievement-card:nth-child(33) {
  animation-delay: 1.30s;
}

.achievement-card:nth-child(34) {
  animation-delay: 1.34s;
}

.achievement-card:nth-child(35) {
  animation-delay: 1.38s;
}

.achievement-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 193, 7, 0.3);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.achievement-card.locked {
  opacity: 0.6;
  filter: grayscale(0.4);
}

.achievement-card.unlocked {
  border-color: rgba(255, 193, 7, 0.5);
  background: rgba(40, 35, 20, 0.6);
}

.achievement-card.unlocked::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #ffc107, #ff9800);
}

.achievement-card.unlocked:hover {
  border-color: rgba(255, 193, 7, 0.7);
  box-shadow: 0 6px 20px rgba(255, 193, 7, 0.12);
}

@keyframes achievementFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes achievementUnlockFlash {
  0% {
    box-shadow: 0 0 0 rgba(255, 193, 7, 0);
  }

  30% {
    box-shadow: 0 0 25px rgba(255, 193, 7, 0.5), 0 0 50px rgba(255, 193, 7, 0.2);
  }

  100% {
    box-shadow: 0 0 0 rgba(255, 193, 7, 0);
  }
}

.achievement-card.unlock-flash {
  animation: achievementFadeIn 0.4s ease forwards, achievementUnlockFlash 1s ease 0.3s;
}

.achievement-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 193, 7, 0.1);
  border-radius: 10px;
  font-size: 1.2rem;
  color: #ffc107;
}

.achievement-card.unlocked .achievement-icon {
  background: rgba(255, 193, 7, 0.2);
  color: #ffd54f;
}

.achievement-info {
  flex: 1;
  min-width: 0;
}

.achievement-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.achievement-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

.achievement-progress-text {
  font-size: 0.75rem;
  color: #888;
  margin-top: 4px;
}

.achievement-condition {
  font-size: 0.72rem;
  color: #666;
  font-style: italic;
  margin-top: 2px;
}

.achievement-new-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: linear-gradient(135deg, #ffc107, #ff9800);
  color: #1a1a2e;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 8px;
  letter-spacing: 0.5px;
  animation: badgePulse 1.5s ease infinite;
}

@keyframes badgePulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }
}

.achievement-status-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.achievement-status-btn {
  background: rgba(40, 40, 50, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #b0b0b0;
  padding: 8px 14px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.85rem;
  min-height: 36px;
}

.achievement-status-btn:hover {
  background: rgba(74, 144, 226, 0.1);
  color: #e0e0e0;
}

.achievement-status-btn.active {
  background: linear-gradient(135deg, #ffc107, #ff9800);
  color: #1a1a2e;
  border-color: transparent;
  font-weight: 600;
}

/* Enhanced Pomodoro Structure */
.pomodoro-container {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(139, 195, 74, 0.1));
  border: 1px solid rgba(76, 175, 80, 0.3);
  border-radius: var(--border-radius-md);
  padding: 1.5rem;
  margin-bottom: 2rem;
  text-align: center;
}

.pomodoro-container h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-size: 1.3rem;
  font-weight: 600;
}

/* Enhanced Favorites Structure */
.favorites-container {
  background: rgba(40, 40, 50, 0.4);
  border: 1px solid rgba(233, 30, 99, 0.25);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  position: relative;
}

.favorites-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #e91e63, #f06292);
  border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.favorites-container h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.4rem;
  font-weight: 600;
  position: relative;
}

.favorites-container h3::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 0;
  width: 36px;
  height: 2px;
  background: #e91e63;
  border-radius: 1px;
}

/* Quote animation */
@keyframes quoteAppear {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.quote-text,
.quote-author {
  animation: quoteAppear 0.5s ease-out forwards;
}

.quote-author {
  animation-delay: 0.2s;
}

/* Visual pop for inline quotes */
.quote-container.quote-pop {
  transform: scale(1.03);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(74, 144, 226, 0.4);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  z-index: 1900;
  /* kept below modal so modals take priority */
}

/* Views: detailed and compact adjustments */
/* Views: detailed and compact adjustments */
.container.detailed-view .stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.container.detailed-view .quests-grid {
  /* Assuming quests will also be in a grid */
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
}

.container.detailed-view .achievements-container,
.container.detailed-view .favorites-container,
.container.detailed-view .quest-controls,
.container.detailed-view .pomodoro-container {
  display: block !important;
  /* Ensure these are visible in detailed view */
}

.container.detailed-view .stat-card {
  padding: 25px;
}

.container.detailed-view .quest {
  padding: 1.5rem;
}

.container.detailed-view #quests {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.container.detailed-view .stat-value {
  font-size: 1.1rem;
}

/* Streak detail panel (detailed view only) — hidden by default */
.streak-detail-panel {
  display: none;
}

.container.detailed-view .streak-detail-panel {
  display: block;
  margin-top: 1rem;
}

.streak-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
}

.streak-detail-card {
  background: rgba(74, 144, 226, 0.04);
  border: 1px solid rgba(74, 144, 226, 0.1);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  transition: border-color 0.2s ease;
}

.streak-detail-card:hover {
  border-color: rgba(74, 144, 226, 0.25);
}

.streak-detail-card-wide {
  grid-column: 1 / -1;
}

.streak-detail-card-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.streak-detail-card-header i {
  font-size: 0.7rem;
  opacity: 0.7;
}

.streak-detail-badge {
  margin-left: auto;
  background: rgba(74, 144, 226, 0.15);
  color: var(--accent-primary);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.65rem;
  text-transform: none;
  letter-spacing: 0;
}

.streak-detail-card-body {
  font-size: 0.82rem;
  color: var(--text-primary);
}

/* Rank card */
.streak-detail-rank {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.streak-rank-current {
  font-weight: 700;
  color: var(--accent-secondary);
}

.streak-rank-arrow {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.streak-rank-next {
  color: var(--accent-primary);
  font-weight: 500;
}

.streak-rank-max {
  color: var(--accent-tertiary);
  font-weight: 700;
  font-size: 0.85rem;
}

/* Progress bar (shared) */
.streak-detail-progress-bar {
  height: 5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.3rem;
}

.streak-detail-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.streak-detail-progress-text {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* Milestone card */
.streak-detail-milestone {
  margin-bottom: 0.5rem;
}

.streak-milestone-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-tertiary);
}

.streak-detail-milestone-done {
  color: var(--accent-tertiary);
  font-size: 0.82rem;
  text-align: center;
  padding: 0.3rem 0;
}

/* Freeze card */
.streak-detail-freeze {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
}

.streak-freeze-count {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-secondary);
}

.streak-freeze-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.streak-detail-freeze-refresh {
  font-size: 0.7rem;
  color: var(--text-secondary);
  opacity: 0.7;
}

/* Today card */
.streak-detail-today {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
}

.streak-today-count {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-primary);
}

.streak-today-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.streak-today-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.streak-today-cat {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(74, 144, 226, 0.1);
  color: var(--accent-primary);
  text-transform: capitalize;
}

.streak-today-cat.cat-spiritual { background: rgba(156, 39, 176, 0.12); color: #bb86fc; }
.streak-today-cat.cat-fitness { background: rgba(76, 175, 80, 0.12); color: #69f0ae; }
.streak-today-cat.cat-learning { background: rgba(33, 150, 243, 0.12); color: #64b5f6; }
.streak-today-cat.cat-work { background: rgba(255, 152, 0, 0.12); color: #ffb74d; }
.streak-today-cat.cat-health { background: rgba(244, 67, 54, 0.12); color: #ef9a9a; }
.streak-today-cat.cat-personal { background: rgba(0, 188, 212, 0.12); color: #80deea; }
.streak-today-cat.cat-social { background: rgba(255, 235, 59, 0.12); color: #fff176; }
.streak-today-cat.cat-finance { background: rgba(46, 204, 113, 0.12); color: #a5d6a7; }
.streak-today-cat.cat-creative { background: rgba(155, 89, 182, 0.12); color: #ce93d8; }

.streak-detail-today-empty {
  font-size: 0.75rem;
  color: var(--text-secondary);
  opacity: 0.6;
  font-style: italic;
}

/* Responsive */
@media (max-width: 480px) {
  .streak-detail-grid { grid-template-columns: 1fr; }
  .streak-detail-card { padding: 0.6rem 0.8rem; }
}

/* Quest detail section (detailed view only) — hidden by default */
.quest-detail-section {
  display: none;
}

.container.detailed-view .quest-detail-section {
  display: block;
}

/* Quest detail section styles */
.quest-detail-section {
  margin-top: 0.8rem;
  padding: 0.8rem 1rem;
  background: rgba(74, 144, 226, 0.05);
  border: 1px solid rgba(74, 144, 226, 0.12);
  border-radius: 8px;
}

.quest-detail-row {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.quest-detail-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
}

.quest-detail-item i {
  font-size: 0.75rem;
  opacity: 0.7;
}

.quest-detail-label {
  color: var(--text-secondary);
}

.quest-detail-value {
  color: var(--text-primary);
  font-weight: 600;
}

.quest-detail-progress {
  margin-bottom: 0.6rem;
}

.quest-detail-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.quest-detail-progress-header i {
  margin-right: 0.3rem;
}

.quest-detail-progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.quest-detail-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.quest-detail-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.quest-detail-meta-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.quest-detail-meta-item i {
  font-size: 0.7rem;
  opacity: 0.6;
}

/* Responsive detail section */
@media (max-width: 480px) {
  .quest-detail-section { padding: 0.6rem 0.8rem; }
  .quest-detail-row { gap: 0.8rem; }
  .quest-detail-item { font-size: 0.78rem; }
  .quest-detail-meta { gap: 0.6rem; }
}


.container.compact-view .stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem;
}

.container.compact-view .quests-grid {
  /* Assuming quests will also be in a grid */
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  padding: 1rem;
}

.container.compact-view .achievements-container,
.container.compact-view .favorites-container,
.container.compact-view .quest-controls,
/* Hide quest controls */
.container.compact-view .pomodoro-container,
/* Hide pomodoro timer */
.container.compact-view .streak-container .streak-bar {
  /* Hide individual streak days, keep count */
  display: none;
}

.container.compact-view .stat-card {
  padding: 15px;
}

.container.compact-view .quest {
  padding: 1rem;
}

.container.compact-view .stat-value {
  font-size: 0.9rem;
}

/* General adjustments for compact view elements */
.container.compact-view .app-header {
  padding: 1rem 0;
  margin-bottom: 1rem;
}

.container.compact-view .user-profile {
  flex-direction: column;
  gap: 0.5rem;
}

.container.compact-view .avatar {
  width: 50px;
  height: 50px;
  font-size: 1.5rem;
}

.container.compact-view .level-up {
  padding: 1rem;
  margin-bottom: 1rem;
}

.container.compact-view .quest-controls-header {
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
}

.container.compact-view .quest-controls-header h3 {
  font-size: 1.2rem;
}

.container.compact-view .quests {
  margin-top: 1rem;
}

.container.compact-view .quest-title {
  font-size: 1rem;
}

.container.compact-view .quest-tags {
  font-size: 0.7rem;
}

.container.compact-view .streak-container {
  padding: 1rem;
  margin-bottom: 1rem;
}

.container.compact-view .streak-count {
  font-size: 1rem;
}

.container.compact-view .spider-chart-modal {
  padding: 1rem;
}

.container.compact-view .chart-controls {
  flex-direction: column;
  gap: 0.5rem;
}

/* Enhanced Spider Chart Styles */

.spider-chart-content {
  max-width: 800px;
  width: 90%;
  padding: 30px;
  max-height: 90vh;
  /* Allow content to scroll */
  overflow-y: auto;
  /* Enable vertical scrolling */
}

.spider-chart-content.modal-enter {
  animation: spiderModalEnter 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes spiderModalEnter {
  from {
    opacity: 0;
    transform: scale(0.85) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.stat-summary {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin: 8px 0 16px;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.stat-summary strong {
  color: var(--text-primary);
  font-size: 1.1rem;
}

.chart-controls {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.chart-toggle {
  display: flex;
  border-radius: 8px;
  overflow: hidden;
  background-color: rgba(40, 40, 50, 0.7);
  border: 1px solid rgba(74, 144, 226, 0.3);
}

.chart-tab {
  background-color: transparent;
  border: none;
  padding: 10px 15px;
  color: #e0e0e0;
  cursor: pointer;
  transition: all 0.3s;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

.chart-tab:hover {
  background-color: rgba(74, 144, 226, 0.2);
}

.chart-tab.active {
  background-color: rgba(74, 144, 226, 0.5);
  color: white;
}

.time-range {
  display: flex;
  border-radius: 8px;
  overflow: hidden;
  background-color: rgba(40, 40, 50, 0.7);
  border: 1px solid rgba(74, 144, 226, 0.3);
}

.time-button {
  background-color: transparent;
  border: none;
  padding: 10px 15px;
  color: #e0e0e0;
  cursor: pointer;
  transition: all 0.3s;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

.time-button:hover {
  background-color: rgba(74, 144, 226, 0.2);
}

.time-button.active {
  background-color: rgba(74, 144, 226, 0.5);
  color: white;
}

.stats-chart-container {
  position: relative;
  width: 100%;
  height: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}

.stats-chart {
  position: relative;
  width: 300px;
  height: 300px;
  border: 1px solid rgba(74, 144, 226, 0.3);
  border-radius: 50%;
  background-color: rgba(30, 30, 40, 0.5);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
}

/* Add circular guidelines for the spider chart */
.stats-chart::before {
  content: '';
  position: absolute;
  top: 25%;
  left: 25%;
  width: 50%;
  height: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.stats-chart::after {
  content: '';
  position: absolute;
  top: 12.5%;
  left: 12.5%;
  width: 75%;
  height: 75%;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

/* View-specific styles for .stats and .quests containers */
.stats.view-detailed .stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  /* More room for detailed cards */
  gap: 2rem;
}

.quests.view-detailed {
  display: grid;
  grid-template-columns: 1fr;
  /* Stack quests in detailed view */
  gap: 1.5rem;
  background-color: rgba(40, 50, 60, 0.2);
  /* Subtle background for detailed view */
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
}

.stats.view-compact .stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  /* Less room for compact cards */
  gap: 0.8rem;
}

.quests.view-compact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  /* Two columns for compact quests */
  gap: 1rem;
  background-color: rgba(50, 40, 30, 0.2);
  /* Subtle background for compact view */
  border-radius: var(--border-radius-lg);
  padding: 1rem;
}

/* Also ensure stat-card and quest padding is updated for detailed and compact */
.stats.view-detailed .stat-card {
  padding: 25px;
  /* Already exists, just for clarity */
  outline: 2px solid var(--accent-primary);
  /* Highlight for detailed */
  outline-offset: -2px;
}

.quests.view-detailed .quest {
  padding: 1.5rem;
  /* Already exists, just for clarity */
  border: 2px solid rgba(74, 144, 226, 0.4);
}

.stats.view-compact .stat-card {
  padding: 15px;
  /* Already exists, just for clarity */
  outline: 1px solid var(--accent-secondary);
  /* Highlight for compact */
  outline-offset: -1px;
}

.quests.view-compact .quest {
  padding: 1rem;
  /* Already exists, just for clarity */
  border: 1px solid rgba(78, 205, 196, 0.3);
}

.stats-axis {
  position: absolute;
  width: 1px;
  height: 100%;
  background: rgba(74, 144, 226, 0.3);
  top: 0;
  left: 50%;
  transform-origin: center;
  z-index: 1;
}

.stats-value {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--accent-primary);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px var(--accent-primary);
  z-index: 3;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stats-value::before {
  content: attr(data-value);
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(30, 30, 40, 0.8);
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 0.7rem;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 4;
}

.stats-value:hover::before {
  opacity: 1;
}

.stats-label {
  position: absolute;
  color: var(--accent-primary);
  font-size: 0.9rem;
  white-space: nowrap;
  text-shadow: 0 0 5px rgba(74, 144, 226, 0.5);
  font-weight: bold;
  z-index: 4;
  transition: all 0.3s;
}

.stats-label:hover {
  color: #ffffff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  cursor: pointer;
}

.stats-connection {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 2;
  pointer-events: none;
  transition: all 0.5s ease-in-out;
}

.stats-connection.current {
  background: none;
  border: 1px solid rgba(74, 144, 226, 0.5);
}

.stats-connection.previous {
  background: rgba(255, 123, 0, 0.2);
  border: 1px solid rgba(255, 123, 0, 0.5);
}

.chart-legend {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 20px;
  padding: 5px 10px;
  background-color: rgba(30, 30, 40, 0.7);
  border-radius: 5px;
  border: 1px solid rgba(74, 144, 226, 0.3);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.legend-color.current {
  background-color: rgba(78, 205, 196, 0.8);
  border: 1px solid rgba(78, 205, 196, 1);
}

.legend-color.previous {
  background-color: rgba(255, 123, 0, 0.8);
  border: 1px solid rgba(255, 123, 0, 1);
}

.legend-label {
  font-size: 0.8rem;
  color: #e0e0e0;
}

/* Stat Details Styles */
.stat-details-container {
  margin-top: 20px;
  background-color: rgba(40, 40, 50, 0.7);
  border-radius: 10px;
  padding: 15px;
  border: 1px solid rgba(74, 144, 226, 0.3);
}

.stat-details-container h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.2rem;
}

.stat-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.stat-detail {
  background-color: rgba(30, 30, 40, 0.7);
  border-radius: 8px;
  padding: 12px;
  border: 1px solid rgba(74, 144, 226, 0.2);
  transition: all 0.3s;
}

.stat-detail:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  border-color: rgba(74, 144, 226, 0.5);
}

.stat-name {
  font-weight: bold;
  color: var(--accent-primary);
  margin-bottom: 8px;
}

.stat-bar {
  width: 100%;
  height: 8px;
  background-color: rgba(30, 30, 40, 0.8);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.stat-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  width: 0%;
  transition: width 0.5s ease-out;
  border-radius: 4px;
}

.stat-progress.stat-highlight {
  animation: statHighlight 1.5s ease-out;
}

@keyframes statHighlight {

  0%,
  100% {
    box-shadow: none;
  }

  50% {
    box-shadow: 0 0 15px rgba(78, 205, 196, 0.8);
  }
}

.stat-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-value-display {
  font-size: 1.2rem;
  font-weight: bold;
  color: #e0e0e0;
}

.stat-change {
  font-size: 0.8rem;
  padding: 2px 6px;
  border-radius: 4px;
  color: #06d6a0;
  background-color: rgba(6, 214, 160, 0.1);
}

.stat-change.negative {
  color: #ef476f;
  background-color: rgba(239, 71, 111, 0.1);
}

/* History Chart Styles */
.history-chart-container {
  margin-top: 20px;
  background-color: rgba(40, 40, 50, 0.7);
  border-radius: 10px;
  padding: 15px;
  border: 1px solid rgba(74, 144, 226, 0.3);
  height: 300px;
}

.history-chart {
  width: 100%;
  height: 100%;
  position: relative;
}

@keyframes scaleIn {
  from {
    transform: scale(0);
  }

  to {
    transform: scale(1);
  }
}

@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 5px rgba(74, 144, 226, 0.5);
  }

  50% {
    box-shadow: 0 0 15px rgba(74, 144, 226, 0.8);
  }

  100% {
    box-shadow: 0 0 5px rgba(74, 144, 226, 0.5);
  }
}

/* Apply animations to spider chart elements */
.stats-value {
  animation: scaleIn 0.5s forwards;
}

.stats-connection {
  animation: fadeIn 0.8s forwards;
}

.stats-chart {
  animation: pulseGlow 3s infinite;
}

/* Ripple Effect */
button {
  position: relative;
  overflow: hidden;
}

.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Theme Transition Overlay */
.theme-transition-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.3);
  opacity: 0;
  z-index: 9999;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.theme-transition-overlay.active {
  opacity: 1;
}

/* Enhanced Notifications */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px;
  min-width: 300px;
  max-width: 350px;
  border-radius: 8px;
  overflow: hidden;
  z-index: 1000;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  transform: translateX(120%);
  transition: transform 0.3s ease;
  opacity: 0.95;
}

.notification.show {
  transform: translateX(0);
}

.notification.hide {
  transform: translateX(120%);
}

.notification-content {
  display: flex;
  align-items: center;
  padding: 15px;
}

.notification-icon {
  margin-right: 12px;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-message {
  flex-grow: 1;
  font-size: 0.95rem;
}

.notification-progress {
  height: 4px;
  background-color: rgba(255, 255, 255, 0.3);
  animation: progress 5s linear forwards;
}

@keyframes progress {
  from {
    width: 100%;
  }

  to {
    width: 0%;
  }
}

.notification.success {
  background-color: #4CAF50;
  border-left: 5px solid #2E7D32;
}

.notification.error {
  background-color: #f44336;
  border-left: 5px solid #c62828;
}

.notification.info {
  background-color: #2196F3;
  border-left: 5px solid #1565C0;
}

.notification.warning {
  background-color: #FF9800;
  border-left: 5px solid #EF6C00;
}

/* Quest Hover Animation */
.quest {
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.quest-hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  background-color: rgba(50, 50, 60, 0.8);
  border-color: var(--accent-primary);
}

/* Updated Card Styles */
.quest,
.stat,
.achievement,
.favorite-quote-item {
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  transition: transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

/* Three-dimensional buttons */
button {
  transform: translateY(0);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:active {
  transform: translateY(2px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* More responsive font sizes */
@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  /* Enhanced top section visibility for tablets */
  body {
    padding: 10px;
  }

  .container {
    padding: 1.5rem;
    margin-bottom: 1rem;
  }

  .app-header h1 {
    font-size: 2rem;
  }

  .level-up .level {
    font-size: 1.5rem;
  }

  .streak-day {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
  }

  .view-toggle {
    flex-direction: column;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  .container {
    padding: 1rem;
  }

  h1 {
    font-size: 1.8rem;
  }

  .notification {
    min-width: auto;
    max-width: 90%;
    left: 5%;
    right: 5%;
  }

  /* Enhanced top section visibility for mobile */
  body {
    padding: 5px;
  }

  .app-header h1 {
    font-size: 1.5rem;
  }

  .level-up .level {
    font-size: 1.3rem;
  }

  .view-toggle {
    flex-direction: column;
    gap: 0.5rem;
  }

  .view-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
  }

  .streak-day {
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
  }
}

/* Enhanced Stats Display */
.stats-title {
  text-align: center;
  margin-bottom: 20px;
  color: #e0e0e0;
  font-size: 1.5rem;
  font-weight: 600;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

/* ========== RESPONSIVE DESIGN ========== */

/* Base container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  transition: padding 0.3s ease;
}

/* Large screens (1200px+) - default styles already applied */

/* Medium screens (768px - 1199px) */
@media (max-width: 1200px) {
  .container {
    padding: 15px;
    max-width: 100%;
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
  }

  .stat-card {
    padding: 18px;
  }

  /* Adjust quest sections */
  .quest-section {
    padding: 15px;
  }

  /* Make buttons slightly smaller */
  .btn,
  button {
    padding: 8px 16px;
    font-size: 0.9rem;
  }
}

/* Tablets (480px - 767px) */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
  }

  .stat-card {
    padding: 15px;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .stat-icon {
    font-size: 1.2rem;
    margin-right: 8px;
  }

  /* Make quest cards more compact */
  .quest {
    padding: 12px;
    margin-bottom: 8px;
  }

  .quest-title {
    font-size: 0.9rem;
  }

  /* Adjust modals for tablet */
  .modal-content {
    width: 95%;
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
  }

  /* Header adjustments */
  .app-header {
    flex-direction: column;
    gap: 15px;
  }

  .user-profile {
    width: 100%;
    justify-content: center;
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
  }

  .stat-card {
    padding: 15px;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .stat-icon {
    font-size: 1.2rem;
    margin-right: 8px;
  }

  /* Make quest cards more compact */
  .quest {
    padding: 12px;
    margin-bottom: 8px;
  }

  .quest-title {
    font-size: 0.9rem;
  }
}

/* Mobile phones (under 480px) */
@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .stat-card {
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
  }

  .stat-header {
    margin-bottom: 0;
    flex: 1;
  }

  .stat-progress-container {
    margin-top: 0;
    flex: 2;
  }

  .stat-value {
    font-size: 1.3rem;
  }

  /* Full width container on mobile */
  .container {
    padding: 8px;
    margin: 0;
    max-width: 100%;
  }

  /* Adjust header for mobile */
  .user-profile {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .user-avatar {
    margin: 0 auto;
  }

  /* Stack quest info vertically */
  .quest-content {
    flex-direction: column;
    gap: 8px;
  }

  .quest-actions {
    width: 100%;
    justify-content: space-between;
  }

  /* Make modals fullscreen on mobile */
  .modal-content {
    width: 100%;
    height: 100%;
    max-width: 100%;
    border-radius: 0;
    margin: 0;
    padding: 15px;
  }

  /* Adjust buttons for touch */
  button,
  .btn {
    min-height: 44px;
    /* Apple's recommended touch target */
    padding: 10px 15px;
  }

  /* Improve readability */
  body {
    font-size: 14px;
  }

  h2,
  h3 {
    font-size: 1.2rem;
  }
}

/* Ultra-small screens (under 360px) */
@media (max-width: 360px) {
  .stats-grid {
    gap: 8px;
  }

  .stat-card {
    padding: 10px;
  }

  .stat-name {
    font-size: 0.8rem;
  }

  .stat-value {
    font-size: 1.1rem;
  }

  .stat-progress-text {
    font-size: 0.7rem;
  }

  /* Even more compact header */
  .user-profile h2 {
    font-size: 1.1rem;
  }

  .user-profile p {
    font-size: 0.8rem;
  }

  /* Smaller buttons */
  button,
  .btn {
    padding: 8px 12px;
    font-size: 0.8rem;
  }
}

/* ===== Additional Responsive Elements ===== */

/* XP Bar responsive */
@media (max-width: 768px) {
  .xp-bar-container {
    height: 10px;
  }

  .xp-info {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .xp-bar-container {
    height: 8px;
  }

  .xp-info {
    flex-direction: column;
    gap: 5px;
    text-align: center;
  }
}

/* Quest filters responsive */
@media (max-width: 768px) {
  .quest-filters {
    flex-wrap: wrap;
    gap: 8px;
  }

  .filter-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .quest-filters {
    justify-content: center;
  }

  .filter-btn {
    flex: 1;
    min-width: 80px;
    text-align: center;
  }
}

/* Chart/Stats modal responsive */
@media (max-width: 768px) {
  .spider-chart-container {
    width: 100%;
    overflow-x: auto;
  }

  .chart-tabs {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .chart-tabs {
    flex-direction: column;
    width: 100%;
  }

  .chart-tab {
    width: 100%;
    text-align: center;
  }
}

/* Toast notifications responsive */
@media (max-width: 480px) {
  .xp-toast {
    min-width: unset;
    width: 90%;
    font-size: 0.9rem;
  }
}

/* Pomodoro timer responsive */
@media (max-width: 768px) {
  .pomodoro-timer {
    font-size: 3rem;
  }
}

@media (max-width: 480px) {
  .pomodoro-timer {
    font-size: 2.5rem;
  }

  .pomodoro-controls {
    flex-direction: column;
    gap: 10px;
  }
}

/* Fix overflow issues on all screens */
body {
  overflow-x: hidden;
}

.container {
  max-width: 100vw;
  box-sizing: border-box;
}

/* Additional responsive fixes for very small screens */
@media (max-width: 320px) {
  .stat-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .stat-progress-container {
    width: 100%;
  }

  .user-profile h2 {
    font-size: 1rem;
  }

  .stat-value {
    font-size: 1.2rem;
  }

  .achievements-grid {
    grid-template-columns: 1fr;
  }

  .achievement-card {
    padding: 10px 12px;
  }

  .xp-toast {
    width: 95%;
    min-width: auto;
  }

  .quote-actions {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .streak-day {
    width: 26px;
    height: 26px;
    font-size: 0.75rem;
  }

  .quest-input {
    min-height: 44px;
  }

  .batch-btn {
    min-height: 44px;
  }
}

.stat-card {
  background: linear-gradient(135deg, rgba(74, 144, 226, 0.1), rgba(78, 205, 196, 0.1));
  border: 1px solid rgba(74, 144, 226, 0.3);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(74, 144, 226, 0.2);
  border-color: rgba(74, 144, 226, 0.5);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.stat-card:hover::before {
  transform: scaleX(1);
}

.stat-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.stat-icon {
  font-size: 1.5rem;
  color: var(--accent-primary);
  margin-right: 12px;
  width: 24px;
  text-align: center;
}

.stat-info {
  flex: 1;
}

.stat-name {
  font-size: 0.9rem;
  color: #b0b0b0;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #e0e0e0;
}

.stat-progress-container {
  margin-top: 15px;
}

.stat-progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.stat-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 4px;
  width: 0%;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.stat-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

/* Stat increase animation - applied to progress fill */
.stat-progress-fill.stat-increase {
  animation: statPulseBrightness 0.8s ease-out;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary), #69f0ae) !important;
}

@keyframes statPulseBrightness {
  0% {
    filter: brightness(1);
    transform: scaleY(1);
  }

  50% {
    filter: brightness(1.5);
    transform: scaleY(1.3);
  }

  100% {
    filter: brightness(1);
    transform: scaleY(1);
  }
}

/* Increase indicator badge - positioned to be visible */
.stat-progress-container {
  position: relative;
}

.stat-progress-fill.stat-increase::after {
  content: '+1';
  position: absolute;
  right: -30px;
  top: -20px;
  background: var(--accent-secondary);
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  z-index: 10;
  animation: fadeUp 1.2s ease-out forwards;
}

/* Make progress bar container have overflow visible for the +1 indicator */
.stat-progress-bar {
  overflow: visible !important;
}

@keyframes statPulseRing {
  0% {
    box-shadow: 0 0 0 0 rgba(74, 144, 226, 0.7);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(74, 144, 226, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(74, 144, 226, 0);
  }
}

/* Dynamic progress bar with increase indicator */
.stat-progress-fill {
  position: relative;
  overflow: visible;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-progress-fill.stat-increase::before {
  content: '+1';
  position: absolute;
  right: -25px;
  top: -20px;
  background: var(--accent-secondary);
  color: white;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  animation: fadeUp 1s ease-out forwards;
}

@keyframes fadeUp {
  0% {
    opacity: 1;
    transform: translateY(0);
  }

  100% {
    opacity: 0;
    transform: translateY(-15px);
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

.stat-progress-text {
  font-size: 0.8rem;
  color: #888;
  text-align: right;
}

/* View Toggle System */
.view-toggle-container {
  margin: 2rem 0;
  text-align: center;
  padding: 1rem;
  background: rgba(40, 40, 50, 0.3);
  border-radius: var(--border-radius-md);
  border: 1px solid rgba(74, 144, 226, 0.2);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-top: 0;
}

.view-toggle {
  display: inline-flex;
  background: rgba(40, 40, 50, 0.7);
  border: 1px solid rgba(74, 144, 226, 0.3);
  border-radius: 25px;
  padding: 4px;
}

.view-btn {
  background: transparent;
  border: none;
  color: #b0b0b0;
  padding: 10px 20px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  font-weight: 500;
}

.view-btn:hover {
  color: #e0e0e0;
  background: rgba(74, 144, 226, 0.1);
}

.view-btn.active {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.view-btn i {
  margin-right: 8px;
}

/* Enhanced Quest Controls */
.quest-controls-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(74, 144, 226, 0.2);
}

.quest-controls-header h3 {
  margin: 0;
  color: #e0e0e0;
  font-size: 1.3rem;
}

.quest-stats {
  background: rgba(74, 144, 226, 0.1);
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid rgba(74, 144, 226, 0.3);
}

.quest-count {
  color: var(--accent-primary);
  font-weight: 600;
}

.search-container {
  margin-bottom: 20px;
}

.search-wrapper {
  position: relative;
  max-width: 400px;
}

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
  z-index: 1;
}

.search-wrapper .quest-input {
  padding-left: 45px;
  width: 100%;
  border-radius: 25px;
  border: 1px solid rgba(74, 144, 226, 0.3);
  background: rgba(40, 40, 50, 0.7);
  color: #e0e0e0;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.search-wrapper .quest-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.search-btn {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border: none;
  color: white;
  padding: 8px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.search-btn:hover {
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.clear-search-btn {
  position: absolute;
  right: 50px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #888;
  padding: 8px 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: none;
}

.clear-search-btn:hover {
  color: #e0e0e0;
}

.filter-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.filter-group {
  display: flex;
  flex-direction: column;
}

.filter-group label {
  color: #b0b0b0;
  font-size: 0.9rem;
  margin-bottom: 5px;
  font-weight: 500;
}

.filter-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.sort-btn {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border: none;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  margin-bottom: 10px;
}

.sort-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.sort-options {
  display: none;
  background: rgba(40, 40, 50, 0.95);
  border: 1px solid rgba(74, 144, 226, 0.3);
  border-radius: 8px;
  padding: 10px;
  position: absolute;
  z-index: 100;
  min-width: 150px;
}

.sort-option {
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s ease;
  color: #e0e0e0;
}

.sort-option:hover {
  background: rgba(74, 144, 226, 0.1);
}

.sort-option i {
  margin-right: 8px;
  color: var(--accent-primary);
}

/* Enhanced Achievements */
.achievements-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(74, 144, 226, 0.2);
}

.achievements-header h3 {
  margin: 0;
  color: #e0e0e0;
  font-size: 1.3rem;
}

.achievement-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.achievement-count {
  color: var(--accent-primary);
  font-weight: 600;
  font-size: 1.1rem;
}

.achievement-total {
  color: #888;
}

.achievement-progress-bar {
  width: 100px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.achievement-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 3px;
  width: 0%;
  transition: width 0.8s ease;
}

.achievement-categories {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.achievement-category {
  background: rgba(40, 40, 50, 0.7);
  border: 1px solid rgba(74, 144, 226, 0.3);
  color: #b0b0b0;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.achievement-category:hover {
  background: rgba(74, 144, 226, 0.1);
  color: #e0e0e0;
}

.achievement-category.active {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  border-color: transparent;
}

.achievement-category i {
  margin-right: 6px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .filter-container {
    grid-template-columns: 1fr;
  }

  .view-toggle {
    flex-direction: column;
    border-radius: 12px;
  }

  .achievement-categories {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .stat-card {
    padding: 15px;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .quest-controls-header {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }
}

/* View-specific styles */
.stats.view-detailed .stat-card {
  padding: 25px;
  border-width: 2px;
}

.stats.view-detailed .stat-value {
  font-size: 2.5rem;
}

.stats.view-detailed .stat-progress-bar {
  height: 10px;
}

.stats.view-compact .stat-card {
  padding: 15px;
}

.stats.view-compact .stat-value {
  font-size: 1.5rem;
}

.stats.view-compact .stat-progress-bar {
  height: 6px;
}

.quests.view-detailed .quest {
  padding: 20px;
  margin-bottom: 15px;
  border-radius: 12px;
  background: rgba(40, 40, 50, 0.7);
  border: 1px solid rgba(74, 144, 226, 0.2);
}

.quests.view-compact .quest {
  padding: 10px;
  margin-bottom: 8px;
  border-radius: 8px;
}

/* Enhanced quest styling */
.quest {
  transition: all 0.3s ease;
}

.quest:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 15px rgba(74, 144, 226, 0.2);
}

/* Quest category badges */
.quest-category {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.category-work {
  background: rgba(74, 144, 226, 0.15);
  color: var(--accent-primary);
  border: 1px solid rgba(74, 144, 226, 0.25);
}

.category-health {
  background: rgba(81, 207, 102, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(81, 207, 102, 0.25);
}

.category-learning {
  background: rgba(179, 136, 255, 0.15);
  color: var(--accent-quinary);
  border: 1px solid rgba(179, 136, 255, 0.25);
}

.category-personal {
  background: rgba(255, 107, 107, 0.15);
  color: var(--accent-coral);
  border: 1px solid rgba(255, 107, 107, 0.25);
}

/* Enhanced notifications */
.notification {
  border: 1px solid rgba(74, 144, 226, 0.3);
}

.notification.success {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.9), rgba(76, 175, 80, 0.7));
}

.notification.error {
  background: linear-gradient(135deg, rgba(244, 67, 54, 0.9), rgba(244, 67, 54, 0.7));
}

.notification.info {
  background: linear-gradient(135deg, rgba(33, 150, 243, 0.9), rgba(33, 150, 243, 0.7));
}

.notification.warning {
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.9), rgba(255, 152, 0, 0.7));
}

/* Loading animations */
@keyframes pulseOpacity {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.loading {
  animation: pulseOpacity 1.5s ease-in-out infinite;
}

/* Smooth transitions for all interactive elements */
* {
  transition: all 0.2s ease;
}

/* Enhanced focus states */
button:focus,
input:focus,
select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.3);
}

/* Improved scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--accent-primary) rgba(40, 40, 50, 0.5);
}
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(40, 40, 50, 0.5);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
}

/* Enhanced Quest Elements */
.quests {
  margin-bottom: 2rem;
  display: grid;
  /* Add this */
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  /* Default for dashboard */
  gap: 1rem;
  /* Default for dashboard */
}

.quest {
  background: rgba(40, 40, 50, 0.6);
  border: 1px solid rgba(74, 144, 226, 0.2);
  border-radius: var(--border-radius-md);
  padding: 1.2rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.quest::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent-primary);
  border-radius: 0 2px 2px 0;
  transition: opacity 0.3s ease;
  opacity: 0.6;
}

.quest:hover::before {
  opacity: 1;
}

.quest:hover {
  transform: translateX(3px);
  box-shadow: 0 4px 15px rgba(74, 144, 226, 0.15);
  border-color: rgba(74, 144, 226, 0.3);
}

.quest[data-category="work"]::before { background: var(--accent-primary); }
.quest[data-category="health"]::before { background: var(--accent-green); }
.quest[data-category="learning"]::before { background: var(--accent-quinary); }
.quest[data-category="personal"]::before { background: var(--accent-coral); }
.quest[data-category="cultivation"]::before { background: var(--accent-tertiary); }
.quest[data-category="physical"]::before { background: var(--accent-orange); }

.quest-status {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-inbox {
  background: var(--accent-primary);
  box-shadow: 0 0 10px var(--accent-primary);
}

.status-in-progress {
  background: var(--accent-tertiary);
  box-shadow: 0 0 10px var(--accent-tertiary);
}

.status-completed {
  background: var(--accent-quaternary);
  box-shadow: 0 0 10px var(--accent-quaternary);
}

.quest-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(74, 144, 226, 0.1);
  border: 2px solid rgba(74, 144, 226, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.quest-check:hover {
  background: rgba(74, 144, 226, 0.2);
  border-color: var(--accent-primary);
  transform: scale(1.1);
}

.check-icon {
  width: 16px;
  height: 16px;
  color: var(--accent-primary);
}

.quest-title {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 1rem;
}

.quest-difficulty,
.quest-xp,
.quest-stat,
.quest-category {
  padding: 0.3rem 0.8rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.quest-difficulty {
  background: rgba(255, 193, 7, 0.1);
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.3);
}

.quest-xp {
  background: rgba(76, 175, 80, 0.1);
  color: #4caf50;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.quest-stat {
  background: rgba(156, 39, 176, 0.1);
  color: #9c27b0;
  border: 1px solid rgba(156, 39, 176, 0.3);
}

/* Enhanced Quote System */
.quote-container {
  background: linear-gradient(135deg, rgba(156, 39, 176, 0.1), rgba(103, 58, 183, 0.1));
  border: 1px solid rgba(156, 39, 176, 0.3);
  border-radius: var(--border-radius-md);
  padding: 2rem;
  margin-bottom: 2rem;
  text-align: center;
  position: relative;
}

.quote-container::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 20px;
  font-size: 4rem;
  color: rgba(156, 39, 176, 0.3);
  font-family: serif;
}

.quote-content {
  position: relative;
  z-index: 1;
}

.quote-text {
  font-size: 1.3rem;
  line-height: 1.6;
  color: var(--text-primary);
  font-style: italic;
  margin-bottom: 1rem;
  text-shadow: 0 0 5px rgba(156, 39, 176, 0.3);
}

.quote-author {
  text-align: right;
  font-size: 1rem;
  color: var(--accent-primary);
}

.quote-source {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-left: 0.5rem;
}

.quote-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
  border-top: 1px solid rgba(156, 39, 176, 0.2);
  padding-top: 1rem;
}

.quote-button {
  background: transparent;
  border: 1px solid rgba(156, 39, 176, 0.3);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--accent-primary);
  box-shadow: none;
  transition: all 0.3s ease;
  cursor: pointer;
}

.quote-button:hover {
  background: rgba(156, 39, 176, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(156, 39, 176, 0.3);
}

.quote-button.favorite-active i {
  color: #f44336;
}

/* support favorited state toggled by JS ('favorited') */
.quote-button.favorited i {
  color: #f44336;
}

.quote-button.favorited i {
  animation: heartPulse 0.4s ease;
}

.quote-button.muted {
  background: rgba(244, 67, 54, 0.15);
  border-color: rgba(244, 67, 54, 0.4);
}

.quote-button.muted i {
  color: #f44336;
}

.audio-speed-control {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 2px;
  overflow: hidden;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  width: 28px;
}

.audio-speed-control:hover,
.audio-speed-control.expanded {
  width: auto;
}

.audio-speed-label {
  color: var(--accent-primary, #9c27b0);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.audio-speed-buttons {
  display: flex;
  gap: 2px;
  padding-left: 4px;
  opacity: 0;
  transition: opacity 0.15s ease 0.05s;
  pointer-events: none;
  white-space: nowrap;
}

.audio-speed-control:hover .audio-speed-buttons,
.audio-speed-control.expanded .audio-speed-buttons {
  opacity: 1;
  pointer-events: auto;
}

.speed-btn {
  background: transparent;
  border: 1px solid rgba(156, 39, 176, 0.25);
  color: var(--accent-primary, #9c27b0);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
}

.speed-btn:hover {
  background: rgba(156, 39, 176, 0.15);
}

.speed-btn.active {
  background: rgba(156, 39, 176, 0.4);
  border-color: rgba(156, 39, 176, 0.7);
  color: #fff;
  box-shadow: 0 0 8px rgba(156, 39, 176, 0.4);
}

@keyframes heartPulse {
  0% {
    transform: scale(1);
  }

  30% {
    transform: scale(1.3);
  }

  60% {
    transform: scale(0.95);
  }

  100% {
    transform: scale(1);
  }
}

.quote-container {
  animation: quoteContainerIn 0.5s ease-out forwards;
}

@keyframes quoteContainerIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#new-quote.spinning i {
  animation: spin 0.5s ease-in-out;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}


.quote-categories {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.category-button {
  background: transparent;
  border: 1px solid rgba(156, 39, 176, 0.3);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-primary);
  box-shadow: none;
  transition: all 0.3s ease;
  cursor: pointer;
}

.category-button:hover {
  background: rgba(156, 39, 176, 0.1);
  border-color: var(--accent-primary);
}

.category-button.active {
  background: rgba(156, 39, 176, 0.2);
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(156, 39, 176, 0.5);
}

/* Category-specific colors */
.category-button[data-category="power"] {
  border-color: rgba(255, 73, 97, 0.5);
  color: var(--accent-quaternary);
}

.category-button[data-category="wisdom"] {
  border-color: rgba(74, 144, 226, 0.5);
  color: var(--accent-primary);
}

.category-button[data-category="discipline"] {
  border-color: rgba(146, 100, 255, 0.5);
  color: var(--accent-quinary);
}

.category-button[data-category="growth"] {
  border-color: rgba(6, 214, 160, 0.5);
  color: #06d6a0;
}

.category-button[data-category="perseverance"] {
  border-color: rgba(255, 209, 102, 0.5);
  color: var(--accent-tertiary);
}

.category-button[data-category="faith"] {
  border-color: rgba(156, 39, 176, 0.5);
  color: #9c27b0;
}

/* Category-specific active backgrounds */
.category-button.active[data-category="power"] {
  background: rgba(255, 73, 97, 0.2);
  box-shadow: 0 0 10px rgba(255, 73, 97, 0.4);
}

.category-button.active[data-category="wisdom"] {
  background: rgba(74, 144, 226, 0.2);
  box-shadow: 0 0 10px rgba(74, 144, 226, 0.4);
}

.category-button.active[data-category="discipline"] {
  background: rgba(146, 100, 255, 0.2);
  box-shadow: 0 0 10px rgba(146, 100, 255, 0.4);
}

.category-button.active[data-category="growth"] {
  background: rgba(6, 214, 160, 0.2);
  box-shadow: 0 0 10px rgba(6, 214, 160, 0.4);
}

.category-button.active[data-category="perseverance"] {
  background: rgba(255, 209, 102, 0.2);
  box-shadow: 0 0 10px rgba(255, 209, 102, 0.4);
}

.category-button.active[data-category="faith"] {
  background: rgba(156, 39, 176, 0.2);
  box-shadow: 0 0 10px rgba(156, 39, 176, 0.4);
}

/* Enhanced Pomodoro Timer */
.timer-display {
  font-size: 3rem;
  font-weight: bold;
  margin: 1rem 0;
  color: #4caf50;
  text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
  font-family: 'Courier New', monospace;
}

.timer-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.timer-controls button {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(76, 175, 80, 0.2);
  border: 1px solid rgba(76, 175, 80, 0.5);
  color: #4caf50;
  cursor: pointer;
  transition: all 0.3s ease;
}

.timer-controls button:hover {
  background: rgba(76, 175, 80, 0.4);
  transform: scale(1.1);
}

.timer-modes {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.timer-mode {
  padding: 0.5rem 1rem;
  background: rgba(40, 40, 50, 0.7);
  border: 1px solid rgba(76, 175, 80, 0.3);
  border-radius: 20px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 36px;
}

.timer-mode.active {
  background: rgba(76, 175, 80, 0.2);
  border-color: rgba(76, 175, 80, 0.5);
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

.timer-mode:hover {
  background: rgba(76, 175, 80, 0.1);
}

/* Enhanced Favorites Section */
.favorites-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(233, 30, 99, 0.15);
}

.favorites-header h3 {
  margin: 0;
  position: relative;
  padding-left: 0.5rem;
  border-left: 3px solid #e91e63;
}

.toggle-favorites {
  font-size: 0.8rem;
  background: rgba(233, 30, 99, 0.15);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #f06292;
  font-weight: 500;
  letter-spacing: 0.3px;
  user-select: none;
}

.toggle-favorites:hover {
  background: rgba(233, 30, 99, 0.25);
  color: #e91e63;
}

.favorites-grid {
  display: none;
}

.favorites-grid.active {
  display: block;
}

.favorites-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-style: italic;
}

.favorites-empty i {
  color: #e91e63;
  font-size: 1.2rem;
  margin-right: 0.3rem;
}

.favorite-quote-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: rgba(60, 60, 70, 0.5);
  border: 1px solid rgba(233, 30, 99, 0.15);
  border-radius: 12px;
  padding: 1rem 1rem 0.8rem;
  margin-bottom: 0.75rem;
  position: relative;
  animation: favoriteItemIn 0.35s ease forwards;
  opacity: 0;
  transform: translateY(10px);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.favorite-quote-item:hover {
  border-color: rgba(233, 30, 99, 0.35);
  box-shadow: 0 4px 16px rgba(233, 30, 99, 0.08);
}

.favorite-quote-item:nth-child(1) { animation-delay: 0.03s; }
.favorite-quote-item:nth-child(2) { animation-delay: 0.08s; }
.favorite-quote-item:nth-child(3) { animation-delay: 0.13s; }
.favorite-quote-item:nth-child(4) { animation-delay: 0.18s; }
.favorite-quote-item:nth-child(5) { animation-delay: 0.23s; }
.favorite-quote-item:nth-child(6) { animation-delay: 0.28s; }
.favorite-quote-item:nth-child(7) { animation-delay: 0.33s; }
.favorite-quote-item:nth-child(8) { animation-delay: 0.38s; }

@keyframes favoriteItemIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.favorite-quote-text {
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.5;
  padding-right: 5rem;
}

.favorite-quote-author {
  text-align: right;
  color: var(--accent-primary);
  font-size: 0.85rem;
  opacity: 0.85;
}

.favorite-quote-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.25rem;
}

.favorite-quote-category {
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
  text-transform: capitalize;
  font-weight: 500;
}

.favorite-quote-remove {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  transition: all 0.25s ease;
  font-size: 0.85rem;
}

.favorite-quote-remove:hover {
  color: #e91e63;
  background: rgba(233, 30, 99, 0.1);
  transform: none;
}

.favorite-quote-category[data-category="power"] {
  background: rgba(255, 73, 97, 0.15);
  color: var(--accent-quaternary);
}

.favorite-quote-category[data-category="wisdom"] {
  background: rgba(74, 144, 226, 0.15);
  color: var(--accent-primary);
}

.favorite-quote-category[data-category="discipline"] {
  background: rgba(146, 100, 255, 0.15);
  color: var(--accent-quinary);
}

.favorite-quote-category[data-category="growth"] {
  background: rgba(6, 214, 160, 0.15);
  color: #06d6a0;
}

.favorite-quote-category[data-category="perseverance"] {
  background: rgba(255, 209, 102, 0.15);
  color: var(--accent-tertiary);
}

.favorite-quote-category[data-category="faith"] {
  background: rgba(156, 39, 176, 0.15);
  color: #9c27b0;
}

.favorite-quote-item.favorite-removing {
  opacity: 0;
  transform: translateX(30px);
  transition: all 0.3s ease;
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 2rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.modal-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
  transform: rotate(90deg);
}

/* Quest modal overlay - edit panel style popup */
.quest-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.quest-modal-overlay .quest-edit-panel {
  position: relative;
  z-index: 2001;
  animation: modalPopIn 0.25s ease-out;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes modalPopIn {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Enhanced Modal Buttons */
.settings-modal button,
.load-modal button {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  border: none;
  border-radius: var(--border-radius-md);
  padding: 12px 20px;
  margin: 8px 0;
  width: 100%;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.settings-modal button:hover,
.load-modal button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(74, 144, 226, 0.3);
}

/* Enhanced Loading Spinner */
#loading-spinner {
  background: rgba(20, 20, 30, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 2px solid var(--accent-primary);
  border-radius: var(--border-radius-md);
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Enhanced Level Up Button */
#level-up-btn {
  background: linear-gradient(135deg, #ffc107, #ff9800);
  border: none;
  color: #1a1a1a;
  padding: 1rem 2rem;
  border-radius: var(--border-radius-md);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 5px 15px rgba(255, 193, 7, 0.3);
}

#level-up-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(255, 193, 7, 0.5);
}

/* Enhanced User Profile */
.user-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.avatar-wrapper {
  position: relative;
}

.avatar {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  border: 3px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 5px 15px rgba(74, 144, 226, 0.3);
}

.avatar::after {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: 50%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: rotate 3s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.user-profile h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text-primary);
}

.glow {
  color: var(--accent-primary);
  text-shadow: 0 0 10px var(--accent-primary);
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    text-shadow: 0 0 10px var(--accent-primary);
  }

  to {
    text-shadow: 0 0 20px var(--accent-primary), 0 0 30px var(--accent-primary);
  }
}

/* Enhanced Quest Tags */
.quest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
  align-items: center;
}

.quest-difficulty,
.quest-xp,
.quest-stat,
.quest-category {
  padding: 0.4rem 0.8rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: all 0.3s ease;
}

/* Difficulty-specific colors */
.difficulty-easy {
  background: rgba(81, 207, 102, 0.2);
  color: var(--accent-green);
  border-color: rgba(81, 207, 102, 0.3);
}

.difficulty-medium {
  background: rgba(255, 209, 102, 0.2);
  color: var(--accent-tertiary);
  border-color: rgba(255, 209, 102, 0.3);
}

.difficulty-hard {
  background: rgba(255, 107, 107, 0.2);
  color: var(--accent-coral);
  border-color: rgba(255, 107, 107, 0.3);
}

/* XP tag */
.quest-xp {
  background: rgba(179, 136, 255, 0.2);
  color: var(--accent-quinary);
  border-color: rgba(179, 136, 255, 0.3);
}

/* Stat-specific colors — cohesive Solo Leveling palette */
.stat-strength {
  background: rgba(255, 107, 107, 0.2);
  color: var(--accent-coral);
  border-color: rgba(255, 107, 107, 0.3);
}

.stat-agility {
  background: rgba(78, 205, 196, 0.2);
  color: var(--accent-secondary);
  border-color: rgba(78, 205, 196, 0.3);
}

.stat-intelligence {
  background: rgba(74, 144, 226, 0.2);
  color: var(--accent-primary);
  border-color: rgba(74, 144, 226, 0.3);
}

.stat-stamina {
  background: rgba(81, 207, 102, 0.2);
  color: var(--accent-green);
  border-color: rgba(81, 207, 102, 0.3);
}

.stat-willpower {
  background: rgba(179, 136, 255, 0.2);
  color: var(--accent-quinary);
  border-color: rgba(179, 136, 255, 0.3);
}

.stat-discipline {
  background: rgba(255, 209, 102, 0.2);
  color: var(--accent-tertiary);
  border-color: rgba(255, 209, 102, 0.3);
}

/* Category-specific colors — cohesive Solo Leveling palette */
.category-work {
  background: rgba(74, 144, 226, 0.2);
  color: var(--accent-primary);
  border-color: rgba(74, 144, 226, 0.3);
}

.category-health {
  background: rgba(81, 207, 102, 0.2);
  color: var(--accent-green);
  border-color: rgba(81, 207, 102, 0.3);
}

.category-learning {
  background: rgba(179, 136, 255, 0.2);
  color: var(--accent-quinary);
  border-color: rgba(179, 136, 255, 0.3);
}

.category-personal {
  background: rgba(255, 107, 107, 0.2);
  color: var(--accent-coral);
  border-color: rgba(255, 107, 107, 0.3);
}

.category-cultivation {
  background: rgba(255, 209, 102, 0.2);
  color: var(--accent-tertiary);
  border-color: rgba(255, 209, 102, 0.3);
}

.category-physical {
  background: rgba(78, 205, 196, 0.2);
  color: var(--accent-secondary);
  border-color: rgba(78, 205, 196, 0.3);
}

/* Hover effects for tags */
.quest-difficulty:hover,
.quest-xp:hover,
.quest-stat:hover,
.quest-category:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Quest layout improvements */
.quest {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.2rem;
}

.quest-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

/* Responsive quest tags */
@media (max-width: 768px) {
  .quest-tags {
    gap: 0.3rem;
  }

  .quest-difficulty,
  .quest-xp,
  .quest-stat,
  .quest-category {
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
  }
}

@media (max-width: 480px) {
  .quest-tags {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .quest-difficulty,
  .quest-xp,
  .quest-stat,
  .quest-category {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
  }
}

/* Enhanced Load Modal */
#load-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(20, 20, 30, 0.95);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 2px solid var(--accent-primary);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  z-index: 2000;
  min-width: 400px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
}

#load-modal.show {
  display: block;
  animation: modalFadeIn 0.3s ease-out;
}

#load-modal h2 {
  margin: 0 0 1.5rem 0;
  color: var(--text-primary);
  font-size: 1.6rem;
  font-weight: 600;
  text-align: center;
  position: relative;
  padding: 1rem 2rem 1rem 2rem;
  border-bottom: 1px solid rgba(74, 144, 226, 0.2);
}

#saved-games-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.saved-game-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  margin: 0.5rem 0;
  background: rgba(40, 40, 50, 0.5);
  border: 1px solid rgba(74, 144, 226, 0.2);
  border-radius: var(--border-radius-md);
  transition: all 0.3s ease;
}

.saved-game-item:hover {
  background: rgba(40, 40, 50, 0.7);
  border-color: rgba(74, 144, 226, 0.4);
  transform: translateX(5px);
}

.saved-game-info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.saved-game-date {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
}

.saved-game-level {
  font-size: 0.8rem;
  color: var(--accent-primary);
  font-weight: 600;
}

.load-game-btn {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  border: none;
  border-radius: var(--border-radius-md);
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 0.9rem;
}

.load-game-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

/* Enhanced Modal Close Button */
.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 2rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  z-index: 10;
}

.modal-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
  transform: rotate(90deg);
}

/* Quest Content and Header Layout */
.quest-content {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  width: 100%;
}

.quest-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.quest-status {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.quest-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(74, 144, 226, 0.1);
  border: 2px solid rgba(74, 144, 226, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.quest-check:hover {
  background: rgba(74, 144, 226, 0.2);
  border-color: var(--accent-primary);
  transform: scale(1.1);
}

.check-icon {
  width: 16px;
  height: 16px;
  color: var(--accent-primary);
}

.quest-title {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 1rem;
}

/* Ensure no blank spaces in quest layout */
.quest>* {
  margin: 0;
  padding: 0;
}

.quest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}

/* Pinned comment styling */
.pinned-comment {
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: var(--border-radius-md);
  padding: 0.8rem;
  margin: 0;
  color: var(--text-primary);
  font-style: italic;
  font-size: 0.9rem;
  line-height: 1.4;
}

.pinned-comment a {
  color: #64b5f6;
  text-decoration: underline;
  word-break: break-all;
}

.pinned-comment a:hover {
  color: #90caf9;
}

/* Status-specific colors */
.status-inbox {
  background: var(--accent-primary);
  box-shadow: 0 0 10px var(--accent-primary);
}

.status-in-progress {
  background: var(--accent-tertiary);
  box-shadow: 0 0 10px var(--accent-tertiary);
}

.status-completed {
  background: var(--accent-quaternary);
  box-shadow: 0 0 10px var(--accent-quaternary);
}

/* Spider Chart Modal Content */
.spider-chart-modal .modal-content {
  padding: 20px;
  max-width: 900px;
  /* Adjust as needed */
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

/* Spider Chart SVG styles */
.stats-chart svg {
  overflow: visible;
  /* Allow labels to extend beyond SVG boundaries */
}

.spider-chart-grid line {
  stroke: var(--text-secondary);
  stroke-opacity: 0.1;
  stroke-width: 1px;
}

.spider-chart-grid polygon {
  fill: none;
  stroke: var(--text-secondary);
  stroke-opacity: 0.15;
  stroke-width: 1px;
}

.spider-chart-current polygon {
  fill: url(#grad);
  stroke: var(--accent-primary);
  stroke-width: 2px;
  fill-opacity: 0.5;
}

.spider-chart-current circle {
  fill: var(--accent-primary);
  r: 4px;
}

.spider-chart-previous polygon {
  fill: url(#grad-prev);
  stroke: var(--accent-tertiary);
  /* Use a distinct color for previous */
  stroke-width: 2px;
  fill-opacity: 0.5;
}

.spider-chart-previous circle {
  fill: var(--accent-tertiary);
  r: 4px;
}

.spider-chart-labels text {
  font-size: 10px;
  fill: var(--text-primary);
  text-anchor: middle;
  dominant-baseline: middle;
}

/* Chart Legend */
.chart-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
  padding: 10px 20px;
  background-color: var(--bg-card-dark);
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--box-shadow);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

.legend-color.current {
  background: var(--accent-primary);
}

.legend-color.previous {
  background: var(--accent-tertiary);
}

.legend-label {
  color: var(--text-primary);
  font-size: 0.9rem;
}

/* History Chart Placeholder */
.history-placeholder {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  font-size: 1.2rem;
  color: var(--text-secondary);
  background-color: var(--bg-element);
  border-radius: var(--border-radius-md);
  border: 1px dashed var(--border-light);
}

/* Stat change indicators */
.stat-change.positive {
  color: var(--accent-secondary);
  /* Green for positive change */
  background-color: rgba(78, 205, 196, 0.1);
}

.stat-change.negative {
  color: var(--accent-quaternary);
  /* Red for negative change */
  background-color: rgba(255, 73, 97, 0.1);
}

.quest-countdown {
  background-color: var(--accent-primary);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  margin-left: 8px;
  white-space: nowrap;
}

.quest-countdown.overdue {
  background-color: #d0021b;
  /* A red color for overdue items */
}

/* Quest Grid Empty State */
.quests-empty {
  grid-column: 1 / -1;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
  background: rgba(40, 40, 50, 0.3);
  border: 2px dashed rgba(74, 144, 226, 0.2);
  border-radius: var(--border-radius-lg);
  color: var(--text-secondary);
}

.quests-empty i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--accent-primary);
  opacity: 0.5;
}

.quests-empty h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.3rem;
  color: var(--text-primary);
}

.quests-empty p {
  margin: 0 0 1rem 0;
  font-size: 0.95rem;
  opacity: 0.7;
}

.add-quest-btn-empty {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border: none;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 3px 12px rgba(74, 144, 226, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.add-quest-btn-empty:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

/* Quest Grid Entry Animation */
@keyframes questEntry {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.quest.quest-enter {
  animation: questEntry 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Quest count badge */
.quest-stats .quest-filtered-count {
  color: var(--accent-secondary);
  font-size: 0.85rem;
  margin-left: 0.3rem;
}

.quest-stats .quest-filtered-count::before {
  content: '(';
}

.quest-stats .quest-filtered-count::after {
  content: ')';
}

/* View-specific quest styles applied by JS */
.quests.view-detailed {
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.quests.view-detailed .quest {
  padding: 1.5rem;
  border: 2px solid rgba(74, 144, 226, 0.4);
}

.quests.view-compact {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.8rem;
}

.quests.view-compact .quest {
  padding: 0.8rem;
  border: 1px solid rgba(78, 205, 196, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
  .quests.view-compact {
    grid-template-columns: 1fr;
  }
}

/* View transition for container */
.container {
  transition: all 0.4s ease;
}

/* Stats view-specific styles */
.stats.view-detailed .stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.stats.view-detailed .stat-card {
  padding: 25px;
  outline: 2px solid var(--accent-primary);
  outline-offset: -2px;
}

.stats.view-compact .stats-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.6rem;
}

.stats.view-compact .stat-card {
  padding: 12px;
}

.stats.view-compact .stat-value {
  font-size: 1.2rem;
}

.stats.view-compact .stat-name {
  font-size: 0.75rem;
}

/* Dashboard quest grid baseline */
.quests.view-dashboard {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

/* Hide elements in compact view via container classes */
.container.compact-view .stats-title,
.container.compact-view .character-title-stats {
  display: none;
}
/* ═══════════════════════════════════════════
 * Responsive & Accessibility Improvements
 * ═══════════════════════════════════════════ */

/* Mobile: < 480px */
@media (max-width: 480px) {
  body { padding: 10px; }
  .container { padding: 1rem; }
  .app-header h1 { font-size: 1.3rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .achievement-categories { flex-wrap: wrap; gap: 0.3rem; }
  .achievement-category { font-size: 0.7rem; padding: 0.3rem 0.5rem; }
  .quest-toolbar { flex-direction: column; }
  .add-quest-btn-header { width: 100%; text-align: center; }
  .search-wrapper { max-width: 100%; width: 100%; }
  .filter-group { width: 100%; }
  .filter-group select { width: 100%; }
  .streak-bar { gap: 0.3rem; }
  .streak-day { width: 28px; height: 28px; font-size: 0.7rem; }
  .streak-details { flex-direction: column; gap: 0.5rem; align-items: center; }
  .settings-modal { min-width: auto; width: 95vw; max-height: 85vh; }
  .xp-toast { min-width: auto; width: 90%; padding: 10px 15px; }
  .xp-toast-value { font-size: 1.3rem; }
  .level-up .level { font-size: 2rem; }
  .level-up-number { font-size: 3rem; }
  .level-up-text { font-size: 2rem; }
  .level-up-icon { width: 60px; height: 60px; font-size: 2rem; }
  .quest { padding: 0.8rem; }
  .quest-title { font-size: 0.9rem; }
  .edit-panel-content { gap: 0.5rem; }
  .edit-title-row { flex-wrap: wrap; }
  .edit-footer-row { flex-direction: column; }
  .action-buttons { width: 100%; justify-content: center; }
  .batch-bar { flex-direction: column; align-items: stretch; }
  .batch-actions { justify-content: center; }
  .stat-card { padding: 0.8rem; }
  .stat-value { font-size: 1.5rem; }
  .timer-display { font-size: 2.5rem; }
  .quote-text { font-size: 0.9rem; }
  .favorites-grid { grid-template-columns: 1fr; }
  .quests-grid { grid-template-columns: 1fr; }
  .user-profile { flex-direction: column; gap: 0.5rem; }
  .avatar { width: 50px; height: 50px; font-size: 1.5rem; }
}

/* Tablet: 481-768px */
@media (min-width: 481px) and (max-width: 768px) {
  body { padding: 15px; }
  .container { padding: 1.5rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .quest-toolbar { flex-wrap: wrap; }
  .streak-day { width: 30px; height: 30px; }
  .achievement-categories { flex-wrap: wrap; }
  .favorites-grid { grid-template-columns: repeat(2, 1fr); }
  .quests-grid { grid-template-columns: 1fr; }
}

/* Large screens: > 1400px */
@media (min-width: 1400px) {
  .container { max-width: 1400px; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .quests-grid { grid-template-columns: repeat(2, 1fr); }
  .favorites-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--accent-primary) !important;
  outline-offset: 2px;
}

/* Skip to content link (visually hidden until focused) */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 10001;
  padding: 0.5rem 1rem;
  background: var(--accent-primary);
  color: white;
  text-decoration: none;
  border-radius: 0 0 var(--border-radius-sm) 0;
  transition: top 0.2s;
}
.skip-to-content:focus {
  top: 0;
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.06) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
  border-radius: var(--border-radius-sm);
}
@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Print styles */
@media print {
  .theme-toggle, .settings-icon, .quest-check, .delete-quest-btn,
  .batch-bar, .timer-controls, .quote-actions { display: none !important; }
  body { background: white; color: black; }
  .container { box-shadow: none; border: 1px solid #ccc; }
}

/* ─── Fix: Missing CSS classes found during audit ─── */

/* Achievement card inner elements */
.achievement-details {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.achievement-description {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* Dashboard view container */
.dashboard-view {
  position: relative;
}

/* Stat summary in spider chart */
.stat-summary-total,
.stat-summary-avg {
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.stat-summary-total strong,
.stat-summary-avg strong {
  color: var(--accent-primary);
}

/* Pin comment styling */
.pin-comment {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

/* Error log overlay */
.error-log-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.8);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.error-log-content {
  background: rgba(20,20,30,0.95);
  border: 2px solid var(--accent-quaternary);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  color: var(--text-primary);
}

/* Penalty zone */
#penalty-zone {
  background: rgba(255,0,0,0.08);
  border: 2px solid rgba(255,0,0,0.3);
  border-radius: var(--border-radius-md);
  padding: 1rem;
  margin-top: 2rem;
}
#penalty-zone h3 {
  color: var(--accent-quaternary);
}
#penalty-quests {
  list-style: none;
  padding: 0;
}
#penalty-quests li {
  padding: 0.5rem;
  margin-bottom: 0.3rem;
  background: rgba(255,0,0,0.05);
  border-radius: var(--border-radius-sm);
  font-size: 0.9rem;
}

/* Suggestion popup (missed during audit) */
.suggestion-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 500px;
  max-height: 70vh;
  overflow-y: auto;
  background: rgba(20, 22, 40, 0.98);
  border: 2px solid var(--accent-primary);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  z-index: 10001;
}
.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(74,144,226,0.2);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}
