/* Boge's Tech Log Mainstream Refined Styles */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg-main: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.92);
  --border-card: rgba(226, 232, 240, 0.9);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --accent-cyan: #0891b2;
}

html.dark {
  --bg-main: #020617;
  --bg-card: rgba(15, 23, 42, 0.82);
  --border-card: rgba(51, 65, 85, 0.6);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-cyan: #22d3ee;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
html.dark ::-webkit-scrollbar-thumb {
  background: #334155;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

/* Background Grid Pattern */
.bg-grid-pattern {
  background-size: 24px 24px;
  background-image: 
    linear-gradient(to right, rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
}
html.dark .bg-grid-pattern {
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

/* Refined Glassmorphic Card Styling */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-card);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  border-color: rgba(8, 145, 178, 0.45);
  box-shadow: 0 12px 30px -5px rgba(8, 145, 178, 0.15);
}

/* --- VS Code / GitHub Code Container Styling --- */
.code-container {
  margin: 1.5rem 0;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid #30363d;
  background-color: #0d1117;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background-color: #161b22;
  border-b: 1px solid #30363d;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #8b949e;
}

.code-lang-tag {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: #58a6ff;
  text-transform: uppercase;
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 0.375rem;
  background-color: #21262d;
  color: #c9d1d9;
  font-size: 0.7rem;
  border: 1px solid #363b42;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background-color: #30363d;
  color: #58a6ff;
  border-color: #58a6ff;
}

.code-wrapper {
  display: flex;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.65;
  color: #c9d1d9;
  padding: 1rem 0;
}

.line-numbers {
  padding: 0 1rem 0 1rem;
  color: #484f58;
  text-align: right;
  user-select: none;
  border-r: 1px solid #21262d;
  font-size: 0.8rem;
}

.code-content {
  padding: 0 1.25rem;
  flex: 1;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  tab-size: 4;
}

/* Callout Alert Boxes (GitHub Spec) */
.callout {
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  margin: 1.25rem 0;
  font-size: 0.875rem;
  line-height: 1.6;
}

.callout-note {
  background-color: rgba(8, 145, 178, 0.08);
  border: 1px solid rgba(8, 145, 178, 0.3);
  color: #0e7490;
}
html.dark .callout-note {
  background-color: rgba(8, 145, 178, 0.15);
  color: #67e8f9;
}

.callout-tip {
  background-color: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #047857;
}
html.dark .callout-tip {
  background-color: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}

/* Top Progress Bar */
#readingProgressBar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(to right, #0891b2, #3b82f6);
  z-index: 50;
  width: 0%;
  transition: width 0.1s ease;
}

/* Loading Spinner */
.spinner {
  border: 3px solid rgba(8, 145, 178, 0.1);
  border-left-color: #0891b2;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* --- Refined GitHub-Style Pagination Widget with Ellipsis --- */
.github-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.375rem;
  padding: 1.5rem 0 0.5rem 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.85rem;
}

.pagination-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.6rem;
  border-radius: 0.5rem;
  font-weight: 600;
  color: var(--text-main);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.pagination-item:hover:not(.disabled):not(.active) {
  border-color: #0891b2;
  color: #0891b2;
}

.pagination-item.active {
  background-color: #0891b2;
  color: #ffffff;
  border-color: #0891b2;
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3);
}

.pagination-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--text-muted);
  user-select: none;
}
