/* Modern Minimalist Blog Platform - Hashnode Inspired */

:root {
  --primary-color: #2962ff;
  --primary-hover: #1e4ed8;
  --text-primary: #0d0d0d;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --border-color: #e5e7eb;
  --border-radius: 12px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --transition: all 0.15s ease-in-out;
}

[data-theme="dark"] {
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --text-primary: #f9fafb;
  --text-secondary: #d1d5db;
  --text-muted: #d1d5db;
  --bg-primary: #111827;
  --bg-secondary: #0f172a;
  --bg-tertiary: #1e293b;
  --border-color: #374151;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

/* Flickering Grid Background - Shadcn Inspired */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(to right, rgba(0, 0, 0, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: 0 0, 0 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
  transition: opacity 0.15s ease-in-out;
}

[data-theme="dark"] body::before {
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  opacity: 0.3;
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 1px 1px, rgba(0, 0, 0, 0.15) 1px, transparent 0);
  background-size: 20px 20px;
  background-position: 0 0;
  pointer-events: none;
  z-index: 0;
  animation: flicker 4s ease-in-out infinite;
  transition: opacity 0.15s ease-in-out;
}

[data-theme="dark"] body::after {
  background-image: 
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.1) 1px, transparent 0);
}

@keyframes flicker {
  0%, 100% {
    opacity: 0;
  }
  5% {
    opacity: 0.5;
  }
  10% {
    opacity: 0;
  }
  15% {
    opacity: 0.3;
  }
  20% {
    opacity: 0;
  }
  25% {
    opacity: 0.8;
  }
  30% {
    opacity: 0;
  }
  35% {
    opacity: 0.4;
  }
  40% {
    opacity: 0;
  }
  45% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
  55% {
    opacity: 0.7;
  }
  60% {
    opacity: 0;
  }
  65% {
    opacity: 0.5;
  }
  70% {
    opacity: 0;
  }
  75% {
    opacity: 0.3;
  }
  80% {
    opacity: 0;
  }
  85% {
    opacity: 0.4;
  }
  90% {
    opacity: 0;
  }
  95% {
    opacity: 0.2;
  }
}

