/* ============================================================
   TUTORIALS HUB — style.css
   Same design system as the JS/PHP OOP courses (dark IDE theme),
   extended with a distinct accent color per course.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

/* ── TOKENS ─────────────────────────────────────────────── */
:root {
  --bg:          #0d1117;
  --surface:     #161b22;
  --surface-2:   #1f2937;
  --border:      #30363d;

  --text:        #e6edf3;
  --text-muted:  #8b949e;
  --text-dim:    #484f58;

  --accent-purple: #c084fc;  /* PHP OOP */
  --accent-yellow: #f0db4f;  /* JS OOP */
  --accent-orange: #ff9d5c;  /* GIMP */
  --accent-teal:   #4fd1c5;  /* GIMP CL / Master GIMP */
  --accent-green:  #3fb950;  /* SEO */
  --accent-blue:   #58a6ff;  /* general / links */

  --radius:      8px;
  --radius-lg:   14px;
  --font-mono:   'JetBrains Mono', 'Fira Code', monospace;
  --font-ui:     'Inter', system-ui, sans-serif;
}

/* ── RESET ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
}
a { color: var(--accent-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ── TOPBAR ──────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.topbar-brand {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
}
.topbar-brand span { color: var(--accent-yellow); }
.topbar-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* ── TERMINAL HERO (signature element) ──────────────────── */
.hero {
  padding: 4.5rem 2rem 3rem;
  max-width: 900px;
  margin: 0 auto;
}
.terminal-window {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 0 40px #00000055;
}
.terminal-titlebar {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot-red    { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green  { background: #27c93f; }
.terminal-titlebar-label {
  margin-left: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}
.terminal-body {
  padding: 1.5rem 1.75rem 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
}
.terminal-line {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}
.prompt-user { color: var(--accent-green); }
.prompt-path { color: var(--accent-blue); }
.prompt-sym  { color: var(--text-muted); }
.terminal-cmd { color: var(--text); }
.terminal-output {
  color: var(--text-muted);
  margin: 0.75rem 0 0.25rem;
  padding-left: 0;
}
.hero-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  margin: 1.25rem 0 0.5rem;
  font-family: var(--font-mono);
  color: var(--text);
}
.hero-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 560px;
}

/* ── SECTION SHELL ───────────────────────────────────────── */
.section { padding: 1rem 2rem 4rem; }
.container { max-width: 900px; margin: 0 auto; }
.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 0.5rem;
}
.section-count {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}
.section-title {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ── DIRECTORY LISTING GRID ──────────────────────────────── */
.dir-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.dir-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  position: relative;
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}
.dir-card:hover {
  transform: translateY(-3px);
  text-decoration: none;
}
.dir-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  background: var(--card-accent, var(--accent-blue));
  opacity: 0.85;
}

/* per-course accent, set per card via inline custom property */
.dir-card.c-purple { --card-accent: var(--accent-purple); }
.dir-card.c-yellow { --card-accent: var(--accent-yellow); }
.dir-card.c-orange { --card-accent: var(--accent-orange); }
.dir-card.c-teal    { --card-accent: var(--accent-teal); }
.dir-card.c-green   { --card-accent: var(--accent-green); }

.dir-card.c-purple:hover { border-color: var(--accent-purple); box-shadow: 0 0 24px #c084fc22; }
.dir-card.c-yellow:hover { border-color: var(--accent-yellow); box-shadow: 0 0 24px #f0db4f22; }
.dir-card.c-orange:hover { border-color: var(--accent-orange); box-shadow: 0 0 24px #ff9d5c22; }
.dir-card.c-teal:hover    { border-color: var(--accent-teal);   box-shadow: 0 0 24px #4fd1c522; }
.dir-card.c-green:hover   { border-color: var(--accent-green);  box-shadow: 0 0 24px #3fb95022; }

.dir-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.dir-perms {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  white-space: nowrap;
}
.dir-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 1px 8px;
  border-radius: 4px;
  white-space: nowrap;
  border: 1px solid var(--card-accent, var(--border));
  color: var(--card-accent, var(--text-muted));
}
.dir-card-title {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.dir-card-path {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-bottom: 0.65rem;
}
.dir-card-path::before { content: '$ cd '; color: var(--text-dim); }
.dir-card-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  flex-grow: 1;
}
.dir-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.dir-card-open {
  color: var(--card-accent, var(--accent-blue));
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: gap 0.15s;
}
.dir-card:hover .dir-card-open { gap: 0.55rem; }

/* ── ADD-NEW PLACEHOLDER CARD ────────────────────────────── */
.dir-card-empty {
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  gap: 0.4rem;
}
.dir-card-empty .plus {
  font-size: 1.4rem;
  color: var(--text-dim);
}

/* ── ABOUT / HOW TO ADD ──────────────────────────────────── */
.note-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  font-size: 0.86rem;
  color: var(--text-muted);
}
.note-block h3 {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-yellow);
  margin-bottom: 0.75rem;
}
.note-block code {
  font-family: var(--font-mono);
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--text);
  font-size: 0.82rem;
}
.note-block ol {
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.note-block ol li {
  counter-increment: step;
  padding-left: 1.6rem;
  position: relative;
}
.note-block ol li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-yellow);
  background: var(--surface-2);
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── FOOTER ──────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}
footer a { color: var(--text-dim); }
footer a:hover { color: var(--accent-blue); }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .topbar { padding: 0 1rem; }
  .hero { padding: 2.5rem 1rem 2rem; }
  .section { padding: 1rem 1rem 3rem; }
  .terminal-body { font-size: 0.8rem; padding: 1.25rem 1.25rem 1.5rem; }
  .dir-grid { grid-template-columns: 1fr; }
}

/* ── ACCESSIBILITY ───────────────────────────────────────── */
a:focus-visible, .dir-card:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
