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

/* ===== ROOT VARIABLES ===== */
:root {
  --accent-color: #00d4ff;
  --accent-glow: rgba(0, 212, 255, 0.2);
  --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-accent: linear-gradient(135deg, #00d4ff 0%, #0099ff 100%);
  --card-bg: #1a1d29;
  --card-hover-bg: #20233a;
  --text-primary: #e4e6eb;
  --text-secondary: #b0b3b8;
  --border-color: #2d3139;
}

/* ===== GLOBAL STYLES ===== */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: -0.01em;
}

/* Better typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 2rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}

h1 {
  font-size: 2.5rem;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: 2rem;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
}

h3 {
  font-size: 1.5rem;
  color: var(--accent-color);
}

/* Code styling */
code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-weight: 500;
  font-size: 0.9em;
  background: rgba(0, 212, 255, 0.1);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  border: 1px solid rgba(0, 212, 255, 0.2);
}

pre code {
  background: none;
  padding: 0;
  border: none;
}

pre {
  background: var(--card-bg) !important;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  overflow-x: auto;
}

/* Links */
a {
  color: var(--accent-color);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
}

a:hover {
  color: #00e5ff;
  text-decoration: none;
}

/* ===== NAVBAR ===== */
.navbar {
  backdrop-filter: blur(10px);
  background: rgba(26, 29, 41, 0.95) !important;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.3rem;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-link {
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--gradient-accent);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 80%;
}

/* ===== MAIN CONTENT ===== */
#quarto-content {
  max-width: 1200px;
  margin: 0 auto;
}

.quarto-title-block {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 3rem 2rem;
  margin-bottom: 3rem;
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.quarto-title {
  margin-bottom: 1.5rem;
}

/* ===== BLOG LISTING / CARD STYLES ===== */
.quarto-listing {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.quarto-post,
.g-col-1 {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  position: relative;
}

.quarto-post::before,
.g-col-1::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.quarto-post:hover,
.g-col-1:hover {
  transform: translateY(-8px);
  background: var(--card-hover-bg);
  border-color: var(--accent-color);
  box-shadow: 0 12px 40px var(--accent-glow);
}

.quarto-post:hover::before,
.g-col-1:hover::before {
  opacity: 1;
}

.listing-item {
  padding: 2rem;
}

.listing-image {
  width: 100%;
  height: 240px;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.quarto-post:hover .listing-image,
.g-col-1:hover .listing-image {
  transform: scale(1.05);
}

.listing-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 1.5rem 0 1rem;
  color: var(--text-primary);
}

.listing-title a {
  color: var(--text-primary);
  background: linear-gradient(to right, var(--accent-color), var(--accent-color)) 0 100% / 0 2px no-repeat;
  transition: background-size 0.3s ease;
}

.listing-title a:hover {
  background-size: 100% 2px;
  color: var(--accent-color);
}

.listing-subtitle,
.listing-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.listing-date,
.listing-author {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
}

.listing-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.listing-category {
  background: rgba(0, 212, 255, 0.15);
  color: var(--accent-color);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid rgba(0, 212, 255, 0.3);
  transition: all 0.3s ease;
}

.listing-category:hover {
  background: var(--accent-color);
  color: #0a0e1a;
  transform: translateY(-2px);
}

/* ===== SIDEBAR / CATEGORIES ===== */
.quarto-listing-category {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

.quarto-listing-category-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.quarto-listing-category .category {
  padding: 0.5rem 0.75rem;
  margin: 0.3rem 0;
  border-radius: 6px;
  transition: all 0.3s ease;
  display: block;
  color: var(--text-secondary);
}

.quarto-listing-category .category:hover {
  background: rgba(0, 212, 255, 0.1);
  color: var(--accent-color);
  transform: translateX(5px);
}

/* ===== FOOTER ===== */
.nav-footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border-color);
  margin-top: 4rem;
  padding: 2rem 0;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.quarto-post,
.g-col-1 {
  animation: fadeInUp 0.6s ease-out;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .quarto-listing {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2rem;
  }

  .quarto-title-block {
    padding: 2rem 1.5rem;
  }
}

/* ===== TABLE OF CONTENTS ===== */
.sidebar nav[role="doc-toc"] {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
}

#TOC .active {
  color: var(--accent-color);
  border-left: 3px solid var(--accent-color);
  padding-left: 1rem;
}

/* ===== BUTTONS & INTERACTIVE ELEMENTS ===== */
.btn,
button {
  background: var(--gradient-accent);
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn:hover,
button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px var(--accent-glow);
}

/* ===== SEARCH ===== */
#quarto-search {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

/* ===== BLOCKQUOTES ===== */
blockquote {
  border-left: 4px solid var(--accent-color);
  background: rgba(0, 212, 255, 0.05);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 8px 8px 0;
  font-style: italic;
}

/* ===== IMAGES ===== */
img {
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* ===== HORIZONTAL RULE ===== */
hr {
  border: none;
  height: 1px;
  background: var(--gradient-accent);
  margin: 2rem 0;
  opacity: 0.3;
}
