@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500&display=swap');

:root {
  /* Premium Dark Mode Variables */
  --bg-base: #0f1115;
  --bg-surface: rgba(25, 28, 35, 0.6);
  --bg-surface-hover: rgba(35, 38, 45, 0.8);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-primary: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.5);
  --accent-secondary: #8b5cf6;

  --border-light: rgba(255, 255, 255, 0.08);
  --glass-border: 1px solid var(--border-light);

  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px var(--accent-glow);

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Base elements */
a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  text-decoration: none;
  filter: brightness(1.2);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Glassmorphism Classes */
.glass-panel {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glass);
}

.glass-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 17, 21, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: var(--glass-border);
  padding: 1rem 0;
}

/* Navigation */
.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.nav-link {
  color: var(--text-secondary);
  font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-size: 1rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: var(--glass-border);
}

.btn-ghost:hover {
  background: var(--bg-surface-hover);
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 100;
}

.toast {
  padding: 1rem 1.5rem;
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
  border: var(--glass-border);
  border-left: 4px solid var(--accent-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  box-shadow: var(--shadow-glass);
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Markdown Content Styling */
.content-prose {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.content-prose p {
  margin-bottom: 1.5rem;
}

.content-prose h1,
.content-prose h2,
.content-prose h3 {
  color: var(--text-primary);
  margin-top: 2rem;
}

.content-prose a {
  text-decoration: underline;
  text-decoration-color: var(--border-light);
  text-underline-offset: 4px;
}

.content-prose a:hover {
  text-decoration-color: var(--accent-primary);
}

.content-prose pre {
  background: #0d0d0d !important;
  border: var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  overflow-x: auto;
  margin: 2rem 0;
}

.content-prose code {
  font-family: 'Fira Code', monospace;
  font-size: 0.9rem;
}

.content-prose blockquote {
  border-left: 4px solid var(--accent-primary);
  padding-left: 1rem;
  color: var(--text-muted);
  font-style: italic;
  background: rgba(255, 255, 255, 0.02);
  padding: 1rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* Utilities */
.text-gradient {
  background: linear-gradient(135deg, #f8fafc, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-accent-gradient {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-4 {
  margin-top: 1rem;
}

.mt-8 {
  margin-top: 2rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

/* Main layout wrapper */
main {
  flex: 1;
}

/* HTMX Progress Bar */
.htmx-indicator {
  opacity: 0;
  transition: opacity 200ms ease-in;
}

.htmx-request .htmx-indicator {
  opacity: 1
}

.htmx-request.htmx-indicator {
  opacity: 1
}

#nprogress .bar {
  background: var(--accent-primary) !important;
  height: 3px !important;
}

#nprogress .peg {
  box-shadow: 0 0 10px var(--accent-primary), 0 0 5px var(--accent-primary) !important;
}

/* Responsive */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }
}