/* ===== Design System — Java Roadmap ===== */
/* Minimalist, typography-first, focus-oriented */

:root {
  --bg: #0c0c0c;
  --surface: #151515;
  --surface-hover: #1a1a1a;
  --border: #232323;
  --border-accent: #2a2a2a;
  --text: #e8e8e8;
  --text-secondary: #a0a0a0;
  --text-muted: #5c5c5c;
  --accent: #c9963a;
  --accent-soft: rgba(201, 150, 58, 0.1);
  --important: #3ec97a;
  --tricky: #e5a431;
  --hard: #e05252;
  --radius: 8px;
  --header-h: 52px;
  --max-w: 700px;
  --font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

[data-theme="light"] {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --surface-hover: #f0efec;
  --border: #e2e0db;
  --border-accent: #d6d4cf;
  --text: #1a1a1a;
  --text-secondary: #555555;
  --text-muted: #8a8a8a;
  --accent: #a67a2e;
  --accent-soft: rgba(166, 122, 46, 0.07);
  --important: #1a9f50;
  --tricky: #c48a1a;
  --hard: #c93c3c;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 32px);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  transition: background 0.35s ease, color 0.35s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--accent);
  color: #0c0c0c;
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(12, 12, 12, 0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

[data-theme="light"] .site-header {
  background: rgba(247, 246, 243, 0.85);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

.site-title {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  user-select: none;
}

.site-title a {
  color: inherit;
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ===== Search ===== */
.search-input {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.8rem;
  width: 180px;
  transition: border-color 0.2s ease, width 0.3s ease, background 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  width: 240px;
  background: var(--surface);
}

.search-input::placeholder {
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* ===== Theme Toggle ===== */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.8rem;
  transition: border-color 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--text-secondary);
  color: var(--text);
}

/* ===== Main Content ===== */
main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem 8rem;
}

/* ===== Hero ===== */
.hero {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3.5rem;
  opacity: 1;
  transform: none;
}

.hero-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.hero h2 {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -0.025em;
  color: var(--text);
}

.hero-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.75;
  max-width: 580px;
}

.study-tip {
  margin-top: 2rem;
  padding: 0.9rem 1.15rem;
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
  border-radius: 0 6px 6px 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.legend {
  display: flex;
  gap: 1.5rem;
  margin-top: 1.75rem;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-dot.green { background: var(--important); }
.legend-dot.amber { background: var(--tricky); }
.legend-dot.red { background: var(--hard); }

/* ===== Topic Sections ===== */
.topic-section {
  margin-bottom: 3.5rem;
  scroll-margin-top: calc(var(--header-h) + 24px);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.topic-section.visible {
  opacity: 1;
  transform: translateY(0);
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.section-num {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.section-header h2 {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* ===== Topic Cards ===== */
.topic-card {
  margin-bottom: 1.5rem;
}

.topic-card h3 {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  padding-left: 0.1rem;
}

.topic-card ul {
  list-style: none;
}

.topic-card li {
  position: relative;
  padding: 0.38rem 0.5rem 0.38rem 1rem;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.55;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.topic-card li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.85em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--border-accent);
  transition: background 0.15s ease;
}

.topic-card li:hover {
  background: var(--surface);
}

.topic-card li:hover::before {
  background: var(--text-muted);
}

/* Difficulty indicators */
.topic-card li[data-level="important"]::before {
  background: var(--important);
  width: 5px;
  height: 5px;
  box-shadow: 0 0 4px rgba(62, 201, 122, 0.3);
}

.topic-card li[data-level="tricky"]::before {
  background: var(--tricky);
  width: 5px;
  height: 5px;
  box-shadow: 0 0 4px rgba(229, 164, 49, 0.3);
}

.topic-card li[data-level="hard"]::before {
  background: var(--hard);
  width: 5px;
  height: 5px;
  box-shadow: 0 0 4px rgba(224, 82, 82, 0.3);
}

/* ===== Search States ===== */
.search-hidden {
  display: none !important;
}

.search-highlight {
  background: rgba(201, 150, 58, 0.3);
  border-radius: 2px;
  padding: 0 2px;
}

.no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  display: none;
}

.no-results.show {
  display: block;
}

/* ===== Closing Section ===== */
.closing {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}

.closing h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.closing ul {
  list-style: none;
}

.closing li {
  position: relative;
  padding: 0.3rem 0 0.3rem 1.2rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.closing li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.8rem;
}

.closing .footnote {
  margin-top: 1.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.65;
}

/* ===== Footer ===== */
.site-footer {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.site-footer p {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  :root {
    --max-w: 100%;
  }

  .hero {
    padding: 2.5rem 0 2rem;
  }

  .hero h2 {
    font-size: 1.45rem;
  }

  .hero-description {
    font-size: 0.88rem;
  }

  main {
    padding: 0 1rem 5rem;
  }

  .header-inner {
    padding: 0 1rem;
  }

  .search-input {
    width: 130px;
    font-size: 0.78rem;
  }

  .search-input:focus {
    width: 170px;
  }

  .site-title {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
  }

  .section-header h2 {
    font-size: 1.05rem;
  }

  .topic-card li {
    font-size: 0.84rem;
  }

  .legend {
    gap: 1rem;
  }

  .topic-section {
    margin-bottom: 2.5rem;
  }
}

/* ===== Category Tabs ===== */
.category-tabs-container {
  position: sticky;
  top: var(--header-h);
  z-index: 99;
  background: rgba(12, 12, 12, 0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0.75rem 0;
}

[data-theme="light"] .category-tabs-container {
  background: rgba(247, 246, 243, 0.85);
}

.category-tabs {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.category-tabs::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.category-tab {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.4rem 1rem;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.category-tab:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.category-tab.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* Hide categories visually */
.category-hidden {
  display: none !important;
}

/* ===== Print ===== */
@media print {
  .site-header {
    display: none;
  }

  .topic-section {
    opacity: 1 !important;
    transform: none !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  main {
    max-width: 100%;
    padding: 0;
  }

  .hero {
    padding: 1rem 0;
  }

  body {
    background: #fff;
    color: #000;
  }

  .topic-card li:hover {
    background: none;
  }
}
