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

:root {
  /* MacAuthority Indigo Theme */
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  --primary-200: #c7d2fe;
  --primary-300: #a5b4fc;
  --primary-400: #818cf8;
  --primary-500: #6366f1;
  --primary-600: #4f46e5;
  --primary-700: #4338ca;
  --primary-800: #3730a3;
  --primary-900: #312e81;
  
  --gradient-primary: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-600) 50%, var(--primary-500) 100%);
  --gradient-hero: linear-gradient(135deg, var(--primary-900) 0%, var(--primary-700) 25%, var(--primary-600) 50%, var(--primary-500) 75%, var(--primary-600) 100%);
  
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-hover: #eef2ff;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --text-muted: #cbd5e1;
  
  --border-light: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-dark: #94a3b8;
  
  --shadow-sm: 0 1px 2px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-primary: 0 4px 14px 0 rgba(67, 56, 202, 0.2);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

::selection {
  background: rgba(67, 56, 202, 0.15);
  color: var(--text-primary);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary-500), var(--primary-400));
  border-radius: 5px;
  border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--primary-600), var(--primary-500));
}

.progress-bar {
  position: sticky;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--gradient-primary);
  z-index: 1001;
  transition: width var(--transition-fast);
  box-shadow: var(--shadow-primary);
}

.header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(67, 56, 202, 0.1);
  transition: all var(--transition-normal);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.logo {
  font-family: 'Inter', sans-serif;
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--primary-700);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  white-space: nowrap;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--gradient-primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  font-weight: 800;
  box-shadow: var(--shadow-primary);
}

nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.nav-links a:hover {
  color: var(--primary-700);
  background: var(--primary-50);
}

.nav-links a.active {
  color: var(--primary-700);
  background: var(--primary-100);
  font-weight: 600;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  padding: 0.5rem 0.875rem 0.5rem 2.25rem;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  width: 180px;
  transition: all var(--transition-fast);
}

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

.search-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--text-tertiary);
}

.hero-section {
  padding: 6rem 2rem;
  background: var(--gradient-hero);
  background-size: 400% 400%;
  animation: gradientShift 12s ease infinite;
  text-align: center;
  color: white;
  clip-path: ellipse(150% 100% at 50% 0%);
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  letter-spacing: -0.03em;
}

.hero-subtitle {
  font-size: 1.25rem;
  max-width: 700px;
  margin: 0 auto 3rem;
  opacity: 0.9;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.main-content {
  display: grid;
  grid-template-columns: 340px 1fr; /* Flipped: Sidebar on Left */
  gap: 3rem;
  align-items: start;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.widget {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
}

.widget-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
  border-left: 4px solid var(--primary-500);
  padding-left: 0.75rem;
}

.category-list, .popular-posts {
  list-style: none;
}

.category-list li, .popular-posts li {
  margin-bottom: 0.75rem;
}

.category-list a, .popular-posts a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  transition: color var(--transition-fast);
}

.category-list a:hover, .popular-posts a:hover {
  color: var(--primary-600);
}

.articles-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.article-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  padding: 2rem;
  transition: all var(--transition-normal);
  text-decoration: none;
  display: block;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-200);
}

.article-category {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--primary-50);
  color: var(--primary-700);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
}

.article-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
  line-height: 1.3;
}

.article-excerpt {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 1.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

/* Article Content Styles */
.article-body {
  font-size: 1.125rem;
  color: var(--text-primary);
  max-width: 800px;
  margin: 0 auto;
}

.article-body h2 {
  font-size: 2rem;
  margin: 2.5rem 0 1.25rem;
  font-weight: 700;
}

.article-body h3 {
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
  font-weight: 600;
}

.article-body p {
  margin-bottom: 1.5rem;
}

.article-body ul, .article-body ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

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

.article-body blockquote {
  border-left: 4px solid var(--primary-500);
  background: var(--bg-secondary);
  padding: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  border-radius: 0 8px 8px 0;
}

.article-body pre {
  background: #1e293b;
  color: #f8fafc;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 2rem 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9375rem;
}

.article-body code {
  background: var(--bg-tertiary);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
}

.footer {
  background: var(--text-primary);
  color: white;
  padding: 4rem 2rem 2rem;
  margin-top: 5rem;
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 4rem;
  margin-bottom: 3rem;
}

.footer-section h3 {
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
}

.footer-section p {
  opacity: 0.7;
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin-bottom: 0.75rem;
}

.footer-section a {
  color: white;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.footer-section a:hover {
  opacity: 1;
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 0.875rem;
  opacity: 0.6;
}

@media (max-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr;
  }
  .sidebar {
    order: 2;
  }
  .articles-section {
    order: 1;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
  .header-container {
    padding: 0.75rem 1rem;
  }
  .nav-links {
    display: none;
  }
}
