/* ============================================================
   TangibleAI Learning — Nature-Inspired Design System
   ============================================================ */

/* --- Tokens --- */
:root {
  --moss:        #3d6b3e;
  --fern:        #5a8a5c;
  --leaf:        #7ab87c;
  --sage:        #a8c8a0;
  --mint-mist:   #e8f5e6;

  --bark:        #6b4c2a;
  --earth:       #8b6340;
  --sand:        #c4a882;
  --parchment:   #f5edd8;
  --cream:       #fdf8f0;

  --sky:         #4a90b8;
  --river:       #6aafd4;
  --petal-coral: #e07a5f;
  --sunflower:   #f2b705;
  --berry:       #9b4dca;

  --text-dark:   #2c2c2c;
  --text-mid:    #4a4a4a;
  --text-light:  #6b6b6b;

  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --radius-xl:   32px;

  --shadow-sm:   0 2px 8px rgba(61,107,62,0.1);
  --shadow-md:   0 4px 20px rgba(61,107,62,0.15);
  --shadow-lg:   0 8px 40px rgba(61,107,62,0.2);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--cream);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
}

/* ============================================================
   Header / Hero
   ============================================================ */
.site-header {
  background: linear-gradient(135deg, var(--moss) 0%, var(--fern) 50%, var(--sky) 100%);
  position: relative;
  overflow: hidden;
  padding: 2.5rem 1.5rem 3rem;
  text-align: center;
}

.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse at 20% 80%, rgba(122,184,124,0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(74,144,184,0.3) 0%, transparent 50%);
  pointer-events: none;
}

.leaf-decoration {
  position: absolute;
  font-size: 5rem;
  opacity: 0.12;
  pointer-events: none;
  user-select: none;
}
.leaf-decoration.top-left  { top: -1rem;  left: -1rem;  transform: rotate(-20deg); }
.leaf-decoration.top-right { top: -0.5rem; right: -1rem; transform: rotate(30deg);  }
.leaf-decoration.bot-left  { bottom: -1rem; left: 5%;   transform: rotate(10deg);  }
.leaf-decoration.bot-right { bottom: -1rem; right: 5%;  transform: rotate(-15deg); }

.brand {
  position: relative;
  z-index: 1;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.brand-icon {
  width: 52px;
  height: 52px;
  background: rgba(255,255,255,0.2);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.3);
}

.brand-name {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}

.brand-name span {
  color: var(--sunflower);
}

.brand-tagline {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.88);
  font-weight: 400;
  max-width: 480px;
  margin: 0 auto;
}

/* ============================================================
   Feature Pills
   ============================================================ */
.feature-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  padding: 1.5rem 1rem;
  background: var(--parchment);
  border-bottom: 1px solid var(--sand);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
  background: white;
  border: 1.5px solid var(--sage);
  color: var(--moss);
}

.pill span { font-size: 1rem; }

/* ============================================================
   Main Layout
   ============================================================ */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* ============================================================
   Section Headings
   ============================================================ */
.section-heading {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--moss);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ============================================================
   Generator Card
   ============================================================ */
.generator-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  border: 1.5px solid var(--sage);
  margin-bottom: 2.5rem;
}

/* --- Form Grid --- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-field.full-width {
  grid-column: 1 / -1;
}

label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-mid);
  letter-spacing: 0.02em;
}

label .required { color: var(--petal-coral); margin-left: 2px; }

input[type="text"],
select,
textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid #d4e2d0;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text-dark);
  background: var(--mint-mist);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  outline: none;
  font-family: inherit;
}

input[type="text"]::placeholder,
textarea::placeholder {
  color: #9db89a;
}

input[type="text"]:focus,
select:focus,
textarea:focus {
  border-color: var(--fern);
  background: white;
  box-shadow: 0 0 0 3px rgba(90,138,92,0.15);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a8a5c' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.2rem;
  cursor: pointer;
}

textarea {
  resize: vertical;
  min-height: 80px;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 0.1rem;
}

/* --- Generate Button --- */
.btn-generate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  margin-top: 1.5rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, var(--moss), var(--fern));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-md);
}

.btn-generate:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  filter: brightness(1.05);
}

.btn-generate:active:not(:disabled) {
  transform: translateY(0);
}

