/* ============================================
   RelicTrek — Pure C Style
   Minimal, dark, code-editor inspired theme
   Clean lines. High contrast. Zero bloat.
   ============================================ */

:root {
  --bg: #0a0e14;
  --bg-deep: #06090f;
  --bg-card: #111820;
  --bg-card-border: #1e2730;
  --bg-sidebar: #0d1117;
  --bg-hover: #161b22;
  --accent: #58a6ff;
  --accent-green: #2ea043;
  --accent-warn: #d29922;
  --accent-danger: #f85149;
  --text: #c9d1d9;
  --text-muted: #8b949e;
  --text-dim: #484f58;
  --border: #21262d;
  --top-height: 52px;
  --ticker-height: 32px;
  --sidebar-width: 210px;
  --rightbar-width: 260px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  font-size: 15px;
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }

/* ============================================
   LANGUAGE SWITCHER
   ============================================ */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.lang-switch button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: all 0.2s;
  font-family: inherit;
}
.lang-switch button:hover { border-color: var(--accent); color: var(--accent); }
.lang-switch button.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ============================================
   TOP NAVIGATION
   ============================================ */
.top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--top-height);
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  z-index: 100;
}

.logo {
  font-size: 20px;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: -0.5px;
  flex-shrink: 0;
}
.logo:hover { color: #79c0ff; }

.top-nav input[type="search"] {
  flex: 0 1 320px;
  padding: 7px 14px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.2s;
}
.top-nav input[type="search"]::placeholder { color: var(--text-dim); }
.top-nav input[type="search"]:focus { outline: none; border-color: var(--accent); }

.nav-links {
  display: flex;
  gap: 20px;
  flex-shrink: 0;
  margin-left: auto;
}

.nav-links a {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  letter-spacing: 0.3px;
}
.nav-links a:hover,
.nav-links a.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ============================================
   TICKER (Scrolling Slogan Bar)
   ============================================ */
.ticker-bar {
  position: fixed;
  top: var(--top-height);
  left: 0; right: 0;
  height: var(--ticker-height);
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  z-index: 99;
  display: flex;
  align-items: center;
}

.ticker-track {
  display: flex;
  white-space: nowrap;
  animation: ticker-scroll 40s linear infinite;
  gap: 60px;
}

.ticker-track:hover { animation-play-state: paused; }

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
  padding: 0 10px;
}

.ticker-item .slogan-main-text {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.3px;
}

.ticker-item .slogan-sub-text {
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 11px;
}

.ticker-item .sep {
  color: var(--text-dim);
  font-size: 10px;
  margin: 0 4px;
}

@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============================================
   MAIN LAYOUT
   ============================================ */
.main-layout {
  display: flex;
  margin-top: calc(var(--top-height) + var(--ticker-height));
  min-height: calc(100vh - var(--top-height) - var(--ticker-height));
  position: relative;
  z-index: 1;
}

/* Left Sidebar */
.left-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  position: fixed;
  top: calc(var(--top-height) + var(--ticker-height));
  bottom: 0;
  left: 0;
  overflow-y: auto;
}

.left-sidebar h3 {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-dim);
  padding: 0 18px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.left-sidebar a,
.left-sidebar span {
  display: block;
  padding: 9px 18px;
  font-size: 13px;
  color: var(--text-muted);
  border-left: 2px solid transparent;
  transition: all 0.15s;
  margin-right: 0;
}

.left-sidebar a:hover {
  background: var(--bg-hover);
  color: var(--text);
  border-left-color: var(--accent);
}

.left-sidebar a.active {
  background: var(--bg-hover);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 700;
}

.left-sidebar span.coming-soon {
  color: var(--text-dim);
  cursor: default;
  opacity: 0.5;
}

.left-sidebar span.more {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.quick-nav {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.quick-nav h4 {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  padding: 0 18px 6px;
}

.quick-nav a {
  font-size: 12px;
  padding: 6px 18px;
  color: var(--text-dim);
}

.quick-nav a:hover { color: var(--accent); }

/* Center Content */
.content-area {
  flex: 1;
  margin-left: var(--sidebar-width);
  margin-right: var(--rightbar-width);
  padding: 32px 40px;
  max-width: calc(100vw - var(--sidebar-width) - var(--rightbar-width));
}

/* Right Sidebar */
.right-sidebar {
  width: var(--rightbar-width);
  min-width: var(--rightbar-width);
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border);
  padding: 20px 16px;
  position: fixed;
  top: calc(var(--top-height) + var(--ticker-height));
  bottom: 0;
  right: 0;
  overflow-y: auto;
}

.ad-slot {
  width: 100%;
  min-height: 250px;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 20px;
}

.right-sidebar h4 {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.right-sidebar a {
  display: block;
  padding: 6px 0;
  font-size: 12px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  transition: color 0.15s;
}
.right-sidebar a:hover { color: var(--accent); }

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  margin-left: var(--sidebar-width);
  margin-right: var(--rightbar-width);
  padding: 24px 40px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  background: var(--bg-sidebar);
}

.site-footer a {
  color: var(--text-muted);
  margin: 0 12px;
  transition: color 0.15s;
}
.site-footer a:hover { color: var(--accent); }

/* ============================================
   CARDS & GRID
   ============================================ */

.page-title {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
  color: var(--text);
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 32px;
}

/* Item Card Grid */
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
}

/* Clean Card Style */
.item-card,
.section {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 4px;
  padding: 20px;
  transition: border-color 0.2s, transform 0.2s;
  position: relative;
  overflow: hidden;
}

.item-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.item-card h3 {
  font-size: 17px;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 700;
}

