/* 
 * CodeHustle Custom Styles
 * Modern, responsive design with Bootstrap integration
 * Includes dark mode support and custom components
 * Optimized for performance and SEO
 */

/* ============================================
   CRITICAL CSS - Above the fold optimization
   ============================================ */
/* Ensure critical content loads first */
.site-header,
.hero-section,
.main-content {
  contain: layout style;
}

/* ============================================
   CUSTOM PROPERTIES (CSS Variables)
   ============================================ */
:root {
    /* Standardized Palette (accessible) */
    /* Primary: soft blue */
    --primary-color: #0d6efd; /* blue */
    --primary-variant: #6f42c1; /* purple-ish for gradients */
    /* Accent: warm orange for CTAs */
    --accent-start: #ff7a18;
    --accent-end: #ff3d00;
    /* Semantic */
    --secondary-color: #6c757d;
    --success-color: #198754; /* bootstrap 5 green variant */
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    /* Neutral / surfaces */
    --bg-dark: #121212;
    --bg-card: #1e1e1e;
    --border-color: #2d2d2d;
  
  /* Typography */
  --font-family-sans-serif: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-family-monospace: 'JetBrains Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  
  /* Spacing */
  --section-padding: 4rem 0;
  --container-max-width: 1200px;
  
  /* Shadows */
  --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
  
  /* Transitions */
  --transition-base: all 0.3s ease;
  --transition-fast: all 0.15s ease;
}

/* Decorative accent palette for category cards (bright, modern) */
:root {
    --accent-pink: #ff6bcb;
    --accent-teal: #20c997;
    --accent-indigo: #7c5cff;
    --accent-amber: #ffb020;
    --accent-cyan: #00d1ff;
    --accent-rose: #ff6a6a;
    --accent-green: #4cd964;
}

/* Dark mode variables */
[data-bs-theme="dark"] {
    --bs-body-bg: var(--bg-dark);
    --bs-body-color: #e9ecef;
    --bs-card-bg: var(--bg-card);
    --bs-border-color: var(--border-color);
}

/* ============================================
   GLOBAL STYLES
   ============================================ */
body {
  font-family: var(--font-family-sans-serif);
  font-size: 16px;
  line-height: 1.6;
  scroll-behavior: smooth;
}

/* Improve readability */
p {
  margin-bottom: 1.5rem;
}

/* Code blocks */
code {
  font-family: var(--font-family-monospace);
  font-size: 0.875em;
  background-color: rgba(0, 0, 0, 0.1);
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
}

pre {
  background-color: #2d3748;
  color: #e2e8f0;
  padding: 1.5rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

pre code {
  background-color: transparent;
  padding: 0;
  color: inherit;
}

/* ============================================
   HEADER STYLES
   ============================================ */
.site-header {
  background-color: var(--bs-white) !important;
  border-bottom: 1px solid var(--bs-border-color);
  backdrop-filter: blur(10px);
}

[data-bs-theme="dark"] .site-header {
  background-color: var(--bs-dark) !important;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.75rem;
  color: var(--primary-color) !important;
  text-decoration: none;
  transition: var(--transition-fast);
}

.navbar-brand:hover {
  transform: scale(1.05);
}

.navbar-nav .nav-link {
  font-weight: 500;
  padding: 0.5rem 1rem;
  margin: 0 0.25rem;
  border-radius: 0.375rem;
  transition: var(--transition-fast);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  background-color: rgba(var(--bs-primary-rgb), 0.1);
  color: var(--primary-color);
}

/* Search form styling */
.navbar .form-control {
  border-radius: 1.5rem;
  border: 2px solid transparent;
  background-color: var(--light-color);
  transition: var(--transition-fast);
}

.navbar .form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
  background-color: var(--bs-white);
}

/* Social links */
.social-links a {
  color: var(--secondary-color);
  font-size: 1.1rem;
  transition: var(--transition-fast);
}

.social-links a:hover {
  color: var(--primary-color);
  transform: translateY(-2px);
}

/* Breadcrumbs */
.breadcrumb-container {
  background-color: var(--light-color);
  border-bottom: 1px solid var(--bs-border-color);
}

[data-bs-theme="dark"] .breadcrumb-container {
  background-color: rgba(255, 255, 255, 0.05);
}

/* ============================================
   THEME TOGGLE
   ============================================ */
.theme-toggle-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 99999; /* ensure it sits above other stacking contexts while scrolling */
    /* prevent parent stacking contexts or overflow from clipping the toggle */
    pointer-events: auto;
        -webkit-transform: translateZ(0); /* promote to its own layer for smoother rendering */
        transform: translateZ(0);
}

.theme-toggle {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  transition: var(--transition-base);
}

/* Make the toggle visually distinct against page content when fixed */
.theme-toggle {
    background-color: var(--bs-white);
    border: 1px solid rgba(0,0,0,0.06);
    color: var(--dark-color);
}

.theme-toggle:focus {
    outline: 3px solid rgba(13,110,253,0.18);
    outline-offset: 2px;
}

/* Ensure good contrast in both light and dark themes */
[data-bs-theme="dark"] .theme-toggle {
    background-color: var(--bs-card-bg);
    border: 1px solid rgba(255,255,255,0.06);
    color: var(--bs-body-color);
}

/* Slightly larger hit target on small screens */
@media (max-width: 576px) {
    .theme-toggle {
        width: 3.5rem;
        height: 3.5rem;
    }
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
}

/* ============================================
   MAIN CONTENT STYLES
   ============================================ */
.main-content {
  min-height: calc(100vh - 200px);
  padding: 2rem 0;
}

/* Hero section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-variant));
  border-radius: 1rem;
  margin-bottom: 3rem;
}

.hero-section h1 {
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.hero-section .lead {
  font-size: 1.25rem;
  font-weight: 400;
}

/* Section titles */
.section-title {
  font-weight: 600;
  color: var(--dark-color);
  margin-bottom: 2rem;
  position: relative;
  padding-bottom: 0.5rem;
}

[data-bs-theme="dark"] .section-title {
  color: var(--bs-light);
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 3rem;
  height: 3px;
  background-color: var(--primary-color);
  border-radius: 2px;
}

/* ============================================
   CARD STYLES
   ============================================ */
