/* ===============================================
   COMP3421 — Lab 9 Session 3: Dynamic Content Creation
   =============================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

:root {
  --space: 8px;
  --radius: 12px;
  --border: 1px;

  --text: #0f172a;
  --muted: #475569;
  --bg-page: #f8fafc;

  --accent: #2563eb;
  --accent-2: #60a5fa;

  --success: #22c55e;
  --error: #ef4444;
  --warning: #f59e0b;

  --btn-bg: #111827;
  --btn-text: #ffffff;
  --btn-glow: rgba(37, 99, 235, 0.45);
}

body {
  background: var(--bg-page);
  color: var(--text);
  line-height: 1.6;
}

/* Base styles */
.lab-container {
  width: min(1100px, 92vw);
  margin-inline: auto;
  padding-inline: calc(var(--space) * 2);
}

.section {
  margin-block: calc(var(--space) * 3);
}

.card {
  background: white;
  border-radius: var(--radius);
  padding: calc(var(--space) * 3);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

h1, h2, h3, h4 {
  line-height: 1.25;
  margin: 0 0 calc(var(--space) * 1.25);
  color: var(--text);
}

p {
  margin: 0 0 calc(var(--space) * 1.25);
  color: var(--muted);
}

.site-header,
.site-footer {
  padding-block: calc(var(--space) * 2.5);
  text-align: center;
  background: white;
  border-bottom: 1px solid #e2e8f0;
}

.site-footer {
  border-top: 1px solid #e2e8f0;
  border-bottom: none;
  margin-top: calc(var(--space) * 5);
}

.tagline {
  font-size: 1.1rem;
  color: var(--muted);
}

/* Section styles */
.overview-section .card {
  background: linear-gradient(135deg, #dbeafe 0%, #f0f9ff 100%);
  border-left: 4px solid var(--accent);
}

.objectives-section .card {
  background: linear-gradient(135deg, #dcfce7 0%, #f0fdf4 100%);
  border-left: 4px solid var(--success);
}

.objectives-section ul {
  margin-left: 20px;
}

.objectives-section li {
  margin: calc(var(--space) * 1) 0;
}

.submission-section .card {
  background: linear-gradient(135deg, #fef3c7 0%, #fef9e7 100%);
  border-left: 4px solid var(--warning);
}

.submission-section ul {
  margin-left: 20px;
}

.submission-section li {
  margin: calc(var(--space) * 1) 0;
}

/* Questions section */
.questions-section .question-card {
  background: linear-gradient(135deg, #e0e7ff 0%, #f5f3ff 100%);
  border-left: 4px solid #6366f1;
}

.question-item {
  margin: calc(var(--space) * 3) 0;
  padding: calc(var(--space) * 2);
  background: white;
  border-radius: var(--radius);
}

.question-item h3 {
  color: var(--accent);
}

.answer-area {
  margin-top: calc(var(--space) * 2);
}

.answer-box {
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius);
  padding: calc(var(--space) * 2);
  min-height: 100px;
}

.answer-box p {
  margin: 0;
  color: var(--muted);
}

/* Task card styles */
.task-card {
  background: white;
  margin: calc(var(--space) * 3) 0;
}

.learning-points {
  background: linear-gradient(135deg, #fef3c7 0%, #fef9e7 100%);
  padding: calc(var(--space) * 2);
  border-radius: var(--radius);
  margin: calc(var(--space) * 2) 0;
  border-left: 4px solid var(--warning);
}

.learning-points h3 {
  margin-top: 0;
  color: #92400e;
}

.key-concepts {
  background: linear-gradient(135deg, #dbeafe 0%, #f0f9ff 100%);
  padding: calc(var(--space) * 2);
  border-radius: var(--radius);
  margin: calc(var(--space) * 3) 0;
  border-left: 4px solid var(--accent);
}

.key-concepts h4 {
  margin-top: 0;
  color: var(--accent);
}

.key-concepts ul {
  margin-left: 20px;
}

.key-concepts li {
  margin: calc(var(--space) * 1) 0;
}

/* Code styles */
code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
  color: #dc2626;
}

pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: calc(var(--space) * 2);
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: 'Monaco', 'Courier New', monospace;
}

/* ===============================================
   TODO LIST STYLES (SESSION 3 TASK 1)
   =============================================== */

.todo-demo-wrapper {
  background: #f8fafc;
  border-radius: 12px;
  padding: 24px;
  margin: 20px 0;
  border: 2px solid #e2e8f0;
}

.todo-demo-wrapper h3 {
  margin: 0 0 20px 0;
  color: var(--text);
  font-size: 1.25rem;
}

.todo-form {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.todo-input {
  flex: 1;
  padding: 12px 16px;
  font-size: 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-family: inherit;
}

.todo-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.add-btn {
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--btn-text);
  background: var(--success);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.add-btn:hover {
  background: #16a34a;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(34, 197, 94, 0.3);
}

.todo-stats {
  padding: 12px 16px;
  background: white;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  margin-bottom: 16px;
  font-weight: 600;
}

.todo-stats .count {
  color: var(--accent);
  font-size: 1.2rem;
  margin-left: 8px;
}

.todo-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.todo-item {
  background: white;
  padding: 16px;
  margin-bottom: 12px;
  border-radius: 8px;
  border: 2px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  animation: slideIn 0.3s ease;
}

.todo-item:hover {
  border-color: var(--accent);
  transform: translateX(4px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.todo-item span {
  flex: 1;
  color: var(--text);
  font-size: 1rem;
}

.todo-item button {
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: white;
  background: var(--error);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.todo-item button:hover {
  background: #dc2626;
  transform: scale(1.05);
}

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

/* ===============================================
   USER CARD STYLES (SESSION 3 TASK 2)
   =============================================== */

.card-demo-wrapper {
  background: #f8fafc;
  border-radius: 12px;
  padding: 24px;
  margin: 20px 0;
  border: 2px solid #e2e8f0;
}

.card-demo-wrapper h3 {
  margin: 0 0 20px 0;
  color: var(--text);
  font-size: 1.25rem;
}

.card-form {
  background: white;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.card-input {
  padding: 12px 16px;
  font-size: 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-family: inherit;
}

.card-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.add-card-btn {
  width: 100%;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--btn-text);
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.add-card-btn:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.card-stats {
  padding: 12px 16px;
  background: white;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  margin-bottom: 16px;
  font-weight: 600;
}

.card-stats .count {
  color: var(--accent);
  font-size: 1.2rem;
  margin-left: 8px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.user-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  transition: all 0.3s ease;
  animation: slideIn 0.3s ease;
}

.user-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  border-color: var(--accent);
}

.user-card h3 {
  margin: 0 0 8px 0;
  color: var(--text);
  font-size: 1.3rem;
}

.user-card .role {
  color: var(--accent);
  font-weight: 600;
  margin: 4px 0;
  font-size: 1rem;
}

.user-card .email {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 4px 0 16px 0;
}

.user-card .delete-btn {
  width: 100%;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: white;
  background: var(--error);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.user-card .delete-btn:hover {
  background: #dc2626;
  transform: scale(1.02);
}

/* Responsive Design */
@media (max-width: 768px) {
  .lab-container {
    width: 95vw;
  }

  .todo-form {
    flex-direction: column;
  }

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

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