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

:root {
  --primary: hsl(221, 83%, 53%);
  --primary-glow: hsla(221, 83%, 53%, 0.3);
  --secondary: hsl(221, 100%, 96%);
  --background: hsl(222, 47%, 11%);
  --surface: hsl(222, 47%, 14%);
  --surface-lighter: hsl(222, 47%, 18%);
  --text-main: hsl(210, 40%, 98%);
  --text-muted: hsl(215, 20%, 65%);
  --border: hsla(217, 32%, 20%, 0.8);
  --accent: hsl(199, 89%, 48%);
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 4px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--background);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  color: #fff;
  font-weight: 700;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--background);
}

::-webkit-scrollbar-thumb {
  background: var(--surface-lighter);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.text-center { text-align: center; }
.hide { display: none !important; }
.gradient-text {
    background: linear-gradient(to right, #fff, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

.glass {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  display: block; /* If anchor */
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 10px 30px -10px var(--primary-glow);
}

.layout {
  display: flex;
  padding-top: 4rem; /* For navbar height */
  min-height: 100vh;
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4rem;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 50;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
}

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

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: #fff;
  font-family: 'Outfit', sans-serif;
}

.logo-icon {
  background: var(--primary);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
}

.nav-link {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-left: 1.5rem;
}

.nav-link:hover {
  color: #fff;
}

.search-container {
  flex: 1;
  max-width: 500px;
  margin: 0 2rem;
  position: relative;
}

.search-input {
  width: 100%;
  background: var(--surface-lighter);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  color: #fff;
  font-size: 0.9rem;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-results {
    position: absolute;
    top: 100%;
    margin-top: 0.5rem;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    z-index: 60;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    display: block;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--surface-lighter);
    margin-bottom: 0.5rem;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: var(--border);
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 2rem 1rem;
  overflow-y: auto;
  position: sticky;
  top: 4rem;
  height: calc(100vh - 4rem);
}

.sidebar-section {
  margin-bottom: 2rem;
}

.sidebar-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  padding-left: 0.75rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.sidebar-link:hover, .sidebar-link.active {
  background: var(--surface-lighter);
  color: var(--primary);
}

.sidebar-link.active {
    background: rgba(59, 130, 246, 0.1);
    font-weight: 500;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 2.5rem;
  max-width: 900px;
  margin: 0 auto;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--primary);
}

/* Article */
.article-header {
  margin-bottom: 2rem;
}

.article-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.article-content {
  color: var(--text-muted);
  line-height: 1.7;
}

.article-content h2 {
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: #fff;
}

.article-content h3 {
  font-size: 1.25rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--primary);
}

.article-content p {
  margin-bottom: 1rem;
}

.article-content ul, .article-content ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

.code-block {
  background: #0d1117;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin: 1.5rem 0;
  font-family: monospace;
  color: var(--accent);
  position: relative;
}

/* Home Grid */
.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.category-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-lighter);
  border-radius: 12px;
  margin-bottom: 1rem;
  color: var(--primary);
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
}