.card {
  border: 1px solid var(--bs-border-color);
  border-radius: 0.75rem;
  transition: var(--transition-base);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.hover-card {
  cursor: pointer;
  transition: var(--transition-base);
}

.hover-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.card-img-top {
  height: 200px;
  object-fit: cover;
  transition: var(--transition-base);
}

.hover-card:hover .card-img-top {
  transform: scale(1.05);
}

.card-title a {
  color: var(--dark-color);
  text-decoration: none;
  transition: var(--transition-fast);
}

[data-bs-theme="dark"] .card-title a {
  color: var(--bs-light);
}

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

/* Category cards */
.category-card {
  transition: var(--transition-base);
  border: 2px solid transparent;
}

.category-card:hover {
  border-color: var(--primary-color);
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

/* Redesigned category grid */
.category-grid .category-link {
    display: block;
    height: 100%;
    color: inherit;
}

.category-card {
    cursor: pointer;
    will-change: transform, box-shadow;
}

.category-card:hover,
.category-link:focus .category-card,
.category-card:focus-within {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 18px 40px rgba(13, 38, 59, 0.12), 0 6px 18px rgba(13,38,59,0.06);
    outline: none;
}

.category-link:focus {
    text-decoration: none;
}

.category-icon {
    width: 56px;
    height: 56px;
    font-size: 1.25rem;
    transition: transform 0.28s cubic-bezier(.2,.9,.25,1), background 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 6px 14px rgba(20,38,60,0.06);
    display: inline-grid;
    place-items: center;
}

.category-count {
    min-width: 40px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    font-weight: 600;
}

/* Accessible focus ring for keyboard users */
.category-link:focus-visible .category-card {
    box-shadow: 0 0 0 4px rgba(13,110,253,0.12), 0 8px 20px rgba(0,0,0,0.08);
}

/* Polished visual: subtle glass/gradient background for cards and softer border */
.category-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    border: 1px solid rgba(13,110,253,0.06);
    transition: transform 0.28s cubic-bezier(.2,.9,.25,1), box-shadow 0.28s ease, border-color 0.2s ease, background 0.2s ease;
}

/* Icon microinteraction: pop & accent color on hover/focus */
.category-card:hover .category-icon,
.category-card:focus-within .category-icon,
.category-link:focus .category-icon {
    transform: translateY(-4px) scale(1.06);
    box-shadow: 0 14px 30px rgba(20,38,60,0.12);
}

/* Use CSS variable for per-card accent so we can override per-item or via nth-child */
.category-card {
    /* reset to conservative clean card */
    --cat-accent: var(--primary-color);
}

/* compact modern card: small rounded rectangle with colored icon circle */
.category-card.clean-compact {
    border-radius: 0.75rem;
    padding: 0.6rem;
    min-height: 96px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bs-card-bg);
    border: 1px solid rgba(0,0,0,0.04);
}

.category-card.clean-compact .category-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px; /* slightly rounded square for a modern look */
    background: linear-gradient(180deg, color-mix(in srgb, var(--cat-accent) 70%, white 30%), var(--cat-accent));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 6px 16px rgba(16,24,40,0.06);
}

.category-card.clean-compact h3 { font-size: 1rem; margin-bottom: 0.15rem; }
.category-card.clean-compact p.small { margin: 0; font-size: 0.8rem; color: var(--secondary-color); }

/* hover: brighten background and lift */
.category-card.clean-compact:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }

@media (max-width: 576px) {
  .category-card.clean-compact { min-height: 76px; padding: 0.45rem; }
  .category-card.clean-compact .category-icon { width: 40px; height: 40px; border-radius: 10px; }
}

/* Accent subtle gradient for icon backgrounds when using utility classes like bg-info */
.category-icon.bg-info {
    background: linear-gradient(135deg, rgba(13,110,253,0.12), rgba(111,66,193,0.08));
}

/* Slightly larger gap between cards for a more airy layout */


@media (max-width: 420px) {
    .category-icon { width: 44px; height: 44px; font-size: 1.05rem; }
    .category-count { min-width: 36px; height: 24px; }
}

/* Category tags (text-first, content-focused) */
.category-tags {
    gap: 0.5rem;
    align-items: center;
}
.category-tag {
    --tag-bg: transparent;
    --tag-border: rgba(0,0,0,0.06);
    padding: 0.45rem 0.6rem;
    border-radius: 999px;
    font-size: 0.95rem;
    color: var(--dark-color);
    text-decoration: none;
    transition: background-color 0.18s ease, transform 0.12s ease, border-color 0.18s ease;
}
.category-tag .tag-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    display: inline-block;
    flex-shrink: 0;
}
.category-tag .tag-name { margin-right: 0.25rem; }
.category-tag .tag-count { font-size: 0.85rem; }

.category-tag:hover {
    background-color: rgba(13,110,253,0.12); /* slightly stronger */
    border-color: rgba(13,110,253,0.3);
    color: black; /* text changes to primary */
    transform: translateY(-2px);
}

.category-tag:hover .tag-dot {
    background: var(--dark-color); /* dot switches for contrast */
}
.category-tag:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(13,110,253,0.12);
}

/* allow different dot colors based on position to add subtle variety */
.category-tags .category-tag:nth-child(1) .tag-dot { background: var(--accent-indigo); }
.category-tags .category-tag:nth-child(2) .tag-dot { background: var(--accent-teal); }
.category-tags .category-tag:nth-child(3) .tag-dot { background: var(--accent-pink); }
.category-tags .category-tag:nth-child(4) .tag-dot { background: var(--accent-amber); }
.category-tags .category-tag:nth-child(5) .tag-dot { background: var(--accent-cyan); }
.category-tags .category-tag:nth-child(6) .tag-dot { background: var(--accent-rose); }
.category-tags .category-tag:nth-child(7) .tag-dot { background: var(--accent-green); }

/* ============================================
   POST STYLES
   ============================================ */
.post-header {
  margin-bottom: 2rem;
}

.post-title {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.post-meta {
  color: var(--secondary-color);
  font-size: 0.9rem;
}

.post-meta a {
  color: inherit;
  text-decoration: none;
}

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

.featured-image img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 0.75rem;
}

/* Post content typography */
.post-content {
  font-size: 1.1rem;
  line-height: 1.8;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--dark-color);
}

[data-bs-theme="dark"] .post-content h1,
[data-bs-theme="dark"] .post-content h2,
[data-bs-theme="dark"] .post-content h3,
[data-bs-theme="dark"] .post-content h4,
[data-bs-theme="dark"] .post-content h5,
[data-bs-theme="dark"] .post-content h6 {
  color: var(--bs-light);
}

.post-content blockquote {
  border-left: 4px solid var(--primary-color);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  background-color: rgba(var(--bs-primary-rgb), 0.05);
  padding: 1.5rem;
  border-radius: 0.5rem;
}

/* Table of Contents */
.toc-container {
  background-color: var(--light-color);
  border-radius: 0.75rem;
  border: 1px solid var(--bs-border-color);
}

[data-bs-theme="dark"] .toc-container {
  background-color: rgba(255, 255, 255, 0.05);
}

.toc-container ul {
  list-style: none;
  padding-left: 1rem;
}

.toc-container a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: var(--transition-fast);
}

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

