/* ==========================================================================
   1. Design Tokens & Theme Variables (Dark & Light)
   ========================================================================== */
:root,
[data-theme="dark"] {
  /* Dark Theme Palette */
  --bg-page: #0b0f17;
  --bg-header: rgba(11, 15, 23, 0.85);
  --bg-footer: rgba(11, 15, 23, 0.9);
  --bg-card: rgba(18, 24, 38, 0.85);
  --bg-card-hover: rgba(26, 35, 56, 0.9);
  --bg-input: rgba(15, 21, 33, 0.8);
  
  --text-primary: #f8fafc;
  --text-muted: #94a3b8;
  --title-gradient: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);

  /* Vibrant Accents */
  --accent-primary: #3b82f6;
  --accent-secondary: #8b5cf6;
  --accent-glow: rgba(59, 130, 246, 0.35);
  --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --accent-gradient-hover: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(59, 130, 246, 0.5);

  /* Shadows & Radius */
  --shadow-card: 0 12px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(59, 130, 246, 0.25);
  --radius-card: 18px;
  --radius-btn: 12px;

  /* Smooth Easing */
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme Overrides */
[data-theme="light"] {
  --bg-page: #f1f5f9;
  --bg-header: rgba(255, 255, 255, 0.88);
  --bg-footer: rgba(255, 255, 255, 0.92);
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-input: #e2e8f0;

  --text-primary: #0f172a;
  --text-muted: #475569;
  --title-gradient: linear-gradient(135deg, #0f172a 0%, #334155 100%);

  --border-subtle: rgba(0, 0, 0, 0.1);
  --border-glow: rgba(37, 99, 235, 0.3);

  --shadow-card: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.15);
}

/* ==========================================================================
   2. Global Resets & Background
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Global Link Reset */
a, a:visited {
  color: inherit;
  text-decoration: none;
}

/* Outer Layout Alignments */
.nav-container,
.main-content,
.footer-container,
.footer-bottom {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  box-sizing: border-box;
}

.main-content {
  margin-top: 2.5rem;
  margin-bottom: 3.5rem;
  animation: fadeInUp 0.6s var(--ease-out) forwards;
}

/* ==========================================================================
   3. Keyframe Animations
   ========================================================================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 15px rgba(59, 130, 246, 0.2); }
  50% { box-shadow: 0 0 30px rgba(139, 92, 246, 0.35); }
}

@keyframes iconWobble {
  0% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-12deg) scale(1.15); }
  75% { transform: rotate(12deg) scale(1.15); }
  100% { transform: rotate(0deg) scale(1); }
}

/* ==========================================================================
   4. Header & Glassmorphic Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-header);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-container {
  padding-top: 1rem;
  padding-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

.brand-logo i.logo-icon {
  color: #3b82f6;
  font-size: 1.35rem;
  filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.5));
  transition: transform 0.4s var(--ease-spring);
}

.brand-logo:hover i.logo-icon {
  animation: iconWobble 0.6s var(--ease-spring);
}

/* Gradient & Unique Font for "Between the Chapter" */
.brand-logo .logo-text {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800;
  font-size: 1.55rem;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #60a5fa 0%, #c084fc 50%, #f472b6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: filter 0.3s ease, transform 0.3s ease;
}

.brand-logo:hover .logo-text {
  filter: brightness(1.2);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-link {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.925rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  transition: all 0.25s ease;
}

.nav-link i {
  font-size: 0.95rem;
  transition: transform 0.25s var(--ease-spring), color 0.25s ease;
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link:hover i {
  color: var(--accent-primary);
  transform: translateY(-2px) scale(1.1);
}

.nav-divider {
  width: 1px;
  height: 20px;
  background-color: var(--border-subtle);
}

.user-greeting {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.user-greeting i {
  color: var(--accent-primary);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.25s var(--ease-spring);
}

.theme-toggle-btn:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-2px) rotate(12deg);
}

/* ==========================================================================
   5. Buttons & Interactive States
   ========================================================================== */
.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff !important;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-btn);
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px var(--accent-glow);
  transition: all 0.3s var(--ease-out);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  background: var(--accent-gradient-hover);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.45);
}

.btn-secondary {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary) !important;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s var(--ease-out);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-secondary:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

/* ==========================================================================
   6. Page Layout & Feed Header
   ========================================================================== */
.page-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2.5rem;
  align-items: start;
}

.feed-header {
  margin-bottom: 1.75rem;
}

.feed-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0;
  background: var(--title-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.feed-subtitle {
  color: var(--text-muted);
  margin-top: 0.35rem;
  font-size: 1rem;
}

/* ==========================================================================
   7. Article Post Cards
   ========================================================================== */
.blog-feed .posts-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.post-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  transition: all 0.35s var(--ease-out);
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow), var(--shadow-card);
}

