:root {
  --primary: #F5A623;
  --primary-dark: #E09000;
  --secondary: #6B5B95;
  --accent: #E84A5F;
  --success: #7CB342;
  --background: #FFF8E7;
  --background-dark: #F5ECD7;
  --text: #4A4A4A;
  --text-light: #7A7A7A;
  --card-bg: #FFFFFF;
  --shadow: rgba(107, 91, 149, 0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--background);
  color: var(--text);
  min-height: 100vh;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  background: linear-gradient(135deg, var(--secondary) 0%, #8B7BB5 100%);
  padding: 1rem;
  box-shadow: 0 4px 20px var(--shadow);
}

.header-content {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-emoji {
  font-size: 1.5rem;
}

.logo-text {
  font-weight: 700;
  font-size: 1.2rem;
  color: white;
  letter-spacing: -0.5px;
}

.stats-section {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.stat-badge {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 0.4rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: white;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.stat-badge:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.flame-icon {
  animation: flicker 0.5s infinite alternate;
}

@keyframes flicker {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}

.xp-label {
  font-size: 0.7rem;
  opacity: 0.9;
}

.daily-ring {
  width: 36px;
  height: 36px;
  position: relative;
}

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

.progress-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.3);
  stroke-width: 3;
}

.progress-ring-fill {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dasharray 0.5s;
}

.ring-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.9rem;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 1.5rem;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

/* Welcome Section */
.welcome-section {
  text-align: center;
  margin-bottom: 1.5rem;
}

.welcome-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 0.25rem;
}

.welcome-subtitle {
  color: var(--text-light);
  font-size: 1rem;
}

/* Verse Card */
.verse-card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 8px 30px var(--shadow);
  margin-bottom: 1.5rem;
  border: 1px solid rgba(245, 166, 35, 0.2);
}

.verse-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

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

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

.verse-text {
  font-family: 'Crimson Pro', serif;
  font-size: 1.35rem;
  line-height: 1.6;
  color: var(--text);
  font-style: italic;
  margin-bottom: 1rem;
}

.verse-reference {
  font-family: 'Crimson Pro', serif;
  color: var(--primary-dark);
  font-weight: 600;
  font-size: 1rem;
}

/* Start Lesson Button */
.start-lesson-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, #FFB84D 100%);
  color: white;
  border: none;
  border-radius: 16px;
  padding: 1.25rem;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(245, 166, 35, 0.4);
  margin-bottom: 1.5rem;
}

.start-lesson-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 166, 35, 0.5);
}

.btn-icon {
  font-size: 1.3rem;
}

.btn-time {
  font-size: 0.85rem;
  opacity: 0.9;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
}

.completed-badge {
  background: linear-gradient(135deg, var(--success) 0%, #8BC34A 100%);
  color: white;
  padding: 1rem;
  border-radius: 16px;
  text-align: center;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

/* Quick Stats */
.quick-stats {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.quick-stat {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 1rem;
  text-align: center;
  flex: 1;
  box-shadow: 0 4px 15px var(--shadow);
}

.qs-emoji {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 0.25rem;
}

.qs-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--secondary);
  display: block;
}

.qs-label {
  font-size: 0.75rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Lesson Progress */
.lesson-progress {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--background-dark);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--success) 100%);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 0.85rem;
  color: var(--text-light);
  font-weight: 500;
}

.verse-reference {
  text-align: center;
  font-family: 'Crimson Pro', serif;
  color: var(--secondary);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

/* Exercise Cards */
.exercise-card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 8px 30px var(--shadow);
  animation: slideUp 0.4s ease;
}

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

.exercise-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 0.5rem;
}