/* Featured Tools styles */
.featured-tools-section .featured-tools-grid {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scroll-snap-type: x mandatory;
}

.featured-tools-section .featured-tools-grid .tool-card {
    flex: 0 0 320px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    min-height: 420px;
}

.tool-media {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.price-ribbon {
    position: absolute;
    right: 0.5rem;
    bottom: 0.5rem;
    /* compact orange pill that doesn't block the image */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    padding: 0 0.5rem;
    min-width: 44px;
    max-width: 100px;
    box-sizing: border-box;
    border-radius: 0.35rem;
    font-weight: 600;
    font-size: 0.65rem;
    line-height: 1;
    z-index: 3;
    box-shadow: 0 6px 10px rgba(16,24,40,0.06);
    background: var(--warning-color);
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive: make ribbon smaller on narrow screens so it doesn't eat the thumbnail */
@media (max-width: 576px) {
    .price-ribbon {
        height: 20px;
        font-size: 0.58rem;
        padding: 0 0.4rem;
        min-width: 36px;
        max-width: 80px;
    }
}

.tool-icon {
    width: var(--tool-icon-size, 36px);
    height: var(--tool-icon-size, 36px);
}

.card-text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
}

.card-text.clamped::after {
    content: '...';
    position: relative;
    left: 0.25rem;
}

/* ============================================
     Featured Tools Section
     ============================================ */
.featured-tools-section {
    --card-min-width: 260px;
}

.featured-tools-section .text-muted {
    color: var(--secondary-color);
}

.featured-tools-grid {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}

.featured-tools-grid .tool-card {
    min-width: 340px;
    max-width: 340px;
    height: 420px; /* fixed height for consistent layout */
    scroll-snap-align: start;
}

/* Hide native scrollbar for a cleaner look but keep accessibility */
.featured-tools-grid::-webkit-scrollbar { height: 10px; }
.featured-tools-grid::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 999px; }

.tool-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: visible;
}

.tool-header .tool-icon {
    width: var(--tool-icon-size, 48px);
    height: var(--tool-icon-size, 48px);
    font-size: calc(var(--tool-icon-size, 48px) * 0.35);
    flex-shrink: 0;
    background: var(--tool-icon-bg, var(--primary-color));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Media area for each card (image/thumbnail) */
.tool-media {
    width: 100%;
    height: 160px;
    background-color: var(--light-color);
    display: block;
    object-fit: cover;
}

/* Price ribbon positioned on top-left for better visibility */
.price-ribbon {
    position: absolute;
    right: 0.6rem;
    bottom: 0.6rem;
    background: linear-gradient(180deg, var(--accent-start), var(--accent-end));
    color: var(--light-color);
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    z-index: 50;
}

/* Adjustments when card is smaller on narrow screens */
@media (max-width: 420px) {
    .featured-tools-grid .tool-card { min-width: 280px; }
    .tool-media { height: 140px; }
}

/* Allow icon to be placed on top instead of left */
.tool-card.icon-top .tool-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

/* Fixed header height to keep cards aligned regardless of title length */
.tool-header {
    min-height: 84px; /* accommodates icon + up to 2-line title */
}

/* If you want to override icon colors or size per-card, set inline style on the article element, e.g:
     <article class="tool-card" style="--tool-icon-size:64px; --tool-icon-bg:#1f6feb"> ... </article>
*/

.tool-header h3 {
    font-size: 1rem;
    margin-bottom: 0.15rem;
}

/* Clamp title to 2 lines */
.tool-header h3 {
    display: -webkit-box;
    display: box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Clamp description to 3 lines */
.card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0; /* allow children to shrink inside fixed-height container */
    overflow: hidden;
}

.card-text {
    display: -webkit-box;
    display: box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    position: relative;
}

/* three-dot indicator when text is clamped */
.card-text.clamped::after {
    content: '...';
    position: absolute;
    right: 0.25rem;
    bottom: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,1));
    padding-left: 0.25rem;
    color: var(--dark-color);
}

.tool-header small {
    display: block;
    font-size: 0.78rem;
    color: var(--secondary-color);
}

.tool-card .card-body {
    padding: 1.25rem;
}