.card-image-link {
  display: block;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: var(--bg-input);
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--ease-out), filter 0.4s ease;
}

.post-card:hover .card-image {
  transform: scale(1.05);
  filter: brightness(1.05);
}

.card-content {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
  width: 100%;
  box-sizing: border-box;
}

.card-date {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  padding: 0.3rem 0.75rem;
  border-radius: 30px;
  margin: 0;
}

.card-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.3;
  width: 100%;
}

.card-title a,
.card-title a:visited {
  color: var(--text-primary) !important;
  transition: color 0.25s ease;
}

.card-title a:hover {
  color: var(--accent-primary) !important;
}

.card-excerpt {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
  width: 100%;
}

.card-read-more,
.card-read-more:visited {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 10px;
  color: var(--accent-primary) !important;
  font-weight: 700;
  font-size: 0.875rem;
  margin-top: 0.35rem;
  transition: all 0.25s ease;
}

.card-read-more:hover {
  background: var(--accent-primary);
  color: #ffffff !important;
  border-color: var(--accent-primary);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

/* ==========================================================================
   8. Sidebar & Recommended Book Widget (Premium 3D Update)
   ========================================================================== */
.sidebar {
  position: sticky;
  top: 95px;
}

.book-widget.premium-widget {
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-card-hover) 100%);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-card);
  padding: 2.25rem 1.85rem;
  border: 1px solid var(--border-glow);
  box-shadow: 0 15px 35px rgba(0,0,0,0.05), var(--shadow-glow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.4s var(--ease-spring);
}

.book-widget.premium-widget:hover {
  transform: translateY(-6px);
}

.book-widget.premium-widget::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--accent-gradient);
}

.premium-widget-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0;
  line-height: 1.2;
  background: var(--title-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  text-align: center;
}

/* 3D Perspective Hover Effect for the Book Cover */
.book-cover-3d {
  width: 100%;
  max-height: 280px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.5), 0 0 15px var(--accent-glow);
  transform: perspective(1000px) rotateY(-5deg) rotateX(4deg) scale(0.97);
  transition: all 0.5s var(--ease-spring);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-input);
}

.book-widget.premium-widget:hover .book-cover-3d {
  transform: perspective(1000px) rotateY(0deg) rotateX(0deg) scale(1.02);
  box-shadow: 0 25px 45px -12px rgba(0, 0, 0, 0.6), 0 0 25px var(--accent-glow);
}

.book-cover-3d img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.book-details {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.book-title {
  font-size: 1.45rem;
  font-weight: 800;
  margin: 0;
  color: var(--text-primary);
  line-height: 1.3;
}

/* Stylish Pill Badge for the Author */
.book-author {
  display: inline-flex;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  padding: 0.4rem 1rem;
  border-radius: 30px;
  margin: 0.75rem 0 1.25rem 0;
}

.book-summary {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0;
}

/* Stylish Button for the Premium Book Widget */
.book-action-btn {
  margin-top: 1.25rem;
  width: 100%;
  border-radius: 20px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.book-action-btn:hover {
  box-shadow: 0 12px 25px rgba(59, 130, 246, 0.5);
  transform: translateY(-2px);
}

/* ==========================================================================
   9. Auth & Form UI (Login, Register, Contact, Create Post)
   ========================================================================== */
.auth-card,
.contact-card {
  max-width: 520px;
  margin: 3.5rem auto;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border-radius: 22px;
  padding: 2.75rem 2.25rem;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.6s var(--ease-out) forwards;
}

.auth-card::before,
.contact-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--accent-gradient);
}

.auth-title {
  font-size: 1.85rem;
  font-weight: 800;
  margin: 0 0 0.35rem 0;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 0.925rem;
  margin-bottom: 2rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  padding: 0.85rem 1.1rem;
  font-size: 0.95rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-input);
  color: var(--text-primary);
  transition: all 0.3s ease;
  outline: none;
}

.form-control:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.text-area {
  resize: vertical;
  min-height: 150px;
}

.btn-block {
  width: 100%;
  padding: 0.9rem 1.25rem;
  margin-top: 0.5rem;
}

