@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #4f46e5; /* Modern Indigo */
  --primary-hover: #4338ca;
  --bg-main: #f8fafc; /* Very light slate/blueish white */
  --bg-card: #ffffff;
  --text-heading: #0f172a; /* Dark slate for headings */
  --text-body: #475569; /* Softer slate for body */
  --accent: #f59e0b; /* Amber */
  --border-color: #e2e8f0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.02em;
}

/* Navbar (Glassmorphism Effect) */
.navbar {
  background-color: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03) !important;
  border-bottom: 1px solid var(--border-color);
}
.navbar-brand {
  color: var(--text-heading) !important;
  font-weight: 800 !important;
  letter-spacing: -0.5px;
}
.nav-link {
  color: var(--text-body) !important;
  font-weight: 600;
  transition: color 0.2s ease;
}
.nav-link:hover, .nav-link.active {
  color: var(--primary) !important;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid #bae6fd;
}
.hero-section::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: url('https://www.transparenttextures.com/patterns/cubes.png') opacity(0.03);
  pointer-events: none;
}

/* Post Cards */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border-color: #cbd5e1;
}
.card-img-top {
  height: 220px;
  object-fit: cover;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  border-bottom: 1px solid var(--border-color);
  transition: transform 0.5s ease;
}
.card:hover .card-img-top {
  transform: scale(1.03);
}
.card-title a {
  color: var(--text-heading);
  transition: color 0.2s ease;
}
.card-title a:hover {
  color: var(--primary);
}

/* Buttons */
.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 4px 14px 0 rgba(79, 70, 229, 0.39);
  transition: all 0.3s ease;
}
.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.23);
  transform: translateY(-2px);
}
.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
  border-width: 2px;
  transition: all 0.3s ease;
}
.btn-outline-primary:hover {
  background-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px 0 rgba(79, 70, 229, 0.39);
}

/* Article Content (Optimized for AI Output & AdSense) */
.article-content {
  font-size: 1.15rem;
  color: #334155;
}
.article-content p {
  margin-bottom: 1.5rem;
}
.article-content h2 {
  margin-top: 3.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
  color: var(--text-heading);
  font-size: 1.8rem;
}
.article-content h3 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: #1e293b;
  font-size: 1.5rem;
}
.article-content img {
  border-radius: 16px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  margin: 2.5rem 0;
  max-width: 100%;
  height: auto;
  display: block;
}
.article-content ul, .article-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}
.article-content li {
  margin-bottom: 0.5rem;
}
.article-content blockquote {
  border-left: 4px solid var(--primary);
  background-color: #f1f5f9;
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: #475569;
}
.article-content table {
  width: 100%;
  margin-bottom: 2rem;
  border-collapse: collapse;
}
.article-content table th, .article-content table td {
  border: 1px solid var(--border-color);
  padding: 12px;
  text-align: left;
}
.article-content table th {
  background-color: #f8fafc;
  font-weight: 600;
  color: var(--text-heading);
}

/* Footer & Utilities */
footer {
  background-color: #ffffff !important;
  border-top: 1px solid var(--border-color);
  color: var(--text-body) !important;
}
footer h4, footer h5 {
  color: var(--text-heading) !important;
}
footer p, footer small {
  color: var(--text-body) !important;
}
footer a {
  color: var(--text-body) !important;
  transition: all 0.2s;
}
.hover-primary:hover, footer a:hover {
  color: var(--primary) !important;
  text-decoration: underline !important;
}
footer .border-secondary {
  border-color: var(--border-color) !important;
}

/* Badges */
.badge {
  font-weight: 600;
  letter-spacing: 0.5px;
}
.badge.bg-warning {
  background-color: var(--accent) !important;
  color: #fff !important;
}

/* See More / Fade-in Animation */
.post-card-item {
  animation: fadeIn 0.6s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive / Mobile Optimization */
@media (max-width: 768px) {
  .hero-section {
    text-align: center;
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
  }
  .display-3 {
    font-size: 2.5rem;
  }
  .display-4 {
    font-size: 2rem;
  }
  .article-content {
    font-size: 1.05rem;
  }
}