.tool-card .btn {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tool-card .btn:hover {
    transform: translateY(-2px);
}

.tool-card .badge {
    font-size: 0.7rem;
    padding: 0.35rem 0.5rem;
}

.tool-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.tool-filter {
    cursor: pointer;
    border-radius: 999px;
    padding: 0.35rem 0.6rem;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.tool-filter:focus {
    outline: 3px solid rgba(0,123,255,0.12);
    outline-offset: 2px;
}

.tool-filter.active,
.tool-filter.active:hover {
    background-color: var(--primary-color) !important;
    color: #fff !important;
    border-color: var(--primary-color) !important;
    transform: translateY(-1px);
}

/* Price badge */
.price-badge {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    display: inline-block;
    font-size: 0.9rem;
    padding: 0.45rem 0.65rem;
    border-radius: 0.5rem;
    box-shadow: 0 6px 18px rgba(16,24,40,0.12);
    color: #fff;
    z-index: 40;
    transform: translateY(0);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.price-badge.price-free {
    background: linear-gradient(180deg, #28a745, #218838);
}

.price-badge.price-paid {
    background: linear-gradient(180deg, #343a40, #212529);
}

.tool-card:hover .price-badge {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(16,24,40,0.18);
}

.tool-card.hidden {
    display: none !important;
}

.tool-card .ribbon {
    position: absolute;
    left: -1px;
    top: 12px;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 0 0.375rem 0.375rem 0;
    box-shadow: var(--shadow-sm);
}

@media (max-width: 575px) {
    .tool-header .tool-icon {
        width: 40px;
        height: 40px;
    }

    .featured-tools-grid {
        grid-template-columns: 1fr;
    }
}

/* Small visual polish when a card is focused (keyboard) */
.tool-card:focus-within {
    outline: 3px solid rgba(0, 123, 255, 0.12);
    outline-offset: 3px;
}

/* ============================================
   SIDEBAR STYLES
   ============================================ */
.sidebar .widget {
  margin-bottom: 2rem;
}

.sidebar .card-header {
  background-color: var(--light-color);
  border-bottom: 1px solid var(--bs-border-color);
  font-weight: 600;
}

[data-bs-theme="dark"] .sidebar .card-header {
  background-color: rgba(255, 255, 255, 0.05);
}

/* Tag cloud */
.tag-cloud .badge {
  margin: 0.25rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  transition: var(--transition-fast);
}

.tag-cloud .badge:hover {
  background-color: var(--primary-color) !important;
  color: white !important;
  transform: scale(1.05);
}

/* ============================================
   FOOTER STYLES
   ============================================ */
.site-footer {
  background-color: var(--dark-color);
  color: var(--light-color);
  margin-top: auto;
}

.site-footer h5,
.site-footer h6 {
  color: white;
  font-weight: 600;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  transition: var(--transition-fast);
}

.site-footer a:hover {
  color: white;
}

.newsletter-form .form-control {
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
}

.newsletter-form .form-control::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.newsletter-form .form-control:focus {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: var(--primary-color);
  color: white;
  box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

/* ============================================
   PAGINATION STYLES
   ============================================ */
.pagination .page-link {
  border-radius: 0.5rem;
  margin: 0 0.25rem;
  border: 1px solid var(--bs-border-color);
  color: var(--secondary-color);
  transition: var(--transition-fast);
}

.pagination .page-link:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

.pagination .page-item.active .page-link {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
color: white;
}

/* ============================================
   AD BANNERS
   ============================================ */
.ad-banner {
    background: linear-gradient(45deg, var(--light-color), #e9ecef);
    border: 2px dashed #dee2e6;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  transition: var(--transition-fast);
}

.ad-banner:hover {
  background: linear-gradient(45deg, #e9ecef, #dee2e6);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-variant));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.btn-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-variant));
  border: none;
  color: white;
  transition: var(--transition-base);
}

.btn-gradient:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: white;
}

/* Scroll animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-on-scroll {
  animation: fadeInUp 0.8s ease forwards;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
  .hero-section {
    padding: 2rem 0;
    text-align: center;
  }
  
  .hero-section h1 {
    font-size: 2rem;
  }
  
  .theme-toggle-container {
    top: 0.5rem;
    right: 0.5rem;
  }
  
  .main-content {
    padding: 1rem 0;
  }
  
  .section-title {
    font-size: 1.5rem;
  }
  
  .card-img-top {
    height: 150px;
  }
  
  .featured-image img {
    height: 200px;
  }
  
  .post-content {
    font-size: 1rem;
  }
}

@media (max-width: 576px) {
  .navbar-brand {
    font-size: 1.25rem;
  }
  
  .hero-section h1 {
    font-size: 1.75rem;
  }
  
  .hero-section .lead {
    font-size: 1.1rem;
  }
  
  .post-title {
    font-size: 1.75rem;
  }
  
  .pagination {
    justify-content: center;
  }
  
  .pagination .page-link {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .navbar,
  .sidebar,
  .site-footer,
  .theme-toggle-container,
  .ad-banner,
  .social-share,
  .pagination {
    display: none !important;
  }
  
  .main-content {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  .post-content {
    font-size: 12pt;
    line-height: 1.5;
  }
  
  .post-content h1,
  .post-content h2,
  .post-content h3 {
    page-break-after: avoid;
  }
  
  pre,
  blockquote {
    page-break-inside: avoid;
  }
}
/* ============================================
   MODERN POST LAYOUT STYLES - ENHANCED
   ============================================ */

/* Modern Post Layout Container */
.modern-post-layout {
    padding: 2rem 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%, #dee2e6 100%);
    min-height: 100vh;
    position: relative;
}

/* Content Wrapper - Centered and Card Style */
.content-wrapper {
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    padding: 3rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.content-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-variant) 50%, var(--success-color) 100%);
}

/* Modern Post Header */
.modern-post-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 3px solid transparent;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(90deg, var(--primary-color) 0%, var(--primary-variant) 100%) border-box;
    border-image: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-variant) 100%) 1;
}

.featured-image-container {
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
}

.featured-image-container img {
    transition: transform 0.3s ease;
}

.featured-image-container:hover img {
    transform: scale(1.02);
}

.modern-post-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-variant) 50%, var(--success-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

/* Enhanced Post Meta */
.modern-post-meta {
    margin-bottom: 2rem;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.05) 0%, rgba(111, 66, 193, 0.05) 100%);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 2px solid rgba(13, 110, 253, 0.06);
}

.meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.meta-items {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--bs-body-color);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
}

.meta-item i {
    color: var(--bs-primary);
    font-size: 0.9rem;
}

/* Social Share Buttons */
.social-share-mobile .share-buttons {
    display: flex;
    gap: 0.5rem;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.share-btn.twitter {
    background: linear-gradient(135deg, #1da1f2 0%, #0d8bd9 100%);
    color: white;
}

.share-btn.facebook {
    background: linear-gradient(135deg, #4267b2 0%, #365899 100%);
    color: white;
}

.share-btn.linkedin {
    background: linear-gradient(135deg, #0077b5 0%, #005885 100%);
    color: white;
}

/* Enhanced Post Description */
.post-description {
    margin: 2rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(32, 201, 151, 0.05) 0%, rgba(13, 110, 253, 0.05) 100%);
    border-left: 5px solid var(--success-color);
    border-radius: 0 1rem 1rem 0;
    position: relative;
}

.post-description::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 15px;
    font-size: 4rem;
    color: var(--bs-success);
    opacity: 0.3;
    font-family: Georgia, serif;
}

.post-description .lead {
    margin-bottom: 0;
    font-size: 1.2rem;
    line-height: 1.7;
    color: var(--bs-body-color);
    font-style: italic;
}

/* Enhanced Taxonomy Styles */
.post-taxonomies {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.05) 0%, rgba(220, 53, 69, 0.05) 100%);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 2px solid rgba(255, 193, 7, 0.1);
}

.taxonomy-group {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.taxonomy-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: var(--bs-body-color);
    min-width: 120px;
    font-size: 1rem;
}

.taxonomy-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.taxonomy-badge {
    padding: 0.6rem 1.2rem;
    border-radius: 2rem;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.taxonomy-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.taxonomy-badge:hover::before {
    left: 100%;
}

.taxonomy-badge.category {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-variant) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.25);
}

.taxonomy-badge.tag {
    background: linear-gradient(135deg, var(--success-color) 0%, var(--info-color) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(32, 201, 151, 0.2);
}

.taxonomy-badge:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    color: white;
}

/* Improved TOC Sidebar - Less Intrusive */
.toc-sidebar {
    position: fixed;
    top: 20%;
    right: 1rem;
    width: 60px;
    z-index: 2147483646; /* very high to avoid being overlapped */
    transition: all 0.3s ease;
}

.toc-sidebar.expanded {
    width: 320px;
    max-height: 70vh;
}

.toc-toggle {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-variant) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.35);
    transition: all 0.3s ease;
    border: none;
    font-size: 1.2rem;
    position: relative;
    overflow: hidden;
    z-index: 1100;
}

/* Stronger stacking and contrast to keep it visible while scrolling */
.toc-toggle {
    position: fixed;
    right: 1rem;
    top: 40%;
    z-index: 2147483647;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-variant));
    border: 1px solid rgba(0,0,0,0.06);
}