/* ==========================================================================
   10. Single Article Page (`post.php`)
   ========================================================================== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  transition: all 0.25s ease-out;
}

.back-link:hover {
  color: var(--accent-primary);
  transform: translateX(-4px);
}

.single-post {
  max-width: 860px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 2.5rem;
  box-shadow: var(--shadow-card);
}

.post-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.post-meta {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-primary);
}

.post-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0.5rem 0 0 0;
  line-height: 1.2;
  color: var(--text-primary);
}

.post-hero-image {
  margin: 0 auto 2.5rem auto;
  border-radius: var(--radius-card);
  overflow: hidden;
  width: 100%;
  max-height: 480px;
  aspect-ratio: 16 / 9;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.post-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.6s var(--ease-out), filter 0.4s ease;
}

.post-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-muted);
  max-width: 75ch;
  margin: 0 auto;
}

.post-divider {
  border: none;
  height: 1px;
  background-image: linear-gradient(to right, transparent, var(--border-subtle), transparent);
  margin: 3.5rem 0;
}

/* ==========================================================================
   11. Comments Section & Form Spacing
   ========================================================================== */
.comments-section {
  margin-top: 3.5rem;
}

.comments-title {
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Outer wrapper separating the input form from the comments list below */
.comment-form-wrapper {
  margin-top: 1.5rem;
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

/* Grid container for avatar + textarea */
.comment-form-grid {
  margin-bottom: 1.25rem;
}

/* "Post Comment" Button Container */
.comment-form-actions {
  margin-top: 1.25rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

/* Comments List Container */
.comments-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 2rem;
}

/* Glassmorphic Comment Card */
.comment-card, 
.comment-item {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.comment-card:hover, 
.comment-item:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow), var(--shadow-card);
}

/* Horizontal Header Layout (Avatar + Name + Date) */
.comment-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* Circular Rounded Avatar */
.comment-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(59, 130, 246, 0.4);
  background-color: var(--bg-input);
  flex-shrink: 0;
}

.comment-author {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.comment-date {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
}

.comment-body {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}

/* Reply Action Button */
.reply-btn, 
.btn-reply {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted) !important;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
}

.reply-btn:hover, 
.btn-reply:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--accent-primary);
  color: var(--accent-primary) !important;
  transform: translateY(-2px);
}

/* Nested Thread Indentation */
.comment-children, 
.nested-comments, 
.replies-container {
  margin-left: 1.75rem;
  padding-left: 1.25rem;
  border-left: 2px solid var(--border-glow);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1rem;
}

/* Logged-Out Prompt Box */
.login-prompt-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 2.5rem;
  margin: 2.5rem 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-card);
}

.login-prompt-card .prompt-icon {
  font-size: 2.25rem;
  color: var(--accent-primary);
  filter: drop-shadow(0 0 10px var(--accent-glow));
  margin-bottom: 0.75rem;
}

.login-prompt-card .prompt-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.login-prompt-card .prompt-text {
  color: var(--text-muted);
  margin: 0.25rem 0 1.5rem 0;
  max-width: 400px;
  font-size: 0.95rem;
}

.login-prompt-card .prompt-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* ==========================================================================
   12. Glassmorphic Footer
   ========================================================================== */
.site-footer {
  margin-top: 5rem;
  background: var(--bg-footer);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 1.5rem 1.5rem;
  transition: background-color 0.3s ease;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-subtle);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-tagline {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin: 0;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-link {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.25s ease;
}

.footer-link:hover {
  color: var(--accent-primary);
  transform: translateY(-2px);
}

.footer-socials {
  display: flex;
  gap: 1rem;
}

/* Footer Social Icons */
.footer-social-link {
  font-size: 1.25rem;
  color: var(--text-muted);
  transition: color 0.3s ease, transform 0.2s ease;
}

.footer-social-link:hover {
  color: var(--accent-primary);
  transform: translateY(-2px); 
}

.social-icon:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-4px) scale(1.08);
}

.footer-bottom {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.825rem;
  color: var(--text-muted);
}

/* ==========================================================================
   13. Responsive Mobile Menu
   ========================================================================== */
.nav-toggle {
  display: none;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 1.25rem;
  padding: 0.5rem 0.8rem;
  border-radius: 10px;
  cursor: pointer;
}

@media (max-width: 880px) {
  .page-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .sidebar {
    position: static;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-footer);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 1.5rem;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    border-radius: 0 0 18px 18px;
    z-index: 999;
  }

  .nav-menu.active {
    display: flex;
    animation: fadeInUp 0.3s ease forwards;
  }
  
  /* NEW: Shrink logo to prevent wrapping on tablet/mobile */
  .brand-logo .logo-text {
    font-size: 1.25rem;
  }
}

