@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Swamp Theme (Dark - Default) */
  --bg-base: #0D1410;
  --bg-surface: #16211A;
  --bg-card: #1C2A21;
  --border-color: #2A3D2E;
  --text-primary: #E8F0E5;
  --text-secondary: #8FA894;
  --accent: #6FCF5A;
  --accent-glow: rgba(111, 207, 90, 0.25);
  --accent-gold: #E8B84B;
  --accent-gold-glow: rgba(232, 184, 75, 0.25);
  --accent-danger: #E85D4B;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

[data-theme="light"] {
  /* Daylight Goblin Theme */
  --bg-base: #EBF0E8;
  --bg-surface: #FFFFFF;
  --bg-card: #F3F8F1;
  --border-color: #C5D4C3;
  --text-primary: #121F16;
  --text-secondary: #485A4C;
  --accent: #3E8B30;
  --accent-glow: rgba(62, 139, 48, 0.2);
  --accent-gold: #B88514;
  --accent-gold-glow: rgba(184, 133, 20, 0.2);
  --accent-danger: #C7402F;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

#app-container {
  width: 100%;
  max-width: 540px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg-surface);
  box-shadow: var(--shadow-lg);
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  transition: background 0.3s ease;
}

/* Header */
.app-header {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 0 6px var(--accent-glow));
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.brand-tagline {
  font-size: 0.75rem;
  color: var(--accent-gold);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--accent-glow);
}

/* Mascot Display Area */
.mascot-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 16px 10px 16px;
  text-align: center;
}

.mascot-sprite {
  width: 120px;
  height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.25));
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mascot-sprite.bounce {
  animation: goblinBounce 0.8s infinite alternate;
}

.mascot-speech {
  margin-top: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-gold);
  max-width: 88%;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.mascot-speech::after {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 0 8px 8px 8px;
  border-style: solid;
  border-color: transparent transparent var(--bg-card) transparent;
}

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

/* View Container */
.view-content {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #3e8b30 100%);
  color: #0d1410;
  border: none;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.05rem;
  padding: 16px 28px;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 4px 16px var(--accent-glow);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.btn-small {
  padding: 8px 12px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
}

/* Home / Task List View */
.input-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.input-label {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
  display: block;
  color: var(--text-primary);
}

.task-input {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  margin-bottom: 12px;
  outline: none;
  transition: border-color 0.2s ease;
}

.task-input:focus {
  border-color: var(--accent);
}

.task-input-details {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  resize: vertical;
  min-height: 90px;
  margin-bottom: 16px;
  outline: none;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

/* Drag and Drop Task List */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: grab;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.task-item:active {
  cursor: grabbing;
}

.task-item.dragging {
  opacity: 0.5;
  border-color: var(--accent-gold);
  box-shadow: var(--shadow-lg);
  transform: scale(1.02);
}

.drag-handle {
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: grab;
  padding: 0 4px;
}

.task-number {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--accent-gold);
  background: var(--accent-gold-glow);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.task-item-content {
  flex: 1;
}

.task-item-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}

.task-item-badge {
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 20px;
  background: rgba(111, 207, 90, 0.15);
  color: var(--accent);
  font-weight: 700;
}

.task-move-controls {
  display: flex;
  gap: 4px;
}

.task-move-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.task-move-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Readiness Scale View */
.readiness-scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 24px 0;
}

.scale-btn {
  aspect-ratio: 1;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.scale-btn:hover, .scale-btn.active {
  border-color: var(--accent-gold);
  background: var(--accent-gold-glow);
  color: var(--accent-gold);
  transform: scale(1.08);
}

/* Circular Timer Ritual */
.timer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 30px 0;
}

.circular-timer {
  position: relative;
  width: 220px;
  height: 220px;
}

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

.timer-circle-bg {
  fill: none;
  stroke: var(--bg-card);
  stroke-width: 10;
}

.timer-circle-progress {
  fill: none;
  stroke: var(--accent-gold);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 628;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
}

.timer-time {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* Fullscreen Active Step View */
.step-card {
  background: var(--bg-card);
  border: 2px solid var(--accent);
  box-shadow: 0 0 24px var(--accent-glow);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  margin: auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.step-indicator {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-gold);
  font-weight: 700;
  margin-bottom: 16px;
}

.step-text {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: 32px;
}

/* Floating Action Overlay Buttons */
.floating-notes-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-gold);
  color: #0d1410;
  border: none;
  font-size: 1.5rem;
  box-shadow: 0 6px 20px var(--accent-gold-glow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99;
  transition: transform 0.2s ease;
}

.floating-notes-btn:hover {
  transform: scale(1.1);
}

/* Overlay Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--accent-gold);
}

/* Breathing Circle */
.breathing-circle-container {
  width: 180px;
  height: 180px;
  margin: 30px auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.breathing-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--accent-glow);
  border: 3px solid var(--accent);
  animation: pulseBreathing 8s infinite ease-in-out;
}

@keyframes pulseBreathing {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.5); opacity: 0.9; }
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--accent-gold);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideDown 0.3s ease;
}

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