[data-bs-theme="dark"] .toc-toggle {
    background: linear-gradient(135deg, var(--primary-variant), var(--primary-color));
    border: 1px solid rgba(255,255,255,0.06);
}

.toc-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.toc-toggle:hover::before {
    left: 100%;
}

.toc-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.6);
}

.toc-fixed {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    border: 2px solid rgba(13, 110, 253, 0.1);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.toc-sidebar.expanded .toc-fixed {
    max-height: 60vh;
    opacity: 1;
}

.toc-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-variant) 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-bottom: none;
}

.toc-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toc-content {
    padding: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--bs-primary) transparent;
}

.toc-content::-webkit-scrollbar {
    width: 6px;
}

.toc-content::-webkit-scrollbar-track {
    background: transparent;
}

.toc-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-variant) 100%);
    border-radius: 3px;
}

.toc-content nav ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.toc-content nav ul ul {
    padding-left: 1.5rem;
    margin-top: 0.5rem;
    border-left: 2px solid rgba(13, 110, 253, 0.1);
}

.toc-content nav ul li {
    margin-bottom: 0.5rem;
}

.toc-content nav ul li a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--bs-body-color);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    line-height: 1.4;
    border: 1px solid transparent;
    position: relative;
}

.toc-content nav ul li a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--bs-primary);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.toc-content nav ul li a:hover::before {
    transform: scaleY(1);
}

.toc-content nav ul li a:hover {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1) 0%, rgba(111, 66, 193, 0.1) 100%);
    color: var(--bs-primary);
    transform: translateX(8px);
    border-color: var(--bs-primary);
}

.toc-content nav ul li a.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-variant) 100%);
    color: white;
    transform: translateX(4px);
    border-color: var(--bs-primary);
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
}

.toc-content nav ul li a.active::before {
    transform: scaleY(1);
    background: white;
}

/* Mobile TOC Dropdown */
.mobile-toc {
    margin-bottom: 2rem;
}

.mobile-toc .btn {
    border-radius: 1rem;
    padding: 1rem 1.5rem;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.mobile-toc .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.mobile-toc .btn:hover::before {
    left: 100%;
}

.toc-mobile-content {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.05) 0%, rgba(111, 66, 193, 0.05) 100%);
    padding: 1.5rem;
    border-radius: 0 0 1rem 1rem;
    border: 2px solid rgba(13, 110, 253, 0.1);
    border-top: none;
}

.toc-mobile-content nav ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.toc-mobile-content nav ul ul {
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}

.toc-mobile-content nav ul li {
    margin-bottom: 0.5rem;
}

.toc-mobile-content nav ul li a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--bs-body-color);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.toc-mobile-content nav ul li a:hover {
    background: var(--bs-primary);
    color: white;
    transform: translateX(4px);
}

/* Social Sidebar */
.social-sidebar {
    position: fixed;
    top: 50%;
    left: 2rem;
    transform: translateY(-50%);
    z-index: 1000;
}

.social-fixed {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    padding: 1.5rem;
    border: 2px solid rgba(13, 110, 253, 0.1);
}

.social-fixed h5 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--bs-heading-color);
    text-align: center;
}

.share-buttons-vertical {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.share-btn-vertical {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    text-decoration: none;
    color: white;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.share-btn-vertical::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255,255,255,0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.share-btn-vertical:hover::before {
    transform: translateX(100%);
}

.share-btn-vertical:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    color: white;
}

.share-btn-vertical.twitter {
    background: linear-gradient(135deg, #1da1f2 0%, #0d8bd9 100%);
}

.share-btn-vertical.facebook {
    background: linear-gradient(135deg, #4267b2 0%, #365899 100%);
}

.share-btn-vertical.linkedin {
    background: linear-gradient(135deg, #0077b5 0%, #005885 100%);
}

/* Enhanced Modern Post Content */
.modern-post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--bs-body-color);
    margin-bottom: 3rem;
}

/* Enhanced Typography */
.modern-post-content h1,
.modern-post-content h2,
.modern-post-content h3,
.modern-post-content h4,
.modern-post-content h5,
.modern-post-content h6 {
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    font-weight: 800;
    line-height: 1.3;
    position: relative;
    padding-left: 1rem;
}

.modern-post-content h1::before,
.modern-post-content h2::before,
.modern-post-content h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-variant) 100%);
    border-radius: 2px;
}

.modern-post-content h1 {
    font-size: 2.5rem;
    color: var(--bs-primary);
    background: linear-gradient(135deg, #0d6efd 0%, #6f42c1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modern-post-content h2 {
    font-size: 2rem;
    color: var(--bs-primary);
    padding-bottom: 0.5rem;
    border-bottom: 3px solid transparent;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(90deg, #0d6efd 0%, #6f42c1 100%) border-box;
}

.modern-post-content h3 {
    font-size: 1.5rem;
    color: var(--bs-info);
}

.modern-post-content h4,
.modern-post-content h5,
.modern-post-content h6 {
    color: var(--bs-secondary);
}

.modern-post-content p {
    margin-bottom: 1.8rem;
    text-align: justify;
}

/* Enhanced Blockquotes */
.modern-post-content blockquote {
    margin: 3rem 0;
    padding: 2rem 2.5rem;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.05) 0%, rgba(111, 66, 193, 0.05) 100%);
    border-left: 5px solid var(--bs-primary);
    border-radius: 0 1rem 1rem 0;
    font-style: italic;
    font-size: 1.2rem;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.modern-post-content blockquote::before {
    content: '"';
    position: absolute;
    top: -15px;
    left: 20px;
    font-size: 5rem;
    color: var(--bs-primary);
    opacity: 0.2;
    font-family: Georgia, serif;
}

/* Enhanced Code Blocks */
.modern-post-content pre {
    margin: 3rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: #e2e8f0;
    border-radius: 1rem;
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.6;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.1);
    position: relative;
}

.modern-post-content pre::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f56565 0%, #ed8936 33%, #48bb78 66%, #4299e1 100%);
}

.modern-post-content code {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1) 0%, rgba(111, 66, 193, 0.1) 100%);
    color: var(--bs-primary);
    padding: 0.3rem 0.6rem;
    border-radius: 0.4rem;
    font-size: 0.9em;
    font-weight: 600;
    border: 1px solid rgba(13, 110, 253, 0.2);
}

.modern-post-content pre code {
    background: none;
    color: inherit;
    padding: 0;
    font-size: inherit;
    border: none;
    font-weight: normal;
}

/* Enhanced Images */
.modern-post-content img {
    margin: 3rem 0;
    border-radius: 1rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    transition: transform 0.3s ease;
    border: 3px solid white;
}

.modern-post-content img:hover {
    transform: scale(1.02);
}

/* Enhanced Lists */
.modern-post-content ul,
.modern-post-content ol {
    margin-bottom: 2rem;
    padding-left: 2.5rem;
}