/* NEW: Extra small screens (iPhone SE, etc.) */
@media (max-width: 400px) {
  .brand-logo .logo-text {
    font-size: 1.1rem;
  }
  .brand-logo i.logo-icon {
    font-size: 1.1rem;
  }
  .nav-toggle {
    padding: 0.4rem 0.6rem;
    font-size: 1.1rem;
  }
  .nav-container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* ==========================================================================
   14. Article Metadata Badges & Reading Time
   ========================================================================== */
.card-meta-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.card-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.post-meta-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.post-meta-item {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.post-meta-item i {
  color: var(--accent-primary);
}

/* ==========================================================================
   15. Admin Dashboard & Table Overhaul
   ========================================================================== */
.dashboard-container {
  max-width: 1100px;
  margin: 1.5rem auto 3rem auto;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* Stats Summary Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-card);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Admin Table Layout */
.admin-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 1.85rem;
  box-shadow: var(--shadow-card);
}

.table-card-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 1.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.table-responsive {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th {
  padding: 0.85rem 1rem;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-subtle);
}

.admin-table td {
  padding: 1.1rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.table-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-input);
}

.table-thumb-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.table-post-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary) !important;
  text-decoration: none;
  transition: color 0.25s ease;
}

.table-post-title:hover {
  color: var(--accent-primary) !important;
}

.table-post-excerpt {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin: 0.2rem 0 0 0;
}

.table-date {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.table-metrics {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.table-metrics i {
  color: var(--accent-primary);
  width: 16px;
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.btn-action {
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font-size: 0.825rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  transition: all 0.25s ease;
}

.btn-edit {
  background: var(--bg-input);
  color: var(--text-primary) !important;
}

.btn-edit:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary) !important;
  transform: translateY(-2px);
}

.btn-delete {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-delete:hover {
  background: #ef4444;
  color: #ffffff !important;
  border-color: #ef4444;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* ==========================================================================
   16. Live Search Bar & Category Filter Pills
   ========================================================================== */
.filter-controls-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.25rem;
}

/* Search Box Wrapper */
.search-box-wrapper {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
  pointer-events: none;
}

.search-input {
  padding-left: 2.8rem !important;
  padding-right: 2.8rem !important;
  border-radius: 14px !important;
  font-size: 0.925rem !important;
}

.clear-search-btn {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.2s ease;
}

.clear-search-btn:hover {
  color: var(--accent-primary);
}

/* Category Filter Pills */
.category-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pill-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.4rem 0.95rem;
  border-radius: 20px;
  font-size: 0.825rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s var(--ease-spring);
}

.pill-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-2px);
}

.pill-btn.active {
  background: var(--accent-gradient);
  color: #ffffff !important;
  border-color: transparent;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.category-badge {
  color: #c084fc !important;
  background: rgba(192, 132, 252, 0.12) !important;
  border-color: rgba(192, 132, 252, 0.25) !important;
}

/* ==========================================================================
   Modern Animated Love / Like Button
   ========================================================================== */
.love-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 1rem;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted, #9ca3af);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Hover State */
.love-btn:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.25);
}

/* Active Liked State */
.love-btn.loved {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 0 18px rgba(239, 68, 68, 0.3);
}

.love-btn.loved .love-icon {
    color: #ef4444;
    filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.6));
    animation: heartBeat 0.45s ease-in-out;
}

/* Icon & Number Styling */
.love-btn .love-icon {
    font-size: 1.05rem;
    transition: transform 0.2s ease, color 0.2s ease;
}

.love-btn #love-count {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

/* Click Micro-interaction */
.love-btn:active {
    transform: scale(0.95);
}

/* Heartbeat Animation Keyframes */
@keyframes heartBeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.35); }
    50% { transform: scale(0.95); }
    75% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* ==========================================================================
   18. Pagination Controls
   ========================================================================== */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.page-btn {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    padding: 0.5rem 0.9rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-2px);
}

.page-btn.active {
    background: var(--accent-primary);
    color: #ffffff;
    border-color: var(--accent-primary);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   Modern Custom Modal Dialog (Absolute Bulletproof Centering)
   ========================================================================== */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 15, 23, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
}

.custom-modal-card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    
    background: var(--bg-card);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-card);
    padding: 2.5rem 2rem;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8), var(--shadow-glow);
    
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    
    animation: modalPop 0.4s var(--ease-spring) forwards;
}

.custom-modal-icon {
    font-size: 3rem;
    color: #ef4444;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 15px rgba(239, 68, 68, 0.3));
}

.custom-modal-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    width: 100%;
}

.custom-modal-text {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0 0 1.75rem 0;
    line-height: 1.6;
    width: 100%;
}

.custom-modal-actions {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.custom-modal-actions button {
    flex: 1;
    padding: 0.75rem 1rem;
}

@keyframes modalPop {
    0% { opacity: 0; transform: translate(-50%, -40%) scale(0.9); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}