:root {
  --primary: #00c853;
  --primary-dark: #006400;
  --secondary: #0f9d58;
  --bg: #0a0f0a;
  --surface: #111811;
  --surface2: #162016;
  --border: #1e2e1e;
  --text: #e6f4e6;
  --muted: #7a9a7a;
  --accent: #00ff88;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

body {
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--primary-dark); border-radius: 3px; }

/* ── Landing Page ── */
#landingPage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 70% 30%, #0a2e14 0%, #050d05 60%, #000 100%);
}

.landing-shapes { position: absolute; inset: 0; pointer-events: none; }

.ls1, .ls2, .ls3 {
  position: absolute;
  border-radius: 50%;
  animation: float 8s ease-in-out infinite;
}

.ls1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #00c85320, transparent 70%);
  top: -200px; right: -150px;
  animation-delay: 0s;
}

.ls2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #0f9d5820, transparent 70%);
  bottom: -100px; left: -100px;
  animation-delay: 2s;
}

.ls3 {
  width: 250px; height: 250px;
  background: radial-gradient(circle, #00ff8815, transparent 70%);
  top: 50%; right: 18%;
  animation-delay: 4s;
}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.05); }
}

.landing-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 40px 20px;
  max-width: 650px;
  animation: fadeUp 0.8s ease both;
}

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

.landing-badge {
  display: inline-block;
  background: rgba(0, 200, 83, 0.1);
  border: 1px solid #00c85360;
  color: var(--accent);
  font-size: 12px;
  padding: 5px 18px;
  border-radius: 20px;
  margin-bottom: 28px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.landing-title {
  font-size: 56px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 18px;
  line-height: 1.15;
}

.landing-title span {
  background: linear-gradient(90deg, #00c853, #00ff88);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing-sub {
  color: var(--muted);
  font-size: 17px;
  margin-bottom: 40px;
  line-height: 1.7;
}

.landing-cta {
  background: linear-gradient(135deg, #00c853, #0f9d58);
  color: white;
  border: none;
  padding: 15px 40px;
  font-size: 17px;
  font-weight: 700;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 30px #00c85340;
}

.landing-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 50px #00c85360;
}

/* ── Main App ── */
#mainApp {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  animation: fadeUp 0.5s ease both;
}

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  color: var(--accent);
  text-align: center;
  padding: 22px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 14px;
  text-shadow: 0 0 20px #00ff8840;
}

.menu {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.menu ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 12px 0;
}

.menu-link {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  padding: 8px 22px;
  border-radius: 50px;
  transition: all 0.25s;
  font-size: 14px;
  letter-spacing: 0.5px;
}

.menu-link:hover {
  color: var(--accent);
  background: rgba(0,200,83,0.08);
}

.active-menu {
  background: linear-gradient(135deg, #00c85320, #0f9d5820);
  color: var(--accent) !important;
  border: 1px solid #00c85340;
}

main { flex: 1; }

.section { display: none; padding: 30px 4%; }
.section.active { display: block; animation: fadeUp 0.4s ease both; }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 30px;
  border-radius: 16px;
  margin-bottom: 24px;
  transition: border-color 0.3s;
}

.card:hover { border-color: #00c85330; }
.card h2, .card h3 { color: var(--accent); margin-bottom: 14px; }
.card p { color: var(--muted); line-height: 1.7; }

/* ── About ── */
.about-container { display: flex; gap: 40px; align-items: center; }

.about-container img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--primary);
  box-shadow: 0 0 25px #00c85330;
}

.about-container p { color: var(--text); margin: 7px 0; font-size: 15px; }
.about-container strong { color: var(--accent); }

/* ── Activities Layout ── */
.activities-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: start;
}

/* ── Sidebar ── */
.sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: 16px;
  position: sticky;
  top: 70px;
}

.sidebar-title {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* Folder buttons */
.folder {
  background: var(--surface2);
  border-left: 4px solid var(--primary);
  padding: 10px 14px;
  margin: 6px 0;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
  transition: background 0.2s, transform 0.15s;
}

.folder:hover {
  background: #1e3020;
  transform: translateX(4px);
}

/* Activity lists */
.folder-list {
  list-style: none;
  padding: 0 0 0 10px;
  margin: 0 0 4px;
}

.folder-list li {
  margin: 4px 0;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--muted);
  transition: all 0.2s;
}

.folder-list li:hover {
  background: rgba(0,200,83,0.08);
  color: var(--accent);
  transform: translateX(4px);
}

.hidden { display: none !important; }

/* ── Output ── */
#output {
  background: #050d05;
  border: 1px solid #1a2e1a;
  color: var(--accent);
  padding: 24px;
  border-radius: 12px;
  min-height: 130px;
  font-family: 'Courier New', monospace;
  white-space: pre-line;
  font-size: 15px;
  line-height: 1.7;
  transition: border-color 0.3s;
}

#output:not(:empty) { border-color: #00c85330; }

#dynamicList {
  padding-left: 20px;
  margin-top: 12px;
  color: var(--text);
}

#dynamicList li { margin-bottom: 6px; font-size: 14px; }

/* ── Footer ── */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--muted);
  text-align: center;
  padding: 18px;
  font-size: 13px;
}

/* ── Inline Buttons ── */
.act-btn {
  background: linear-gradient(135deg, #00c853, #0f9d58);
  color: white;
  border: none;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin: 5px 4px;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 0 12px #00c85325;
}

.act-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px #00c85350;
}

.act-btn.secondary {
  background: var(--surface2);
  border: 1px solid var(--border);
  box-shadow: none;
  color: var(--muted);
}

.act-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin: 4px 0;
  outline: none;
  transition: border-color 0.2s;
}

.act-input:focus { border-color: var(--primary); }

/* ── Exercise 4 ── */
.calc-row { margin-bottom: 14px; }

.calc-row label {
  display: block;
  font-weight: 600;
  color: white;
  margin-bottom: 5px;
  font-size: 14px;
}

.calc-row input {
  width: 100%;
  max-width: 300px;
  padding: 9px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: white;
  outline: none;
  transition: border-color 0.2s;
}

.calc-row input:focus { border-color: var(--primary); }

.calc-btns { margin: 16px 0; display: flex; gap: 10px; }

.calc-btns button {
  padding: 9px 20px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #00c853, #0f9d58);
  color: white;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 0 12px #00c85325;
}

.calc-btns button:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px #00c85350;
}

.calc-btns button:last-child {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  box-shadow: none;
}

.calc-btns button:last-child:hover {
  border-color: #00c85340;
  color: var(--accent);
  box-shadow: none;
  transform: none;
}

.grade-result-box {
  margin-top: 20px;
  background: linear-gradient(135deg, #0a2e14, #0d1f0d);
  border: 1px solid #00c85340;
  border-radius: 12px;
  padding: 20px 24px;
  color: white;
  animation: fadeUp 0.3s ease both;
}

.grade-result-box strong { color: var(--accent); font-size: 18px; }

.grade-error {
  margin-top: 12px;
  color: #ff6b6b;
  font-size: 14px;
  font-weight: 600;
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .activities-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }
  .landing-title { font-size: 36px; }
  .about-container { flex-direction: column; text-align: center; }
}