.exercise-instruction {
  color: var(--text-light);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

/* Fill in Blank */
.verse-with-blanks {
  font-family: 'Crimson Pro', serif;
  font-size: 1.2rem;
  line-height: 2;
  margin-bottom: 1.5rem;
}

.blank-slot {
  display: inline-block;
  min-width: 80px;
  padding: 0.25rem 0.5rem;
  background: var(--background);
  border: 2px dashed var(--secondary);
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin: 0.2rem;
}

.blank-slot.selected {
  border-color: var(--primary);
  background: rgba(245, 166, 35, 0.1);
}

.blank-slot.filled {
  background: var(--success);
  color: white;
  border-style: solid;
}

.blank-slot.correct {
  animation: pulse-success 0.5s;
}

.blank-slot.incorrect {
  animation: shake 0.5s;
  background: var(--accent);
  color: white;
}

@keyframes pulse-success {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.word-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.word-option {
  background: var(--secondary);
  color: white;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 12px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Crimson Pro', serif;
}

.word-option:hover:not(:disabled) {
  background: var(--primary);
  transform: translateY(-2px);
}

.word-option:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Verse Order */
.user-order-area {
  min-height: 100px;
  background: var(--background);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
}

.placeholder {
  color: var(--text-light);
  font-style: italic;
}

.ordered-segment {
  background: var(--secondary);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-family: 'Crimson Pro', serif;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}

.ordered-segment.correct {
  background: var(--success);
}

.ordered-segment.incorrect {
  background: var(--accent);
  animation: shake 0.5s;
}

.segment-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.segment-option {
  background: var(--card-bg);
  border: 2px solid var(--secondary);
  color: var(--text);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: 'Crimson Pro', serif;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.segment-option:hover {
  background: var(--secondary);
  color: white;
}

/* Reflection */
.reflection-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.reflection-option {
  background: var(--background);
  border: 2px solid transparent;
  border-radius: 16px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.reflection-option:hover {
  border-color: var(--secondary);
}

.reflection-option.selected {
  border-color: var(--primary);
  background: rgba(245, 166, 35, 0.15);
}

.reflection-emoji {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
}

.reflection-text {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 500;
}

.reflection-note {
  width: 100%;
  min-height: 100px;
  padding: 1rem;
  border: 2px solid var(--background-dark);
  border-radius: 12px;
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  resize: vertical;
  margin-bottom: 1rem;
}

.reflection-note:focus {
  outline: none;
  border-color: var(--secondary);
}

.continue-btn {
  width: 100%;
  background: var(--secondary);
  color: white;
  border: none;
  padding: 1rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.continue-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.continue-btn:not(:disabled):hover {
  background: var(--primary);
}

.continue-btn.primary {
  background: linear-gradient(135deg, var(--primary) 0%, #FFB84D 100%);
}

/* Meditate */
.meditate-verse {
  text-align: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--background) 0%, rgba(245, 166, 35, 0.1) 100%);
  border-radius: 16px;
  margin-bottom: 1.5rem;
}

.meditate-verse blockquote {
  font-family: 'Crimson Pro', serif;
  font-size: 1.25rem;
  font-style: italic;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.meditate-verse cite {
  font-family: 'Crimson Pro', serif;
  color: var(--primary-dark);
  font-weight: 600;
}

.meditate-timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.timer-circle {
  width: 120px;
  height: 120px;
  position: relative;
}

.timer-circle svg {
  transform: rotate(-90deg);
}

.timer-bg {
  fill: none;
  stroke: var(--background-dark);
  stroke-width: 8;
}

.timer-progress {
  fill: none;
  stroke: var(--primary);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 283;
  transition: stroke-dashoffset 1s linear;
}

.timer-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--secondary);
}

.start-meditation-btn {
  background: linear-gradient(135deg, var(--secondary) 0%, #8B7BB5 100%);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.start-meditation-btn:hover {
  transform: scale(1.05);
}

.breathing-text {
  color: var(--text-light);
  font-style: italic;
  animation: breathe 4s infinite ease-in-out;
}

@keyframes breathe {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Completion Screen */
.completion-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.completion-content {
  text-align: center;
  background: var(--card-bg);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: 0 12px 40px var(--shadow);
  animation: popIn 0.5s ease;
  max-width: 400px;
  width: 100%;
}

@keyframes popIn {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

.completion-emoji {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.completion-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 0.5rem;
}

.encouragement {
  color: var(--text-light);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.completion-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.stat-item {
  text-align: center;
}

.stat-item .stat-value {
  font-size: 2rem;
  font-weight: 700;
  display: block;
}

.stat-item .stat-label {
  font-size: 0.85rem;
  color: var(--text-light);
  text-transform: uppercase;
}

.xp-earned .stat-value {
  color: var(--primary);
}

.xp-earned .stat-value.bounce {
  animation: bounceIn 0.5s ease;
}

@keyframes bounceIn {
  0% { transform: scale(0); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* Confetti */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 1000;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Progress Screen */
.progress-screen {
  flex: 1;
  padding: 1.5rem;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.back-btn {
  background: none;
  border: none;
  color: var(--secondary);
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.progress-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--secondary);
  text-align: center;
  margin-bottom: 1.5rem;
}

.streak-display {
  background: linear-gradient(135deg, var(--accent) 0%, #FF6B7A 100%);
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  color: white;
  margin-bottom: 1.5rem;
}

.big-streak {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fire-animation {
  font-size: 3rem;
  animation: flicker 0.3s infinite alternate;
}

.streak-number {
  font-size: 4rem;
  font-weight: 700;
  line-height: 1;
}

.streak-label {
  font-size: 1rem;
  opacity: 0.9;
  margin-top: 0.25rem;
}

.longest-streak {
  margin-top: 1rem;
  opacity: 0.9;
}

.level-display {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 15px var(--shadow);
}

.level-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.level-emoji {
  font-size: 2rem;
}

.level-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--secondary);
}

.level-progress .level-bar {
  height: 12px;
  background: var(--background);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.level-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--success) 100%);
  border-radius: 6px;
  transition: width 0.5s;
}

.next-level {
  font-size: 0.85rem;
  color: var(--text-light);
}

.calendar-section {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 15px var(--shadow);
}

.calendar-section h3 {
  color: var(--secondary);
  margin-bottom: 1rem;
  text-align: center;
}

.day-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.day-label {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 600;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}

.calendar-day {
  aspect-ratio: 1;
  border-radius: 6px;
  background: var(--background);
}

.calendar-day.studied {
  background: var(--success);
}

.calendar-day.today {
  border: 2px solid var(--primary);
}

.stats-summary {
  display: flex;
  gap: 1rem;
}

.summary-stat {
  flex: 1;
  background: var(--card-bg);
  border-radius: 16px;
  padding: 1.25rem;
  text-align: center;
  box-shadow: 0 4px 15px var(--shadow);
}

.summary-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--secondary);
  display: block;
}

.summary-label {
  font-size: 0.8rem;
  color: var(--text-light);
  text-transform: uppercase;
}

/* Footer */
.footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-light);
  font-size: 0.85rem;
}

.footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.footer a:hover {
  text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .header-content {
    padding: 0 0.5rem;
  }
  
  .logo-text {
    font-size: 1rem;
  }
  
  .stat-badge {
    padding: 0.3rem 0.5rem;
    font-size: 0.85rem;
  }
  
  .main-content {
    padding: 1rem;
  }
  
  .welcome-title {
    font-size: 1.5rem;
  }
  
  .verse-text {
    font-size: 1.15rem;
  }
  
  .reflection-options {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .completion-stats {
    gap: 1rem;
  }
  
  .completion-content {
    padding: 1.5rem;
  }
}