/* ========================================
   Bilgisayar Grafiği - Ders Notları
   Ana Stil Dosyası
   ======================================== */

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

/* ═══════ DARK THEME (default) ═══════ */
:root,
[data-theme="dark"] {
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-card: #16213e;
  --bg-card-hover: #1a2744;
  --text-primary: #e0e0e0;
  --text-secondary: #a0a0b0;
  --text-heading: #ffffff;
  --accent-1: #e94560;
  --accent-2: #0f3460;
  --accent-3: #533483;
  --accent-4: #00d2ff;
  --accent-green: #00e676;
  --accent-yellow: #ffd600;
  --accent-orange: #ff9100;
  --border-color: #2a2a4a;
  --code-bg: #1e1e3a;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --sidebar-bg: #13132b;
  --sidebar-hover: #1e1e40;
  --sidebar-active: rgba(0, 210, 255, 0.12);
  --nav-bg: rgba(15, 15, 26, 0.9);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.3s ease;
}

/* ═══════ LIGHT THEME ═══════ */
[data-theme="light"] {
  --bg-primary: #f5f7fa;
  --bg-secondary: #e8ecf1;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f4f8;
  --text-primary: #2d3748;
  --text-secondary: #5a6578;
  --text-heading: #1a202c;
  --accent-1: #d63851;
  --accent-2: #2b6cb0;
  --accent-3: #6b46c1;
  --accent-4: #0087b3;
  --accent-green: #059669;
  --accent-yellow: #d69e00;
  --accent-orange: #c05621;
  --border-color: #d2d8e0;
  --code-bg: #edf2f7;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --sidebar-bg: #ffffff;
  --sidebar-hover: #edf2f7;
  --sidebar-active: rgba(0, 135, 179, 0.1);
  --nav-bg: rgba(245, 247, 250, 0.92);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

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

/* ═══════ SIDEBAR ═══════ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform var(--transition);
}

.sidebar-header {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.sidebar-header .sidebar-brand {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-4);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.sidebar-header .sidebar-brand span {
  font-size: 1.1rem;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

.sidebar-sections {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.sidebar-sections .sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  padding: 0.25rem 1.25rem 0.5rem;
}

.sidebar-sections a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.sidebar-sections a:hover {
  background: var(--sidebar-hover);
  color: var(--text-heading);
}

.sidebar-sections a.active {
  background: var(--sidebar-active);
  color: var(--accent-4);
  border-left-color: var(--accent-4);
  font-weight: 600;
}

.sidebar-sections a .section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.sidebar-sections a.active .section-num {
  background: var(--accent-4);
  border-color: var(--accent-4);
  color: white;
}

/* Sidebar TOC (on-page headings) */
.sidebar-toc {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0;
}

.sidebar-toc::-webkit-scrollbar {
  width: 4px;
}

.sidebar-toc::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.sidebar-toc .toc-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  padding: 0.25rem 1.25rem 0.5rem;
}

.sidebar-toc a {
  display: block;
  padding: 0.35rem 1.25rem 0.35rem 1.25rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s;
  border-left: 2px solid transparent;
  line-height: 1.4;
}

.sidebar-toc a.toc-h3 {
  padding-left: 2.25rem;
  font-size: 0.78rem;
}

.sidebar-toc a:hover {
  background: var(--sidebar-hover);
  color: var(--text-heading);
}

.sidebar-toc a.active {
  color: var(--accent-4);
  border-left-color: var(--accent-4);
  background: var(--sidebar-active);
}

/* Sidebar footer (theme toggle) */
.sidebar-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.theme-toggle:hover {
  background: var(--bg-card-hover);
}

.theme-toggle .theme-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-toggle .theme-switch {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: var(--border-color);
  position: relative;
  transition: background 0.2s;
}

.theme-toggle .theme-switch::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-heading);
  top: 3px;
  left: 3px;
  transition: transform 0.2s;
}

[data-theme="light"] .theme-toggle .theme-switch {
  background: var(--accent-4);
}

[data-theme="light"] .theme-toggle .theme-switch::after {
  transform: translateX(18px);
}

/* ═══════ MOBILE SIDEBAR TOGGLE ═══════ */
.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 300;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-1);
  color: white;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(233, 69, 96, 0.4);
  transition: all 0.2s;
  align-items: center;
  justify-content: center;
}

.sidebar-toggle:hover {
  transform: scale(1.1);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 150;
}

/* ═══════ MAIN LAYOUT (with sidebar) ═══════ */
.page-wrapper {
  margin-left: 280px;
  min-height: 100vh;
  transition: margin-left var(--transition);
}

/* Typography */
h1, h2, h3, h4 {
  color: var(--text-heading);
  line-height: 1.3;
}

h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

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

a:hover {
  color: var(--accent-1);
}

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