.modern-post-content ul li {
    position: relative;
    margin-bottom: 0.8rem;
    padding-left: 0.5rem;
}

.modern-post-content ul li::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 0.7rem;
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #0d6efd 0%, #6f42c1 100%);
    border-radius: 50%;
}

.modern-post-content ol li {
    margin-bottom: 0.8rem;
    padding-left: 0.5rem;
}

/* Enhanced Tables */
.modern-post-content table {
    width: 100%;
    margin: 3rem 0;
    border-collapse: collapse;
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.modern-post-content table th {
    background: linear-gradient(135deg, #0d6efd 0%, #6f42c1 100%);
    color: white;
    padding: 1rem;
    font-weight: 700;
    text-align: left;
}

.modern-post-content table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.modern-post-content table tr:nth-child(even) td {
    background: rgba(13, 110, 253, 0.02);
}

.modern-post-content table tr:hover td {
    background: rgba(13, 110, 253, 0.05);
}

/* Footer Styles */
.modern-post-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 2px solid var(--bs-border-color);
}

.update-notice {
    background: rgba(255, 193, 7, 0.1);
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    border-left: 4px solid var(--bs-warning);
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: var(--bs-body-color);
}

.update-notice i {
    color: var(--bs-warning);
    margin-right: 0.5rem;
}

/* Author Bio Card */
.author-bio-card {
    display: flex;
    gap: 1.5rem;
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
    border: 1px solid rgba(0,0,0,0.05);
}

.author-avatar i {
    font-size: 4rem;
    color: var(--bs-primary);
}

.author-info {
    flex: 1;
}

.author-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--bs-heading-color);
}

.author-description {
    color: var(--bs-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Social Share Footer */
.social-share-footer {
    text-align: center;
    margin-bottom: 3rem;
}

.social-share-footer h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--bs-heading-color);
}

.share-buttons-large {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.share-btn-large {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    text-decoration: none;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 120px;
    justify-content: center;
}

.share-btn-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    color: white;
}

