/* CSS Variables for consistent theming */
:root {
  /* Primary Colors */
  --primary: #6b8e23;
  --primary-dark: #556b2f;
  --primary-light: #9acd32;

  /* Text Colors */
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;

  /* Background Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-accent: #f3f4f6;

  /* Border Colors */
  --border-light: #e5e7eb;
  --border-medium: #d1d5db;

  /* Shadow Colors */
  --shadow-primary: rgba(107, 142, 35, 0.3);
  --shadow-secondary: rgba(0, 0, 0, 0.1);

  /* Gradient Colors */
  --gradient-start: #f0f8e8;
  --gradient-end: #e8f5e8;
}

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

body {
  font-family: "Inter", sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Container */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 2rem;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: visible;
  min-width: 320px;
  width: 100%;
}

@media (max-width: 640px) {
  .container {
    padding: 1.5rem 1.5rem;
    justify-content: center;
    margin: 0;
    width: 100%;
    max-width: 100%;
  }
}

/* Header */
header {
  text-align: center;
  flex-shrink: 0;
  margin-bottom: 2rem;
}

.title {
  font-size: 2.5rem;
  font-weight: 300;
  color: var(--primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
}

.subtitle {
  font-size: 1.125rem;
  color: var(--primary-dark);
  max-width: 500px;
  margin: 0 auto;
  font-weight: 400;
}

@media (max-width: 640px) {
  header {
    margin-bottom: 1.5rem;
  }

  .title {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .form {
    gap: 1rem;
  }
}

/* Main container */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 0;
  width: 100%;
  position: relative;
}

@media (max-width: 640px) {
  main {
    justify-content: flex-start;
    padding-top: 2rem;
  }
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-height: 100%;
  overflow: visible;
  width: 100%;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-dark);
  letter-spacing: -0.2px;
}

.textarea {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--border-light);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  resize: none;
  transition: all 0.3s ease;
  color: var(--text-primary);
  background: var(--bg-primary);
  min-height: 75px;
  max-height: 120px;
  overflow-y: auto;
}

.textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(107, 142, 35, 0.1);
  position: relative;
  z-index: 1;
}

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

/* Buttons */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: 2px solid var(--primary);
  box-shadow: 0 2px 8px var(--shadow-primary);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  outline: none;
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: 0 4px 12px var(--shadow-primary);
  transform: translateY(-1px);
}

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

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

/* Animation Container */
.animation-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  overflow: visible;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

@media (max-width: 640px) {
  .animation-container {
    top: 3rem;
    justify-content: flex-start;
  }
}

.section {
  text-align: center;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section.hidden {
  display: none;
}

/* Cards */
.card {
  padding: 2rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px var(--shadow-secondary);
  transition: all 0.3s ease;
  width: 100%;
  max-width: 100%;
}

.memory-card {
  background: var(--bg-primary);
  border: 2px solid var(--border-light);
}

.lesson-card {
  background: linear-gradient(
    135deg,
    var(--gradient-start) 0%,
    var(--gradient-end) 100%
  );
  border: 2px solid var(--primary);
}

.card-text {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--primary-dark);
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Fire Container */
.fire-container {
  position: relative;
  height: 60px;
  margin-top: 1rem;
  overflow: hidden; /* Keep this hidden to contain particles */
  width: 100%;
}

.fire-particle {
  position: absolute;
  background: radial-gradient(circle, #ff5722, #f44336);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(255, 87, 34, 0.6);
  z-index: 10; /* Ensure particles stay above content */
}

/* FAB Button */
.fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--shadow-primary);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* Responsive adjustments for FAB button */
@media (max-width: 640px) {
  .fab {
    bottom: 1rem;
    right: 1rem;
    width: 48px;
    height: 48px;
  }

  .fab svg {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 480px) {
  .fab {
    bottom: 0.75rem;
    right: 0.75rem;
    width: 44px;
    height: 44px;
  }

  .fab svg {
    width: 18px;
    height: 18px;
  }
}

.fab:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 16px var(--shadow-primary);
  transform: scale(1.1);
}

.fab:active {
  transform: scale(0.95);
}

.fab svg {
  width: 24px;
  height: 24px;
}

/* Notification Container */
.notification-container {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
  max-width: 400px;
  width: calc(100% - 4rem);
  min-height: 60px; /* Prevent CLS by reserving space */
  pointer-events: none; /* Allow clicks to pass through when empty */
  display: flex;
  flex-direction: column;
  align-items: center;
}

.notification-container:empty {
  min-height: 0; /* Remove height when empty */
}

.notification {
  background: linear-gradient(135deg, #f0f8e8 0%, #e8f5e8 100%);
  border: 2px solid var(--primary);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 8px 24px var(--shadow-primary);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--primary-dark);
  transform: translateY(100%);
  opacity: 0;
  position: relative;
  font-weight: 500;
  pointer-events: auto; /* Re-enable pointer events */
  backdrop-filter: blur(8px);
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.notification::before {
  content: "🌱";
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  background: var(--bg-primary);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 0.8rem;
}

/* Responsive adjustments for notifications */
@media (max-width: 640px) {
  .notification-container {
    bottom: 1rem;
    width: calc(100% - 2rem);
    max-width: none;
  }

  .notification {
    font-size: 0.9rem;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
  }

  .notification::before {
    left: -8px;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
  }

  .card {
    padding: 1.5rem;
    margin-bottom: 1rem;
    width: 100%;
  }

  .fire-container {
    height: 50px;
    width: 100%;
  }

  .input-group {
    gap: 0.25rem;
  }
}

@media (max-width: 480px) {
  .notification-container {
    bottom: 0.75rem;
    width: calc(100% - 1.5rem);
  }

  .notification {
    font-size: 0.85rem;
    padding: 0.875rem 1rem;
    margin-bottom: 0.5rem;
  }

  .card {
    padding: 1rem;
    margin-bottom: 0.75rem;
    width: 100%;
  }

  .fire-container {
    height: 40px;
    width: 100%;
  }

  .card-text {
    font-size: 0.9rem;
  }

  .form {
    gap: 0.75rem;
  }

  .input-group {
    gap: 0.2rem;
  }

  .textarea {
    min-height: 60px;
    max-height: 100px;
    padding: 0.75rem;
  }
}

/* Utility Classes */
.hidden {
  display: none !important;
}