/* Layout */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
}

/* Top Navigation — now inside page-wrapper */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.top-nav .brand {
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent-4);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.top-nav .brand span {
  font-size: 1.2rem;
}

.top-nav .nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.top-nav .nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.top-nav .nav-links a:hover,
.top-nav .nav-links a.active {
  color: var(--text-heading);
  background: var(--bg-card);
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 4rem 2rem;
  background: linear-gradient(135deg, var(--bg-secondary), var(--accent-2), var(--accent-3));
  border-radius: 0 0 2rem 2rem;
  margin-bottom: 3rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero h1 {
  position: relative;
  margin-bottom: 1rem;
}

.hero .subtitle {
  position: relative;
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Week Header */
.week-header {
  padding: 3rem 2rem;
  background: linear-gradient(135deg, var(--bg-secondary), var(--accent-2));
  border-radius: 0 0 2rem 2rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.week-header .week-number {
  display: inline-block;
  background: var(--accent-1);
  color: white;
  padding: 0.3rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.week-header h1 {
  margin-bottom: 0.5rem;
}

.week-header .week-desc {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.1rem;
}

.week-meta {
  display: flex;
  gap: 1.5rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.week-meta .meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: all var(--transition);
}

.card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

/* Info Boxes */
.info-box {
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  border-left: 4px solid;
}

.info-box.tip {
  background: rgba(0, 230, 118, 0.08);
  border-color: var(--accent-green);
}

.info-box.warning {
  background: rgba(255, 145, 0, 0.08);
  border-color: var(--accent-orange);
}

.info-box.note {
  background: rgba(0, 210, 255, 0.08);
  border-color: var(--accent-4);
}

.info-box.think {
  background: rgba(83, 52, 131, 0.15);
  border-color: var(--accent-3);
}

.info-box .info-title {
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-heading);
}

/* Interactive Elements */
.interactive-demo {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1.5rem 0;
}

.interactive-demo .demo-header {
  background: var(--bg-secondary);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.interactive-demo .demo-header .demo-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent-4);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.interactive-demo .demo-body {
  padding: 1.5rem;
}

.interactive-demo canvas {
  display: block;
  margin: 0 auto;
  border-radius: var(--radius-sm);
  cursor: crosshair;
}

/* Sliders & Controls */
.control-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.75rem 0;
  flex-wrap: wrap;
}

.control-group label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  min-width: 100px;
}

.control-group input[type="range"] {
  flex: 1;
  min-width: 150px;
  accent-color: var(--accent-4);
  height: 6px;
}

.control-group input[type="color"] {
  width: 50px;
  height: 35px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: transparent;
}

.control-group .value-display {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  color: var(--accent-4);
  min-width: 60px;
  text-align: right;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all var(--transition);
}

.btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-4);
  color: var(--text-heading);
}

.btn.primary {
  background: var(--accent-1);
  border-color: var(--accent-1);
  color: white;
}

.btn.primary:hover {
  background: #d63851;
}

/* Accordion / Collapsible */
.collapsible {
  margin: 1rem 0;
}

.collapsible-header {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition);
  user-select: none;
}

.collapsible-header:hover {
  background: var(--bg-card-hover);
}

.collapsible-header .arrow {
  transition: transform var(--transition);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.collapsible.open .collapsible-header .arrow {
  transform: rotate(90deg);
}

.collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  background: var(--bg-secondary);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.collapsible.open .collapsible-content {
  max-height: 2000px;
}

.collapsible-content-inner {
  padding: 1.25rem;
}

/* Image containers */
.image-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}

.image-compare .compare-item {
  text-align: center;
}

.image-compare .compare-item canvas,
.image-compare .compare-item img {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.image-compare .compare-item .compare-label {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Quiz */
.quiz-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.quiz-container .quiz-title {
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-yellow);
}

.quiz-option {
  display: block;
  padding: 0.75rem 1rem;
  margin: 0.5rem 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-primary);
}

.quiz-option:hover {
  border-color: var(--accent-4);
  background: var(--bg-card-hover);
}

.quiz-option.correct {
  border-color: var(--accent-green);
  background: rgba(0, 230, 118, 0.1);
}

.quiz-option.wrong {
  border-color: var(--accent-1);
  background: rgba(233, 69, 96, 0.1);
}

.quiz-feedback {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  display: none;
  font-size: 0.9rem;
}

.quiz-feedback.show {
  display: block;
}

/* Resource Cards */
.resource-card {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  align-items: flex-start;
}

.resource-card:hover {
  background: var(--bg-card-hover);
  transform: translateX(4px);
}

.resource-card .resource-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}

.resource-card .resource-info h4 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.resource-card .resource-info p {
  font-size: 0.85rem;
  margin: 0;
  color: var(--text-secondary);
}

