/* BlueJ-style Java Lab - Shared Styles */
:root {
  --heading: #003366;
  --btn-start: #0078d7;
  --btn-end: #005fa3;
  --btn-hover: #0069bd;
  --page-bg: #ffffff;
  --text: #222222;
  --muted: #556070;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
}

.lab-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

header h1 {
  margin: 0 0 6px 0;
  color: var(--heading);
  font-size: 28px;
}

header p {
  margin: 0 0 18px 0;
  color: var(--muted);
}

.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  padding: 16px;
}

.controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.run-btn {
  appearance: none;
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--btn-start), var(--btn-end));
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 120, 215, 0.3);
  transition: transform 0.05s ease, filter 0.15s ease;
}

.run-btn:hover { filter: brightness(1.05); }
.run-btn:active { transform: translateY(1px); }
.run-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.back-link {
  color: var(--btn-end);
  font-weight: 600;
  text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

.editor {
  display: grid;
  gap: 12px;
}

label {
  font-weight: 600;
  color: var(--heading);
}

textarea.code-area {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  background: #1e1e1e; /* dark editor */
  color: #e6e6e6;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  font-size: 14px;
  line-height: 1.5;
}

textarea.stdin-area {
  width: 100%;
  min-height: 60px;
  resize: vertical;
  background: #f7f9fc;
  color: #111827;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
}

pre.output {
  background: #0b0b0b;
  color: #5cff84; /* bluej-like green output */
  border-radius: 10px;
  padding: 12px;
  overflow: auto;
  min-height: 140px;
  border: 1px solid #1f2937;
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  padding: 12px 0 0;
}

.topic-item {
  display: block;
  position: relative;
  background: #fff;
  padding: 16px 44px 16px 16px;
  border-radius: 14px;
  text-decoration: none;
  color: #ffffff;
  border: 1px solid transparent;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  transition: transform 0.08s ease, box-shadow 0.18s ease, filter 0.2s ease;
  will-change: transform, filter;
}

.topic-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.14);
  filter: brightness(1.03);
}

.topic-item:active {
  transform: translateY(-1px);
}

.topic-item:focus-visible {
  outline: 3px solid rgba(255,255,255,0.7);
  outline-offset: 2px;
}

.topic-item::after {
  content: "›";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  opacity: 0.8;
}

.topic-item h3 { margin: 0 0 6px 0; color: #ffffff; font-size: 18px; font-weight: 700; }
.topic-item p { margin: 0; color: rgba(255,255,255,0.9); font-size: 13px; }

/* Colourful gradients per card for better visual grouping */
.topics-grid .topic-item:nth-child(6n+1) {
  background: linear-gradient(135deg, #3b82f6, #1e40af);
}
.topics-grid .topic-item:nth-child(6n+2) {
  background: linear-gradient(135deg, #10b981, #065f46);
}
.topics-grid .topic-item:nth-child(6n+3) {
  background: linear-gradient(135deg, #8b5cf6, #4c1d95);
}
.topics-grid .topic-item:nth-child(6n+4) {
  background: linear-gradient(135deg, #f59e0b, #b45309);
}
.topics-grid .topic-item:nth-child(6n+5) {
  background: linear-gradient(135deg, #ec4899, #9d174d);
}
.topics-grid .topic-item:nth-child(6n+6) {
  background: linear-gradient(135deg, #06b6d4, #0e7490);
}

footer {
  margin-top: 24px;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 640px) {
  header h1 { font-size: 22px; }
  .topics-grid { grid-template-columns: 1fr; gap: 14px; }
  .topic-item { padding: 14px 42px 14px 14px; border-radius: 12px; }
}