.share-btn-large.twitter {
    background: linear-gradient(135deg, #1da1f2 0%, #0d8bd9 100%);
}

.share-btn-large.facebook {
    background: linear-gradient(135deg, #4267b2 0%, #365899 100%);
}

.share-btn-large.linkedin {
    background: linear-gradient(135deg, #0077b5 0%, #005885 100%);
}

/* Related Posts Section */
.related-posts-section {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 2px solid var(--bs-border-color);
}

.related-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--bs-heading-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.related-title i {
    color: var(--bs-warning);
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.related-post-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.related-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.related-post-image {
    height: 200px;
    overflow: hidden;
}

.related-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-post-card:hover .related-post-image img {
    transform: scale(1.05);
}

.related-post-content {
    padding: 1.5rem;
}

.related-post-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.related-post-title a {
    color: var(--bs-heading-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.related-post-title a:hover {
    color: var(--bs-primary);
}

.related-post-excerpt {
    color: var(--bs-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.related-post-meta {
    font-size: 0.85rem;
    color: var(--bs-secondary);
}

.related-post-date i {
    margin-right: 0.25rem;
    color: var(--bs-primary);
}

/* Comments Section */
.comments-section {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 2px solid var(--bs-border-color);
}

.comments-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--bs-heading-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comments-title i {
    color: var(--bs-info);
}

/* Responsive Design Enhancements */
@media (max-width: 1399.98px) {
    .social-sidebar {
        display: none !important;
    }
    
    .toc-sidebar {
        right: 0.5rem;
        width: 50px;
    }
    
    .toc-sidebar.expanded {
        width: 280px;
    }
}

@media (max-width: 1199.98px) {
    .toc-sidebar {
        display: none !important;
    }
}

@media (max-width: 991.98px) {
    .modern-post-layout {
        padding: 1rem 0;
    }
    
    .content-wrapper {
        padding: 2rem;
        margin: 1rem;
        border-radius: 1rem;
    }
    
    .modern-post-title {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
        text-align: left;
    }
    
    .meta-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .meta-items {
        gap: 1rem;
    }
    
    .meta-item {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
    
    .taxonomy-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .taxonomy-label {
        min-width: auto;
    }
    
    .modern-post-content {
        font-size: 1rem;
    }
    
    .modern-post-content h1 {
        font-size: 2rem;
    }
    
    .modern-post-content h2 {
        font-size: 1.6rem;
    }
    
    .modern-post-content h3 {
        font-size: 1.3rem;
    }
}

@media (max-width: 767.98px) {
    .content-wrapper {
        padding: 1.5rem;
        margin: 0.5rem;
    }
    
    .modern-post-header {
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
    }
    
    .post-description {
        padding: 1.5rem;
    }
    
    .modern-post-content blockquote {
        padding: 1.5rem 2rem;
        font-size: 1.1rem;
    }
    
    .modern-post-content pre {
        padding: 1.5rem;
        font-size: 0.85rem;
    }
    
    .meta-items {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
    
    .meta-item {
        justify-content: center;
        text-align: center;
    }
}


/* ============================================
   TEAM PAGE STYLES
   ============================================ */

.team-page {
    padding: 2rem 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
}

.page-header {
    background: white;
    padding: 3rem 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 3rem;
}

.team-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    height: 100%;
    border: 1px solid rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.team-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-variant) 50%, var(--success-color) 100%);
}

.team-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.team-card.featured {
    border: 2px solid rgba(13, 110, 253, 0.2);
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.02) 0%, rgba(111, 66, 193, 0.02) 100%);
}

.team-card.featured::before {
    height: 6px;
}

.team-photo {
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
}

.team-photo img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.team-card:hover .team-photo img {
    transform: scale(1.05);
}

.photo-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    border: 4px solid white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.team-card.featured .team-photo img,
.team-card.featured .photo-placeholder {
    width: 150px;
    height: 150px;
}

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

.team-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--bs-primary);
}

.team-card.featured .team-name {
    font-size: 1.5rem;
}

.team-position {
    font-size: 1rem;
    font-weight: 600;
    color: var(--bs-secondary);
    margin-bottom: 0.5rem;
}

.team-department {
    font-size: 0.9rem;
    color: var(--bs-info);
    margin-bottom: 1rem;
}

.team-department-badge {
    display: inline-block;
    background: linear-gradient(135deg, #0dcaf0 0%, #0d6efd 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.team-bio {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--bs-body-color);
    margin-bottom: 1.5rem;
}

.team-card.featured .team-bio {
    font-size: 1rem;
}

.team-skills {
    margin-bottom: 1rem;
}

.skill-badge {
    display: inline-block;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1) 0%, rgba(111, 66, 193, 0.1) 100%);
    color: var(--bs-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0.25rem;
    border: 1px solid rgba(13, 110, 253, 0.2);
}

.team-social {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.social-link {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: white;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.social-link:hover {
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    color: white;
}

.social-link.linkedin {
    background: linear-gradient(135deg, #0077b5 0%, #005885 100%);
}

.social-link.github {
    background: linear-gradient(135deg, #333 0%, #24292e 100%);
}

.social-link.twitter {
    background: linear-gradient(135deg, #1da1f2 0%, #0d8bd9 100%);
}

.social-link.website {
    background: linear-gradient(135deg, #20c997 0%, #0dcaf0 100%);
}

/* Responsive Design */
@media (max-width: 767.98px) {
    .team-page {
        padding: 1rem 0;
    }
    
    .page-header {
        padding: 2rem 1rem;
        margin-bottom: 2rem;
    }
    
    .team-card {
        padding: 1.5rem;
    }
    
    .team-photo img,
    .photo-placeholder {
        width: 100px !important;
        height: 100px !important;
    }
    
    .team-card.featured .team-photo img,
    .team-card.featured .photo-placeholder {
        width: 120px !important;
        height: 120px !important;
    }
    
    .team-name {
        font-size: 1.1rem;
    }
    
    .team-card.featured .team-name {
        font-size: 1.3rem;
    }
}


/* ============================================
   ENHANCED CODE COPY BUTTON STYLES
   ============================================ */

/* Code Block Wrapper */
.code-block-wrapper {
    position: relative;
    margin: 3rem 0;
}

/* Copy Button Styling */
.copy-code-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: linear-gradient(135deg, #0d6efd 0%, #6f42c1 100%);
    border: none;
    border-radius: 0.5rem;
    color: white;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
    z-index: 10;
    opacity: 0;
    transform: translateY(-5px);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.code-block-wrapper:hover .copy-code-btn {
    opacity: 1;
    transform: translateY(0);
}

.copy-code-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.4);
    background: linear-gradient(135deg, #0056b3 0%, #5a32a3 100%);
}

.copy-code-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
}

/* Success state */
.copy-code-btn.success {
    background: linear-gradient(135deg, #20c997 0%, #0dcaf0 100%);
    box-shadow: 0 2px 8px rgba(32, 201, 151, 0.3);
    animation: copySuccess 0.3s ease;
}

.copy-code-btn.success:hover {
    background: linear-gradient(135deg, #198754 0%, #0b7ec8 100%);
    box-shadow: 0 4px 15px rgba(32, 201, 151, 0.4);
}

/* Error state */
.copy-code-btn.error {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

/* Enhanced pre styling */
.modern-post-content pre,
.modern-post-content .highlight pre,
.code-block-wrapper pre {
    margin: 0;
    padding: 2rem;
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: #e2e8f0;
    border-radius: 1rem;
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.6;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.1);
    position: relative;
}

.modern-post-content pre::before,
.code-block-wrapper pre::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f56565 0%, #ed8936 33%, #48bb78 66%, #4299e1 100%);
    border-radius: 1rem 1rem 0 0;
}

/* Language label */
.copy-code-btn[data-language]::before {
    content: attr(data-language);
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.8) 0%, rgba(111, 66, 193, 0.8) 100%);
    border-radius: 0.25rem;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 0.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Custom scrollbar for code blocks */
.modern-post-content pre::-webkit-scrollbar,
.code-block-wrapper pre::-webkit-scrollbar {
    height: 8px;
}

.modern-post-content pre::-webkit-scrollbar-track,
.code-block-wrapper pre::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.modern-post-content pre::-webkit-scrollbar-thumb,
.code-block-wrapper pre::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-variant) 100%);
    border-radius: 4px;
}

.modern-post-content pre::-webkit-scrollbar-thumb:hover,
.code-block-wrapper pre::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #0056b3 0%, #5a32a3 100%);
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .copy-code-btn {
        position: static;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-bottom: 0.5rem;
        opacity: 1;
        transform: none;
        font-size: 0.7rem;
        padding: 0.4rem 0.8rem;
        border-radius: 0.5rem 0.5rem 0 0;
    }
    
    .code-block-wrapper {
        margin: 2rem 0;
    }
    
    .modern-post-content pre,
    .code-block-wrapper pre {
        padding: 1.5rem;
        font-size: 0.85rem;
        border-radius: 0 0 1rem 1rem;
    }
    
    .modern-post-content pre::before,
    .code-block-wrapper pre::before {
        display: none;
    }
}

/* Animation for copy feedback */
@keyframes copySuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Tooltip enhancement */
.copy-code-btn[title]::after {
    content: attr(title);
    position: absolute;
    top: -2.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.copy-code-btn:hover[title]::after {
    opacity: 1;
}


/* ============================================
   SIDEBAR AD PLACEHOLDERS - MODERN DESIGN
   ============================================ */

/* General Ad Container Styling */
.ad-container {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 2px solid rgba(13, 110, 253, 0.1);
    background: none;
}

.ad-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0,0,0,0.12);
    border-color: rgba(13, 110, 253, 0.2);
}


/* Compact Ad Format (320x100) */
.ad-compact {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ad Placeholder Content */
.ad-placeholder {
    text-align: center;
    color: var(--bs-secondary);
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 0.5rem;
}

.ad-placeholder i {
    font-size: 2.5rem;
    color: var(--bs-primary);
    opacity: 0.6;
    margin-bottom: 0.5rem;
}

.ad-placeholder span {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--bs-primary);
}

.ad-placeholder small {
    font-size: 0.85rem;
    color: var(--bs-secondary);
    font-weight: 500;
}

/* Ad Label */
.ad-label {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: transparent;
    color: var(--bs-primary);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    border: none;
}

/* Widget Specific Styling */
.ad-widget-square,
.ad-widget-compact,
.ad-widget-bottom {
    margin-bottom: 2rem;
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .ad-square {
        min-height: 200px;
    }
    
    .ad-compact {
        height: 80px;
    }
    
    .ad-placeholder {
        padding: 1.5rem 1rem;
    }
    
    .ad-placeholder i {
        font-size: 2rem;
    }
    
    .ad-placeholder span {
        font-size: 1rem;
    }
}

@media (max-width: 767.98px) {
    .ad-square {
        min-height: 150px;
    }
    
    .ad-compact {
        height: 60px;
    }
    
    .ad-placeholder {
        padding: 1rem;
    }
    
    .ad-placeholder i {
        font-size: 1.5rem;
    }
    
    .ad-placeholder span {
        font-size: 0.9rem;
    }
    
    .ad-label {
        font-size: 0.6rem;
        padding: 0.2rem 0.4rem;
    }
}

/* Hover Effects for Better User Experience */
.ad-container .ad-placeholder {
    transition: all 0.3s ease;
}

.ad-container:hover .ad-placeholder i {
    transform: scale(1.1);
    opacity: 0.8;
}

.ad-container:hover .ad-placeholder span {
    color: var(--bs-primary);
}

/* Special Styling for Different Ad Types */
.ad-widget-square .ad-placeholder i {
    color: var(--bs-success);
}

.ad-widget-compact .ad-placeholder i {
    color: var(--bs-warning);
}

.ad-widget-bottom .ad-placeholder i {
    color: var(--bs-info);
}

/* Animation for Ad Containers */
@keyframes adSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ad-container {
    animation: adSlideIn 0.6s ease-out;
}

/* ============================================
   DYNAMIC AD SYSTEM STYLES
   ============================================ */

/* Dynamic Ad Container */
.dynamic-ad {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 2px solid rgba(13, 110, 253, 0.1);
    margin-bottom: 2rem;
    background: white;
}

.dynamic-ad:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0,0,0,0.12);
    border-color: rgba(13, 110, 253, 0.2);
}

/* Ad Size Formats */
.ad-format-rectangle {
    min-height: 280px;
    aspect-ratio: 1.2/1;
}

.ad-format-square {
    min-height: 300px;
    aspect-ratio: 1/1;
}

.ad-format-banner {
    min-height: 120px;
    aspect-ratio: 3.2/1;
}

.ad-format-leaderboard {
    min-height: 100px;
    aspect-ratio: 7.28/1;
}

.ad-format-skyscraper {
    min-height: 600px;
    aspect-ratio: 160/600;
}

/* Ad Content Container */
.ad-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border-radius: 1rem;
    overflow: hidden;
}