.resource-card .resource-tag {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
  background: var(--accent-2);
  color: #ffffff;
  margin-top: 0.3rem;
  font-weight: 600;
}

[data-theme="light"] .resource-card .resource-tag {
  background: #e2e8f0;
  color: #2d3748;
}

.resources-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
}

/* Table of Contents */
.toc {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.toc h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toc ol {
  padding-left: 1.5rem;
}

.toc li {
  margin: 0.5rem 0;
}

.toc a {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.toc a:hover {
  color: var(--accent-4);
}

/* Pixel Grid Display */
.pixel-grid {
  display: inline-grid;
  gap: 1px;
  background: var(--border-color);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1px;
}

.pixel-grid .pixel {
  width: 30px;
  height: 30px;
  background: var(--bg-primary);
  cursor: pointer;
  transition: background 0.1s;
}

.pixel-grid .pixel:hover {
  outline: 2px solid var(--accent-4);
  outline-offset: -2px;
}

/* Navigation between weeks */
.week-nav {
  display: flex;
  justify-content: space-between;
  margin: 3rem 0 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.week-nav a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.week-nav a:hover {
  background: var(--bg-card-hover);
  color: var(--text-heading);
  border-color: var(--accent-4);
}

/* Color swatch */
.color-swatch {
  display: inline-block;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 2px solid var(--border-color);
  vertical-align: middle;
  margin: 0 4px;
}

/* Responsive */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-close {
    display: block;
  }
  .sidebar-toggle {
    display: flex;
  }
  .sidebar.open ~ .sidebar-overlay {
    display: block;
  }
  .page-wrapper {
    margin-left: 0;
  }
}

@media (max-width: 768px) {
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.4rem; }
  .container { padding: 1rem; }
  .card-grid { grid-template-columns: 1fr; }
  .image-compare { grid-template-columns: 1fr; }
  .top-nav { padding: 0.5rem 1rem; flex-wrap: wrap; gap: 0.5rem; }
  .top-nav .nav-links { gap: 0.5rem; }
  .week-meta { flex-direction: column; gap: 0.5rem; }
  .control-group { flex-direction: column; align-items: stretch; }
  .hero { padding: 2.5rem 1rem; }
  .week-header { padding: 2rem 1rem; }
}

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeInUp 0.6s ease forwards;
  opacity: 0;
}

.fade-in:nth-child(2) { animation-delay: 0.1s; }
.fade-in:nth-child(3) { animation-delay: 0.2s; }
.fade-in:nth-child(4) { animation-delay: 0.3s; }

/* Comparison table */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.comparison-table th,
.comparison-table td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  text-align: left;
}

.comparison-table th {
  background: var(--bg-secondary);
  color: var(--text-heading);
  font-weight: 600;
}

.comparison-table td {
  background: var(--bg-card);
  color: var(--text-secondary);
}

.comparison-table tr:hover td {
  background: var(--bg-card-hover);
}

/* Emoji list */
.emoji-list {
  list-style: none;
  padding: 0;
}

.emoji-list li {
  padding: 0.5rem 0;
  padding-left: 2rem;
  position: relative;
  color: var(--text-secondary);
}

.emoji-list li::before {
  position: absolute;
  left: 0;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 2rem;
  margin-top: 3rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Hide old inline TOC when sidebar exists */
.has-sidebar .toc {
  display: none;
}

/* ═══════ CODE BLOCKS ═══════ */
pre {
  background: var(--code-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 1.25rem 0;
  font-size: 0.88rem;
  line-height: 1.7;
  position: relative;
}

code {
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: 0.88em;
}

:not(pre) > code {
  background: var(--code-bg);
  padding: 0.15em 0.45em;
  border-radius: 4px;
  font-size: 0.85em;
  border: 1px solid var(--border-color);
  color: var(--accent-4);
}

pre code {
  background: none;
  padding: 0;
  border: none;
  color: var(--text-primary);
  font-size: inherit;
}

/* Code block wrapper with copy button */
.code-block-wrapper {
  position: relative;
  margin: 1.25rem 0;
}

.code-block-wrapper pre {
  margin: 0;
  padding-right: 3.5rem;
}

.code-copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: all var(--transition);
  z-index: 2;
  opacity: 0;
}

.code-block-wrapper:hover .code-copy-btn {
  opacity: 1;
}

.code-copy-btn:hover {
  background: var(--bg-card-hover);
  color: var(--accent-4);
  border-color: var(--accent-4);
}

.code-copy-btn.copied {
  color: var(--accent-green);
  border-color: var(--accent-green);
  opacity: 1;
}

/* Code block language label */
.code-lang-label {
  position: absolute;
  top: 0.5rem;
  left: 0.75rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  opacity: 0.6;
  pointer-events: none;
}