.btn-generate:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-generate .spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-generate.loading .spinner { display: block; }
.btn-generate.loading .btn-icon { display: none; }
.btn-generate.loading .btn-label::after { content: '…'; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Error Banner
   ============================================================ */
.error-banner {
  display: none;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: #fff0ed;
  border: 1.5px solid #f5c5ba;
  border-radius: var(--radius-md);
  color: #c0392b;
  font-size: 0.9rem;
  margin-top: 1rem;
}

.error-banner.visible { display: flex; }
.error-banner .error-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

/* ============================================================
   Activity Result
   ============================================================ */
.activity-result {
  display: none;
  animation: fadeUp 0.4s ease;
}

.activity-result.visible { display: block; }

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

/* --- Activity Header Banner --- */
.activity-header-banner {
  background: linear-gradient(135deg, var(--moss), var(--sky));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 1.75rem 2rem;
  color: white;
}

.activity-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.activity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.75rem;
  background: rgba(255,255,255,0.18);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.25);
}

/* --- Activity Body --- */
.activity-body {
  background: white;
  border: 1.5px solid var(--sage);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
}

/* --- Section Panels --- */
.activity-section {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #eef4ec;
}

.activity-section:last-child {
  border-bottom: none;
}

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

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

.icon-objective  { background: #e8f5e6; }
.icon-materials  { background: #fff8e1; }
.icon-steps      { background: #e3f2fd; }
.icon-script     { background: #fce4ec; }
.icon-questions  { background: #f3e5f5; }
.icon-notes      { background: #e8f5e1; }

.activity-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--moss);
}

/* --- Objective --- */
.objective-text {
  font-size: 1rem;
  color: var(--text-mid);
  line-height: 1.65;
  padding: 0.75rem 1rem;
  background: var(--mint-mist);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--fern);
}

/* --- Materials --- */
.materials-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
}

.materials-list li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  background: #fff8e1;
  border: 1.5px solid #f0d080;
  border-radius: 50px;
  font-size: 0.875rem;
  color: var(--bark);
  font-weight: 500;
}

.materials-list li::before {
  content: '◆';
  font-size: 0.5rem;
  color: var(--sunflower);
}

/* --- Steps --- */
.steps-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.step-item {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}

.step-number {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sky), var(--river));
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.step-text {
  font-size: 0.95rem;
  color: var(--text-mid);
  line-height: 1.6;
  padding-top: 0.2rem;
}

/* --- Adult Script --- */
.script-box {
  background: #fce4ec;
  border: 1.5px solid #f8bbd0;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  font-size: 0.95rem;
  color: var(--text-mid);
  line-height: 1.7;
  position: relative;
}

.script-box::before {
  content: '"';
  font-size: 3rem;
  color: #f48fb1;
  line-height: 1;
  position: absolute;
  top: 0.25rem;
  left: 0.75rem;
  font-family: Georgia, serif;
}

.script-box p {
  padding-left: 1.25rem;
}

/* --- Open-ended Questions --- */
.questions-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.question-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.8rem 1rem;
  background: #f9f3ff;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--berry);
}

.question-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--berry);
  background: rgba(155,77,202,0.1);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.question-text {
  font-size: 0.95rem;
  color: var(--text-mid);
  line-height: 1.55;
  font-style: italic;
}

/* --- Observation Notes --- */
.notes-box {
  background: var(--mint-mist);
  border: 1.5px solid var(--sage);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  font-size: 0.95rem;
  color: var(--text-mid);
  line-height: 1.7;
}

/* --- Action Bar --- */
.action-bar {
  display: flex;
  gap: 0.75rem;
  padding: 1.25rem 2rem;
  background: var(--parchment);
  border-top: 1px solid #e0d5c0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  flex-wrap: wrap;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  background: white;
  border: 1.5px solid var(--sage);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--moss);
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.btn-secondary:hover {
  background: var(--mint-mist);
  transform: translateY(-1px);
}

.btn-new {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  background: linear-gradient(135deg, var(--moss), var(--fern));
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s;
}

.btn-new:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

/* ============================================================
   Print Styles
   ============================================================ */
@media print {
  .site-header, .feature-pills, .generator-card, .action-bar { display: none !important; }
  .activity-result { display: block !important; }
  .activity-header-banner { background: var(--moss) !important; -webkit-print-color-adjust: exact; }
  body { font-size: 11pt; }
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.82rem;
  color: var(--text-light);
  border-top: 1px solid #e8ede6;
  background: white;
}

.site-footer strong { color: var(--moss); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 640px) {
  .brand-name { font-size: 1.5rem; }

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

  .form-field.full-width { grid-column: auto; }

  .generator-card { padding: 1.25rem; }

  .activity-header-banner { padding: 1.25rem 1.25rem; }
  .activity-section        { padding: 1.25rem 1.25rem; }
  .action-bar              { padding: 1rem 1.25rem; }

  .activity-title { font-size: 1.25rem; }

  .action-bar { flex-direction: column; }
  .btn-secondary, .btn-new { justify-content: center; }
}