.item-card .difficulty {
  color: var(--accent-warn);
  font-size: 11px;
  margin-bottom: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.item-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Section Block */
.section { margin-bottom: 20px; }

.section h2 {
  font-size: 20px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.section h2 .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 800;
}

/* Item Detail Header */
.item-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}

/* ============================================
   ITEM ICON SYSTEM
   ============================================ */

.item-icon {
  width: 64px;
  height: 64px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  border: 1px solid;
  transition: all 0.2s;
}

.item-icon:hover { transform: scale(1.05); }

/* Icon Color Classes — Pure C style, flat colors */
.item-icon-weapon {
  background: #3d1111;
  border-color: #8b0000;
  color: #ff7b72;
}

.item-icon-accessory {
  background: #0e2a3f;
  border-color: #1f6feb;
  color: #79c0ff;
}

.item-icon-tool {
  background: #0f2b16;
  border-color: #238636;
  color: #56d364;
}

.item-icon-legendary {
  background: #2d1433;
  border-color: #8957e5;
  color: #d2a8ff;
  animation: legendary-pulse 3s ease-in-out infinite;
}
@keyframes legendary-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(137, 87, 229, 0.15); }
  50% { box-shadow: 0 0 0 8px rgba(137, 87, 229, 0); }
}

.item-icon-vehicle {
  background: #0d2f3a;
  border-color: #0077b6;
  color: #48cae4;
}

.item-icon-upgrade {
  background: #2a2200;
  border-color: #8b8000;
  color: #e3d026;
}

.item-icon-tech {
  background: #1a1a2e;
  border-color: #e94560;
  color: #ff6b8a;
}

/* Small icon variant */
.item-icon-sm {
  width: 44px;
  height: 44px;
  font-size: 20px;
  border-radius: 4px;
}

.item-meta h1 {
  font-size: 28px;
  margin-bottom: 8px;
  color: var(--text);
}

.stars {
  color: var(--accent-warn);
  font-size: 15px;
  margin-bottom: 8px;
}

.item-tag {
  display: inline-block;
  padding: 3px 10px;
  background: var(--bg-hover);
  color: var(--text-muted);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--border);
  margin-right: 4px;
}

/* ============================================
   TABLES
   ============================================ */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 12px 0;
}

th {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg-sidebar);
  color: var(--accent);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--accent);
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

tr:hover td { background: var(--bg-hover); }

/* ============================================
   MATERIAL ITEMS
   ============================================ */
.material-item {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.material-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.material-item h4 {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 6px;
  font-weight: 700;
}
.material-item .detail {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.8;
}
.material-item .detail strong { color: var(--text); }

/* ============================================
   GOTCHA TIPS
   ============================================ */
.gotcha-box {
  background: rgba(210, 153, 34, 0.06);
  border: 1px solid rgba(210, 153, 34, 0.25);
  border-radius: 4px;
  padding: 16px 20px;
  margin-bottom: 12px;
}
.gotcha-box .label {
  color: var(--accent-warn);
  font-weight: 800;
  font-size: 12px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.gotcha-box p {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0;
  line-height: 1.7;
}

/* ============================================
   CRAFTING ROUTE
   ============================================ */
.route-tree {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 13px;
  line-height: 2.2;
  background: var(--bg-deep);
  padding: 20px;
  border-radius: 4px;
  overflow-x: auto;
  border: 1px solid var(--border);
}
.route-tree .arrow { color: var(--accent); font-weight: bold; }
.route-tree .station { color: var(--accent-warn); font-style: italic; }
.route-tree .final { color: var(--accent-green); font-weight: bold; font-size: 14px; }
.route-tree .material { color: var(--accent-green); }

/* ============================================
   COMING SOON PAGE
   ============================================ */
.coming-soon-page {
  text-align: center;
  padding: 80px 40px;
}
.coming-soon-page h1 {
  font-size: 42px;
  color: var(--text);
  margin-bottom: 16px;
}
.coming-soon-page p {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.8;
}

/* Section within section */
.section h3 {
  color: var(--text);
  margin: 16px 0 10px;
  font-size: 15px;
  font-weight: 700;
}

/* Breadcrumb */
.breadcrumb {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }

/* Mono text for data */
.mono {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.95em;
}

/* ============================================
   BILINGUAL CONTENT
   ============================================ */
[data-en], [data-zh] { transition: opacity 0.2s; }
body.lang-en [data-zh] { display: none; }
body.lang-zh [data-en] { display: none; }

/* Inline bilingual */
.bilingual .en { }
.bilingual .zh { color: var(--text-dim); font-size: 0.92em; }
body.lang-zh .bilingual .en { display: none; }
body.lang-zh .bilingual .zh { display: inline; color: var(--text); }
body.lang-en .bilingual .zh { display: none; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .right-sidebar { display: none; }
  .content-area { margin-right: 0; }
  .site-footer { margin-right: 0; }
}

@media (max-width: 768px) {
  .left-sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s;
    z-index: 98;
  }
  .left-sidebar.open { transform: translateX(0); }
  .content-area { margin-left: 0; padding: 16px; }
  .site-footer { margin-left: 0; }
  .menu-toggle { display: block; }
  .ticker-bar { display: none; }
  .nav-links { display: none; }
  .lang-switch { display: none; }
  .top-nav input[type="search"] {
    flex: 1;
    margin: 0 6px;
  }
  .item-grid { grid-template-columns: 1fr; }
  .page-title { font-size: 24px; }
  .main-layout {
    margin-top: var(--top-height);
  }
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}
.menu-toggle:hover { color: var(--accent); }