/* Ensure content is above the background */
body > * {
  position: relative;
  z-index: 1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
  font-weight: 800;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

/* Navigation - Modern Hashnode Style */
.navbar-modern-wrapper {
  position: sticky;
  top: 0;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: center;
  z-index: 1000;
  background-color: transparent;
  transition: padding 0.2s ease-in-out;
}

.navbar-modern-container {
  width: 100%;
  background-color: var(--bg-primary);
  border-radius: 24px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  padding: 1.25rem 2rem;
  transition: background-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

[data-theme="dark"] .navbar-modern-container {
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
}

.navbar-modern-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.5rem;
}

/* Logo */
.navbar-brand-modern {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  transition: opacity 0.2s ease-in-out;
  flex-shrink: 0;
}

.navbar-brand-modern:hover {
  opacity: 0.8;
  color: var(--text-primary);
}

.logo-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.logo-text {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

/* Navigation Links */
.navbar-nav-modern {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 0;
  justify-content: flex-end;
  margin-left: auto;
}

.nav-item-modern {
  position: relative;
}

.nav-link-modern {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.625rem 1.25rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  border-radius: 8px;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out;
  white-space: nowrap;
}

.nav-link-modern:hover {
  color: var(--text-primary);
  background-color: var(--bg-secondary);
}

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

/* Dropdown */
.dropdown-modern {
  position: relative;
}

.dropdown-toggle-modern,
.dropdown-toggle.dropdown-toggle-modern {
  cursor: pointer;
  user-select: none;
}

/* Hide Bootstrap's default dropdown arrow */
.dropdown-toggle-modern::after,
.dropdown-toggle.dropdown-toggle-modern::after {
  display: none !important;
}

.dropdown-toggle-modern:hover,
.dropdown-toggle.dropdown-toggle-modern:hover {
  background-color: var(--bg-secondary);
}

.chevron-icon {
  width: 12px;
  height: 12px;
  color: var(--text-secondary);
  transition: transform 0.2s ease-in-out, color 0.15s ease-in-out;
}

.dropdown-toggle-modern:hover .chevron-icon {
  color: var(--text-primary);
}

.dropdown-toggle-modern[aria-expanded="true"] .chevron-icon {
  transform: rotate(180deg);
}

.avatar-small {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.dropdown-menu-modern,
.dropdown-menu.dropdown-menu-modern {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  padding: 0.5rem;
  min-width: 160px;
  list-style: none;
  margin: 0;
  z-index: 1000;
  display: none;
  transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.dropdown-menu-modern.show,
.dropdown-menu.dropdown-menu-modern.show {
  display: block !important;
}

[data-theme="dark"] .dropdown-menu-modern {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
}

.dropdown-item-modern,
.dropdown-item.dropdown-item-modern {
  display: block;
  padding: 0.625rem 1rem;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: 8px;
  transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

.dropdown-item-modern:hover,
.dropdown-item.dropdown-item-modern:hover {
  background-color: var(--bg-secondary);
  color: var(--primary-color);
}

.dropdown-item-modern:active,
.dropdown-item.dropdown-item-modern:active {
  background-color: var(--bg-tertiary);
}

/* Logout Button Styling */
.dropdown-item-logout {
  background-color: transparent;
  color: #dc2626;
  font-weight: 600;
  border: 1px solid transparent;
  text-align: center;
  margin-top: 0.25rem;
}

.dropdown-item-logout:hover {
  background-color: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

[data-theme="dark"] .dropdown-item-logout {
  color: #f87171;
}

[data-theme="dark"] .dropdown-item-logout:hover {
  background-color: #7f1d1d;
  color: #fca5a5;
  border-color: #991b1b;
}

/* Sign In Button */
.btn-signin {
  background-color: var(--bg-primary) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
  padding: 0.625rem 1.25rem !important;
  border-radius: 8px;
  font-weight: 500;
  font-size: 1rem;
  transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, color 0.15s ease-in-out;
  display: inline-flex !important;
  align-items: center;
  text-decoration: none;
}

.btn-signin:hover {
  background-color: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

/* Create Account Button */
.btn-create-account {
  background-color: var(--primary-color) !important;
  border: none !important;
  color: white !important;
  padding: 0.625rem 1.25rem !important;
  border-radius: 8px;
  font-weight: 500;
  font-size: 1rem;
  transition: background-color 0.15s ease-in-out, transform 0.15s ease-in-out;
  display: inline-flex !important;
  align-items: center;
  text-decoration: none;
}

.btn-create-account:hover {
  background-color: var(--primary-hover) !important;
  color: white !important;
  transform: translateY(-1px);
}

/* Theme Toggle */
.theme-toggle-modern {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-primary);
  padding: 0;
  flex-shrink: 0;
  visibility: visible !important;
}

.theme-toggle-modern:hover {
  background-color: var(--bg-secondary);
  border-color: var(--border-color);
}

.theme-toggle-modern svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease-in-out;
}

.theme-toggle-modern .sun-icon {
  display: block;
}

.theme-toggle-modern .moon-icon {
  display: none;
}

[data-theme="dark"] .theme-toggle-modern .sun-icon {
  display: none;
}

[data-theme="dark"] .theme-toggle-modern .moon-icon {
  display: block;
}

/* Mobile Toggle Button */
.navbar-toggler-modern {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: transparent;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  justify-content: center;
  align-items: center;
}

.navbar-toggler-modern span {
  width: 20px;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease-in-out;
}

/* Bootstrap Collapse Integration */
.navbar-collapse {
  flex-grow: 0;
}

@media (min-width: 992px) {
  .navbar-collapse {
    display: flex !important;
    height: auto !important;
    visibility: visible !important;
  }
  
  .navbar-collapse.collapse {
    display: flex !important;
    height: auto !important;
    visibility: visible !important;
  }
  
  .navbar-collapse.collapsing {
    display: flex !important;
    height: auto !important;
    visibility: visible !important;
  }
}

/* Responsive */
@media (max-width: 991px) {
  .navbar-modern-wrapper {
    padding: 1rem 1rem;
  }
  
  .navbar-toggler-modern {
    display: flex;
  }
  
  .navbar-modern-content {
    position: relative;
  }
  
  .navbar-collapse {
    position: absolute;
    top: calc(100% + 1rem);
    left: 0;
    right: 0;
    z-index: 1000;
  }
  
  .navbar-nav-modern {
    flex-direction: column;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 1rem;
    gap: 0.5rem;
    align-items: stretch;
  }
  
  .nav-link-modern {
    width: 100%;
    justify-content: flex-start;
  }
  
  .dropdown-menu-modern {
    position: static;
    box-shadow: none;
    border: none;
    background-color: var(--bg-secondary);
    margin-top: 0.5rem;
    width: 100%;
  }
  
  .theme-toggle-modern {
    width: 100%;
    justify-content: flex-start;
    height: auto;
    padding: 0.5rem 1rem;
  }
}

@media (max-width: 768px) {
  .navbar-modern-container {
    padding: 0.75rem 1rem;
  }
  
  .navbar-modern-wrapper {
    padding: 1rem 0.75rem;
  }
  
  .logo-text {
    font-size: 1.125rem;
  }
  
  .logo-icon {
    width: 24px;
    height: 24px;
  }
}

/* Buttons */
.btn-modern {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.btn-modern:hover {
  background-color: var(--primary-hover);
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-modern-outline {
  background-color: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.btn-modern-outline:hover {
  background-color: var(--primary-color);
  color: white;
}

/* Dark Mode Toggle Button */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-primary);
  padding: 0;
  margin-left: 0.5rem;
}

.theme-toggle:hover {
  background-color: var(--bg-tertiary);
  border-color: var(--primary-color);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease-in-out;
}

.theme-toggle .sun-icon {
  display: block;
}

.theme-toggle .moon-icon {
  display: none;
}

[data-theme="dark"] .theme-toggle .sun-icon {
  display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
  display: block;
}

/* Cards */
.card-modern {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, transform 0.2s ease-in-out;
  box-shadow: var(--shadow-sm);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.blog-card-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.blog-card-link:hover {
  text-decoration: none;
  color: inherit;
}

.blog-card-link:hover .card-modern {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-modern img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 1px solid var(--border-color);
}

.card-modern-body {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

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

.card-modern-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.card-author {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
}

.card-reading-time {
  color: var(--text-muted);
}

/* Blog Post Page */
/* Blog Reading Layout - Three Column */
.blog-reading-container {
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  gap: 3rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  position: relative;
}

.blog-main {
  min-width: 0;
}

.blog-sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.blog-sidebar-left {
  padding-right: 1rem;
  max-width: 240px;
}

.blog-sidebar-right {
  padding-left: 1rem;
}

.sidebar-content {
  background-color: var(--bg-primary);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

/* Legacy container for backward compatibility */
.blog-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.blog-header {
  margin-bottom: 3rem;
  text-align: center;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.blog-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.blog-author-mini {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.blog-author-mini img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.blog-author-mini span {
  font-weight: 500;
  color: var(--text-primary);
}

.blog-date {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.blog-summary {
  background: linear-gradient(135deg, rgba(41, 98, 255, 0.1), rgba(41, 98, 255, 0.05));
  border-left: 4px solid var(--primary-color);
  padding: 1.25rem 1.5rem;
  border-radius: var(--border-radius);
  margin: 1.5rem 0;
  color: var(--text-primary);
  line-height: 1.7;
}

.blog-title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.blog-cover {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  border-radius: var(--border-radius);
  margin-bottom: 3rem;
  box-shadow: var(--shadow-lg);
}

.blog-content {
  background-color: var(--bg-primary);
  padding: 3.5rem 4rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 3rem;
  transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  max-width: 100%;
}

.blog-body {
  max-width: 100%;
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.blog-paragraph {
  font-size: 1.125rem;
  line-height: 1.85;
  margin-bottom: 1.75rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  word-spacing: 0.05em;
}

.blog-paragraph:last-child {
  margin-bottom: 0;
}

.blog-h2 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.blog-h2:first-child {
  margin-top: 0;
}

.blog-h3 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 2.5rem;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.blog-h3:first-child {
  margin-top: 0;
}

.blog-content pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  background: transparent;
  border: none;
  padding: 0;
}

/* Markdown Styling */
.markdown-body {
  font-size: 1.125rem;
  line-height: 1.85;
  color: var(--text-primary);
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  font-weight: 700;
  line-height: 1.3;
  margin-top: 2.5rem;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.markdown-body h1:first-child,
.markdown-body h2:first-child,
.markdown-body h3:first-child {
  margin-top: 0;
}

.markdown-body h1 {
  font-size: 2.5rem;
}

.markdown-body h2 {
  font-size: 2rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
  margin-top: 3rem;
}

.markdown-body h3 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
}

.markdown-body h4 {
  font-size: 1.25rem;
  margin-top: 2rem;
}

.markdown-body h5,
.markdown-body h6 {
  font-size: 1.125rem;
  margin-top: 1.5rem;
}

.markdown-body p {
  margin-bottom: 1.5rem;
  line-height: 1.85;
  color: var(--text-primary);
}

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

.markdown-body li {
  margin-bottom: 0.5rem;
  line-height: 1.75;
}

.markdown-body ul {
  list-style-type: disc;
}

.markdown-body ol {
  list-style-type: decimal;
}

.markdown-body blockquote {
  border-left: 4px solid var(--primary-color);
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  color: var(--text-secondary);
  font-style: italic;
  background-color: var(--bg-secondary);
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius);
}

.markdown-body code {
  background-color: var(--bg-tertiary);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: 'Courier New', monospace;
  color: var(--text-primary);
}

.markdown-body pre {
  background-color: var(--bg-tertiary);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border-color);
}

.markdown-body pre code {
  background-color: transparent;
  padding: 0;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.markdown-body a {
  color: var(--primary-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease-in-out;
}

.markdown-body a:hover {
  border-bottom-color: var(--primary-color);
}

.markdown-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  margin: 1.5rem 0;
  box-shadow: var(--shadow-md);
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  overflow-x: auto;
  display: block;
}

.markdown-body table th,
.markdown-body table td {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  text-align: left;
}

.markdown-body table th {
  background-color: var(--bg-secondary);
  font-weight: 600;
}

.markdown-body hr {
  border: none;
  border-top: 2px solid var(--border-color);
  margin: 2.5rem 0;
}

.markdown-body strong {
  font-weight: 700;
  color: var(--text-primary);
}

.markdown-body em {
  font-style: italic;
}

/* Table of Contents */
.toc-container {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.toc-title {
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.toc-nav {
  font-size: 0.875rem;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

.toc-item {
  margin-bottom: 0.5rem;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.toc-link {
  color: var(--text-secondary);
  text-decoration: none;
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: all 0.15s ease-in-out;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  max-width: 100%;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  position: relative;
}

.toc-link:hover {
  color: var(--primary-color);
  background-color: var(--bg-secondary);
  -webkit-line-clamp: unset;
  line-clamp: unset;
  white-space: normal;
  overflow: visible;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toc-link.active {
  color: var(--primary-color);
  background-color: rgba(41, 98, 255, 0.1);
  font-weight: 500;
}

.toc-item.ml-2 {
  padding-left: 0.75rem;
}

.toc-item.ml-4 {
  padding-left: 1.5rem;
}

/* Author Card */
.author-card {
  text-align: center;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
  border: 3px solid var(--border-color);
}

.author-name {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.author-bio {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

/* Reading Stats */
.reading-stats {
  margin-bottom: 1.5rem;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.stat-item:last-child {
  border-bottom: none;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.stat-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Reading Progress */
.reading-progress {
  position: relative;
  height: 4px;
  background-color: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
  width: 0%;
  transition: width 0.1s ease-out;
  border-radius: 2px;
}

/* Markdown Editor Styles */
.markdown-editor-container {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  background-color: var(--bg-primary);
  transition: border-color 0.15s ease-in-out;
}

.markdown-editor-container:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(41, 98, 255, 0.1);
}

.markdown-editor-wrapper {
  position: relative;
  min-height: 400px;
}

.markdown-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
}

.markdown-tab {
  flex: 1;
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.15s ease-in-out;
}

.markdown-tab:hover {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
}

.markdown-tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  background-color: var(--bg-primary);
}

.markdown-write-panel,
.markdown-preview-panel {
  display: none;
  min-height: 400px;
}

.markdown-write-panel.active,
.markdown-preview-panel.active {
  display: block;
}

.markdown-editor {
  width: 100%;
  min-height: 400px;
  padding: 1.5rem;
  border: none;
  resize: vertical;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  line-height: 1.6;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

.markdown-editor:focus {
  outline: none;
  box-shadow: none;
}

.markdown-preview {
  padding: 1.5rem;
  min-height: 400px;
  max-height: 600px;
  overflow-y: auto;
  background-color: var(--bg-primary);
}

.markdown-help {
  padding: 0.75rem 1rem;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  font-size: 0.875rem;
}

@media (max-width: 768px) {
  .markdown-editor,
  .markdown-preview {
    min-height: 300px;
    padding: 1rem;
  }
  
  .markdown-tab {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
}

.blog-author {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background-color: var(--bg-primary);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  margin-bottom: 3rem;
  transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.blog-author img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
}

.blog-author-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

/* Comments Section */
.comments-section {
  background-color: var(--bg-primary);
  padding: 2rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  margin: 2rem auto;
  max-width: 1400px;
  transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.comments-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--text-primary);
}

.comment-form {
  background-color: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  margin-bottom: 2rem;
  transition: background-color 0.15s ease-in-out;
}

.comment-form-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.comment-form-header img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.comment-form textarea {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  transition: border-color 0.15s ease-in-out, background-color 0.15s ease-in-out, color 0.15s ease-in-out;
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

.comment-form textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

[data-theme="dark"] .comment-form textarea::placeholder {
  color: #d1d5db;
  opacity: 0.8;
}

.comment-form textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(41, 98, 255, 0.1);
}

.comment-form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* Comment Sign-up Prompt */
.comment-signup-prompt {
  background: linear-gradient(135deg, rgba(41, 98, 255, 0.08), rgba(41, 98, 255, 0.03));
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary-color);
  border-radius: var(--border-radius);
  padding: 2rem;
  margin-bottom: 2rem;
  text-align: center;
}

.signup-text {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.signup-subtext {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.signup-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.comment-item {
  display: flex;
  gap: 1rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.comment-item:last-child {
  border-bottom: none;
}

.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.comment-content {
  flex-grow: 1;
}

.comment-author {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.comment-text {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* Forms */
.form-modern {
  max-width: 500px;
  margin: 0 auto;
  background-color: var(--bg-primary);
  padding: 3rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-modern .form-label {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.form-modern .form-control {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.15s ease-in-out, background-color 0.15s ease-in-out, color 0.15s ease-in-out;
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

.form-modern .form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(41, 98, 255, 0.1);
  outline: none;
}

.form-modern textarea.form-control {
  min-height: 200px;
  resize: vertical;
}

.form-modern .form-text {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.25rem;
  transition: color 0.15s ease-in-out;
}

/* Ensure paragraphs in form-modern are visible in dark mode */
.form-modern p {
  color: var(--text-primary);
  transition: color 0.15s ease-in-out;
}

[data-theme="dark"] .form-modern p.text-muted,
[data-theme="dark"] .form-modern p.text-center.text-muted {
  color: #d1d5db !important;
  opacity: 1 !important;
}

/* Input placeholder styling for dark mode */
.form-modern .form-control::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
  transition: color 0.15s ease-in-out;
}

[data-theme="dark"] .form-modern .form-control::placeholder {
  color: #d1d5db;
  opacity: 0.8;
}

/* Bootstrap form-control placeholder */
.form-control::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

[data-theme="dark"] .form-control::placeholder {
  color: #d1d5db;
  opacity: 0.8;
}

/* Ensure form labels are visible in dark mode */
.form-label {
  color: var(--text-primary);
  transition: color 0.15s ease-in-out;
}

/* Links in forms - ensure visibility in dark mode */
.form-modern a {
  color: var(--primary-color);
  transition: color 0.15s ease-in-out;
}

[data-theme="dark"] .form-modern a {
  color: #60a5fa;
}

.form-modern a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

[data-theme="dark"] .form-modern a:hover {
  color: #93c5fd;
}

/* Home Page */
.home-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1rem;
}

.home-header {
  text-align: center;
  margin-bottom: 3rem;
}

.home-title {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.home-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  transition: color 0.15s ease-in-out;
}

.blogs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 3rem;
}

/* Add Blog Form */
.add-blog-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 1rem;
}

.add-blog-form {
  background-color: var(--bg-primary);
  padding: 3rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.add-blog-form .form-label {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  transition: color 0.15s ease-in-out;
}

.add-blog-form textarea {
  min-height: 400px;
}

.add-blog-form .form-text {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.25rem;
  transition: color 0.15s ease-in-out;
}

.add-blog-form .form-control::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

[data-theme="dark"] .add-blog-form .form-control::placeholder {
  color: #d1d5db;
  opacity: 0.8;
}

/* Alerts */
.alert-modern {
  padding: 1rem 1.5rem;
  border-radius: 8px;
  border: 1px solid;
  margin-bottom: 1.5rem;
}

.alert-danger {
  background-color: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

/* Utilities */
.text-muted {
  color: var(--text-muted) !important;
  transition: color 0.15s ease-in-out;
}

/* Make text-muted more visible in dark mode - High specificity to override Bootstrap */
[data-theme="dark"] .text-muted,
[data-theme="dark"] p.text-muted,
[data-theme="dark"] .form-modern .text-muted,
[data-theme="dark"] .form-modern p.text-muted,
[data-theme="dark"] .container .text-muted,
[data-theme="dark"] .container p.text-muted,
[data-theme="dark"] body .text-muted,
[data-theme="dark"] body p.text-muted {
  color: #d1d5db !important;
  opacity: 1 !important;
}

.mt-section {
  margin-top: 3rem;
}

.mb-section {
  margin-bottom: 3rem;
}

.w-100 {
  width: 100% !important;
}

.text-center {
  text-align: center;
}

.d-flex {
  display: flex;
}

.gap-3 {
  gap: 1rem;
}

.mb-0 {
  margin-bottom: 0;
}

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

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

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

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

.mt-5 {
  margin-top: 3rem;
}

.mb-5 {
  margin-bottom: 3rem;
}

.py-4 {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

/* Responsive */
@media (max-width: 1200px) {
  .blogs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* Home Page Mobile Styles */
  .home-container {
    padding: 1.5rem 1rem;
  }
  
  .home-title {
    font-size: 2rem;
    margin-bottom: 0.75rem;
  }
  
  .home-subtitle {
    font-size: 1rem;
  }
  
  .blogs-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
  }
  
  .card-modern-body {
    padding: 1.25rem;
  }
  
  .card-modern-title {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
  }
  
  .card-modern img {
    height: 180px;
  }
  
  /* Blog Reading Page Mobile Styles */
  .blog-reading-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1rem 0.75rem;
  }
  
  .blog-sidebar {
    position: static;
    max-height: none;
  }
  
  .blog-sidebar-left {
    order: 3;
    padding: 0;
  }
  
  .blog-sidebar-right {
    order: 2;
    padding: 0;
  }
  
  .blog-main {
    order: 1;
  }
  
  .blog-header {
    text-align: left;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
  }
  
  .blog-title {
    font-size: 1.75rem;
    line-height: 1.2;
    margin-bottom: 1rem;
  }
  
  .blog-summary {
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    font-size: 0.95rem;
    line-height: 1.6;
  }
  
  .blog-meta {
    justify-content: flex-start;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    margin-top: 1rem;
  }
  
  .blog-cover {
    margin-bottom: 2rem;
    border-radius: 8px;
  }
  
  .blog-content {
    padding: 1.5rem 1rem;
    border-radius: 8px;
  }
  
  .blog-paragraph {
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1.25rem;
  }
  
  .blog-h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
  }
  
  .blog-h3 {
    font-size: 1.125rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
  }
  
  .markdown-body {
    font-size: 0.95rem;
    line-height: 1.7;
  }
  
  .markdown-body h1 {
    font-size: 1.75rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
  }
  
  .markdown-body h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
  }
  
  .markdown-body h3 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
  }
  
  .markdown-body h4 {
    font-size: 1.125rem;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
  }
  
  .markdown-body p {
    margin-bottom: 1.25rem;
    line-height: 1.7;
  }
  
  .markdown-body ul,
  .markdown-body ol {
    padding-left: 1.5rem;
    margin-bottom: 1.25rem;
  }
  
  .markdown-body blockquote {
    padding: 0.75rem 1rem;
    margin: 1.25rem 0;
    font-size: 0.95rem;
  }
  
  .markdown-body pre {
    padding: 1rem;
    margin: 1.25rem 0;
    font-size: 0.875rem;
    overflow-x: auto;
  }
  
  .markdown-body img {
    margin: 1.25rem 0;
  }
  
  .markdown-body table {
    font-size: 0.875rem;
  }
  
  .markdown-body table th,
  .markdown-body table td {
    padding: 0.5rem;
  }
  
  .toc-container {
    max-height: 300px;
    overflow-y: auto;
  }
  
  .sidebar-content {
    padding: 1rem;
  }
  
  /* Comments Section Mobile */
  .comments-section {
    padding: 1.5rem 1rem;
    margin: 1.5rem 1rem;
  }
  
  .comments-title {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
  }
  
  .comment-form {
    padding: 1rem;
  }
  
  .comment-form-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .comment-form-header img {
    width: 40px;
    height: 40px;
  }
  
  .comment-form textarea {
    font-size: 0.95rem;
    padding: 0.75rem;
  }
  
  .comment-form-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .comment-form-actions .btn-modern,
  .comment-form-actions .btn-modern-outline {
    width: 100%;
  }
  
  .comment-item {
    padding: 1rem 0;
    gap: 0.75rem;
  }
  
  .comment-avatar {
    width: 36px;
    height: 36px;
  }
  
  .comment-author {
    font-size: 0.95rem;
  }
  
  .comment-text {
    font-size: 0.9rem;
    line-height: 1.6;
  }
  
  .comment-signup-prompt {
    padding: 1.5rem 1rem;
  }
  
  .signup-text {
    font-size: 1rem;
  }
  
  .signup-subtext {
    font-size: 0.875rem;
  }
  
  .signup-actions {
    flex-direction: column;
  }
  
  .signup-actions .btn-modern,
  .signup-actions .btn-modern-outline {
    width: 100%;
  }
  
  /* Reactions Mobile */
  .blog-reactions {
    margin-top: 2rem;
    padding-top: 1.5rem;
  }
  
  .reactions-title {
    font-size: 1rem;
    margin-bottom: 1rem;
  }
  
  .reactions-container {
    gap: 0.75rem;
  }
  
  .reaction-btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
  }
  
  /* Add Blog Form Mobile */
  .add-blog-container {
    padding: 1.5rem 1rem;
  }
  
  .add-blog-form {
    padding: 1.5rem 1.25rem;
  }
  
  .add-blog-form h1 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
  }
  
  .add-blog-form textarea {
    min-height: 300px;
  }
  
  .markdown-editor,
  .markdown-preview {
    min-height: 300px;
    padding: 1rem;
    font-size: 0.9rem;
  }
  
  .markdown-tab {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
  
  /* Forms Mobile */
  .form-modern {
    padding: 2rem 1.5rem;
    margin: 1rem;
  }
  
  .form-modern h1 {
    font-size: 1.75rem;
  }
  
  /* Typography Mobile */
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  h3 {
    font-size: 1.25rem;
  }
  
  p {
    font-size: 0.95rem;
  }
}

/* Blog Reactions */
.blog-reactions {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.reactions-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  text-align: center;
}

.reactions-container {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.reaction-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 500;
}

.reaction-btn:hover {
  background-color: var(--bg-tertiary);
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.reaction-btn.active {
  background-color: rgba(41, 98, 255, 0.1);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.reaction-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.reaction-icon {
  font-size: 1.25rem;
}

.reaction-count {
  font-weight: 600;
  min-width: 1.5rem;
  text-align: center;
}

.reaction-status {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.875rem;
  min-height: 1.5rem;
  transition: color 0.15s ease-in-out;
}

/* Tablet Layout */
@media (max-width: 1024px) {
  .blog-reading-container {
    grid-template-columns: 200px 1fr;
    gap: 2rem;
  }
  
  .blog-sidebar-right {
    display: none;
  }
  
  .blog-content {
    padding: 2.5rem 3rem;
  }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
  .home-container {
    padding: 1rem 0.75rem;
  }
  
  .home-title {
    font-size: 1.75rem;
  }
  
  .home-subtitle {
    font-size: 0.95rem;
  }
  
  .blogs-grid {
    gap: 1.25rem;
  }
  
  .card-modern-body {
    padding: 1rem;
  }
  
  .card-modern-title {
    font-size: 1rem;
  }
  
  .card-modern img {
    height: 160px;
  }
  
  .blog-reading-container {
    padding: 0.75rem 0.5rem;
    gap: 1.25rem;
  }
  
  .blog-title {
    font-size: 1.5rem;
  }
  
  .blog-content {
    padding: 1.25rem 0.75rem;
  }
  
  .blog-paragraph {
    font-size: 0.9rem;
  }
  
  .markdown-body {
    font-size: 0.9rem;
  }
  
  .markdown-body h1 {
    font-size: 1.5rem;
  }
  
  .markdown-body h2 {
    font-size: 1.25rem;
  }
  
  .markdown-body h3 {
    font-size: 1.125rem;
  }
  
  .comments-section {
    padding: 1.25rem 0.75rem;
    margin: 1.25rem 0.75rem;
  }
  
  .add-blog-form {
    padding: 1.25rem 1rem;
  }
  
  .form-modern {
    padding: 1.5rem 1.25rem;
    margin: 0.5rem;
  }
  
  .navbar-modern-wrapper {
    padding: 0.75rem 0.5rem;
  }
  
  .navbar-modern-container {
    padding: 0.75rem 1rem;
  }
}

/* Ensure images don't overflow on mobile */
img {
  max-width: 100%;
  height: auto;
}

/* Improve text readability on mobile */
@media (max-width: 768px) {
  body {
    font-size: 0.95rem;
  }
  
  /* Better word wrapping */
  .card-modern-title,
  .blog-title,
  h1, h2, h3, h4, h5, h6 {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }
  
  /* Prevent horizontal scrolling */
  * {
    max-width: 100%;
  }
  
  /* Better spacing for buttons on mobile */
  .btn-modern,
  .btn-modern-outline {
    padding: 0.625rem 1.25rem;
    font-size: 0.95rem;
  }
  
  /* Better form controls on mobile */
  .form-control {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 0.75rem;
  }
  
  textarea.form-control {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