/* Image Ads */
.ad-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.75rem;
    transition: transform 0.3s ease;
}

.ad-image:hover img {
    transform: scale(1.02);
}

/* Video Ads */
.ad-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.75rem;
}

.ad-video .video-controls {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    background: rgba(0,0,0,0.7);
    padding: 0.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-size: 0.85rem;
}

/* External Link Ads */
.ad-external {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #dee2e6;
    color: var(--bs-secondary);
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 120px;
}

.ad-external:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: var(--bs-primary);
    color: var(--bs-primary);
    text-decoration: none;
}

.ad-external i {
    font-size: 2rem;
    opacity: 0.7;
}

.ad-external .ad-text {
    font-weight: 600;
    font-size: 1.1rem;
}

.ad-external .ad-description {
    font-size: 0.9rem;
    opacity: 0.8;
    max-width: 80%;
    line-height: 1.4;
}

/* Ad Labels and Metadata */
.ad-position-label {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: rgba(13, 110, 253, 0.9);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
}

.ad-sponsored-label {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 193, 7, 0.95);
    color: var(--bs-dark);
    /* mini placeholder: very small badge */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 16px;
    padding: 0 0.35rem;
    min-width: 36px;
    max-width: 100px;
    box-sizing: border-box;
    border-radius: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 0.58rem; /* ~10px */
    font-weight: 600;
    z-index: 10;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Make it even smaller on very small screens */
@media (max-width: 480px) {
    .ad-sponsored-label {
        height: 14px;
        font-size: 0.52rem;
        padding: 0 0.3rem;
        min-width: 30px;
        max-width: 80px;
    }
}

/* Ad Loading State */
.ad-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: adLoading 1.5s infinite;
    border-radius: 1rem;
    min-height: 200px;
}

@keyframes adLoading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Ad Error State */
.ad-error {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.05) 0%, rgba(255, 193, 7, 0.05) 100%);
    border: 2px dashed rgba(220, 53, 69, 0.3);
    color: var(--bs-danger);
    text-align: center;
    padding: 2rem 1rem;
    border-radius: 1rem;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.5rem;
}

.ad-error i {
    font-size: 2rem;
    opacity: 0.7;
}

.ad-error .error-text {
    font-weight: 600;
    font-size: 1rem;
}

.ad-error .error-description {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Responsive Visibility */
.ad-desktop-only {
    display: block;
}

.ad-mobile-only {
    display: none;
}

@media (max-width: 991.98px) {
    .ad-desktop-only {
        display: none;
    }
    
    .ad-mobile-only {
        display: block;
    }
}

/* Responsive Ad Sizes */
@media (max-width: 767.98px) {
    .ad-format-rectangle,
    .ad-format-square {
        min-height: 200px;
        aspect-ratio: 1.2/1;
    }
    
    .ad-format-banner {
        min-height: 80px;
        aspect-ratio: 4/1;
    }
    
    .ad-format-leaderboard {
        min-height: 60px;
        aspect-ratio: 5/1;
    }
    
    .ad-format-skyscraper {
        display: none; /* Hide skyscraper on mobile */
    }
    
    .ad-content {
        padding: 0.75rem;
    }
    
    .ad-position-label,
    .ad-sponsored-label {
        font-size: 0.6rem;
        padding: 0.2rem 0.4rem;
    }
    
    .ad-external .ad-text {
        font-size: 1rem;
    }
    
    .ad-external .ad-description {
        font-size: 0.8rem;
    }
}

/* Ad Hover Effects */
.dynamic-ad .ad-content {
    transition: all 0.3s ease;
}

.dynamic-ad:hover .ad-content {
    transform: scale(0.98);
}

/* Dark Mode Support */
[data-bs-theme="dark"] .dynamic-ad {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .ad-external {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
}

[data-bs-theme="dark"] .ad-external:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.08) 100%);
    border-color: var(--bs-primary);
    color: var(--bs-primary);
}

[data-bs-theme="dark"] .ad-error {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(255, 193, 7, 0.1) 100%);
    border-color: rgba(220, 53, 69, 0.5);
}

/* Animation delays for staggered effect */
.dynamic-ad:nth-child(1) { animation-delay: 0.1s; }
.dynamic-ad:nth-child(2) { animation-delay: 0.2s; }
.dynamic-ad:nth-child(3) { animation-delay: 0.3s; }
.dynamic-ad:nth-child(4) { animation-delay: 0.4s; }
.dynamic-ad:nth-child(5) { animation-delay: 0.5s; }

.animate-on-scroll {
    animation: fadeInUp 0.6s ease-out;
}

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

/* Custom styling for actual ad content */
.ad-container iframe,
.ad-container img,
.ad-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Ensure ad content fits properly */
.ad-container > *:not(.ad-placeholder):not(.ad-label):not(.ad-sponsored-label) {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ads_sidebar_top {
    width: relative;
    height: 200px;
    overflow: hidden; 
    padding: 10px;
}

.ads_sidebar_middle {
    width: relative;
    height: 500px;
    object-fit: cover; 
    overflow: hidden; 
    padding: 10px;
}

.ads_sidebar_bottom {
    width: relative;
    height: 150px;
    overflow: hidden; 
}