/* === DARK THEME VARIABLES === */

:root {
    /* Dark theme colors */
    --dark-primary-bg: #0f0f23;
    --dark-secondary-bg: #1a1a35;
    --dark-card-bg: #262650;
    --dark-accent-bg: #2d2d60;
    --dark-hover-bg: #34347a;
    /* Text colors */
    --dark-contrast-text: #ffffff;
    --dark-readable-text: #edf2f7;
    --dark-muted-text: #cbd5e0;
    --dark-light-text: #a0aec0;
    --dark-dim-text: #8b95a0;
    /* Border and effects */
    --dark-border-color: #404080;
    --dark-primary-brand: #7482fc;
    --dark-primary-brand-hover: #6366f1;
    /* Status colors */
    --dark-success-color: #10b981;
    --dark-warning-color: #f59e0b;
    --dark-danger-color: #ef4444;
    /* Gradients */
    --dark-gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --dark-gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --dark-gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    /* Shadows */
    --dark-shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --dark-shadow-elevated: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}


/* === BASE THEME === */

body[data-theme="dark"] {
    background: var(--dark-primary-bg);
    color: var(--dark-readable-text);
}

body[data-theme="dark"] a {
    color: var(--dark-primary-brand);
}

body[data-theme="dark"] a:hover {
    color: var(--dark-primary-brand-hover);
}


/* === TEXT ELEMENTS === */

body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3,
body[data-theme="dark"] h4,
body[data-theme="dark"] h5,
body[data-theme="dark"] h6 {
    color: var(--dark-contrast-text);
}

body[data-theme="dark"] p,
body[data-theme="dark"] span,
body[data-theme="dark"] div,
body[data-theme="dark"] li {
    color: var(--dark-readable-text);
}

body[data-theme="dark"] .text-muted {
    color: var(--dark-muted-text) !important;
}

body[data-theme="dark"] .text-secondary {
    color: var(--dark-muted-text) !important;
}

body[data-theme="dark"] .text-primary {
    color: var(--dark-primary-brand) !important;
}

body[data-theme="dark"] .text-dark {
    color: var(--dark-contrast-text) !important;
}


/* === POST CONTENT === */

body[data-theme="dark"] .post-title {
    color: var(--dark-contrast-text) !important;
}

body[data-theme="dark"] .post-title a {
    color: var(--dark-contrast-text) !important;
}

body[data-theme="dark"] .post-title a:hover {
    color: var(--dark-primary-brand) !important;
}

body[data-theme="dark"] .post-meta {
    color: var(--dark-muted-text) !important;
    border-top-color: var(--dark-border-color) !important;
}

body[data-theme="dark"] .post-excerpt {
    color: var(--dark-readable-text) !important;
}

body[data-theme="dark"] .category-badge {
    background: var(--dark-primary-brand);
    color: white;
}

body[data-theme="dark"] .category-badge:hover {
    background: var(--dark-primary-brand-hover);
}


/* === CAROUSEL ELEMENTS === */

body[data-theme="dark"] .featured-carousel-section {
    background: var(--dark-card-bg);
    border-color: var(--dark-border-color);
}

body[data-theme="dark"] .carousel-title {
    color: var(--dark-contrast-text) !important;
}

body[data-theme="dark"] .carousel-post-card {
    background: var(--dark-secondary-bg);
    border-color: var(--dark-border-color);
}

body[data-theme="dark"] .carousel-content {
    background: linear-gradient(rgba(15, 15, 35, 0.95), rgba(15, 15, 35, 0.98));
    color: var(--dark-contrast-text);
}

body[data-theme="dark"] .carousel-title-post {
    color: var(--dark-contrast-text) !important;
}

body[data-theme="dark"] .carousel-title-post a {
    color: var(--dark-contrast-text) !important;
}

body[data-theme="dark"] .carousel-title-post a:hover {
    color: var(--dark-primary-brand) !important;
}

body[data-theme="dark"] .carousel-category {
    background: var(--dark-primary-brand);
    color: white !important;
}

body[data-theme="dark"] .carousel-excerpt {
    color: var(--dark-readable-text) !important;
}

body[data-theme="dark"] .carousel-meta {
    color: var(--dark-muted-text) !important;
}

body[data-theme="dark"] .carousel-read-more {
    background: var(--dark-primary-brand);
    color: white !important;
    border-color: var(--dark-primary-brand);
}

body[data-theme="dark"] .carousel-read-more:hover {
    background: var(--dark-primary-brand-hover);
    border-color: var(--dark-primary-brand-hover);
}

body[data-theme="dark"] .carousel-control-prev,
body[data-theme="dark"] .carousel-control-next {
    background: rgba(15, 15, 35, 0.8) !important;
    border-color: var(--dark-border-color) !important;
}

body[data-theme="dark"] .carousel-control-prev:hover,
body[data-theme="dark"] .carousel-control-next:hover {
    background: var(--dark-primary-brand) !important;
    border-color: var(--dark-primary-brand) !important;
}

body[data-theme="dark"] .carousel-control-prev-icon,
body[data-theme="dark"] .carousel-control-next-icon {
    filter: invert(1) !important;
}

body[data-theme="dark"] .carousel-indicators [data-bs-target] {
    background-color: rgba(255, 255, 255, 0.3) !important;
    border-color: var(--dark-border-color) !important;
}

body[data-theme="dark"] .carousel-indicators [data-bs-target].active {
    background-color: var(--dark-primary-brand) !important;
    border-color: var(--dark-primary-brand) !important;
}


/* === SIDEBAR ELEMENTS === */

body[data-theme="dark"] .sidebar {
    background: var(--dark-card-bg);
    border-color: var(--dark-border-color);
}

body[data-theme="dark"] .sidebar-section {
    background: var(--dark-secondary-bg);
    border-color: var(--dark-border-color);
}

body[data-theme="dark"] .sidebar-title,
body[data-theme="dark"] .sidebar h3,
body[data-theme="dark"] .sidebar h4,
body[data-theme="dark"] .sidebar h5,
body[data-theme="dark"] .sidebar h6 {
    color: var(--dark-contrast-text) !important;
}

body[data-theme="dark"] .welcome-title {
    color: var(--dark-contrast-text) !important;
}

body[data-theme="dark"] .welcome-subtitle {
    color: var(--dark-readable-text) !important;
}

body[data-theme="dark"] .categories-sidebar {
    background: var(--dark-secondary-bg) !important;
    border-color: var(--dark-border-color) !important;
}

body[data-theme="dark"] .categories-sidebar h3 {
    color: var(--dark-contrast-text) !important;
}

body[data-theme="dark"] .category-item {
    color: var(--dark-readable-text) !important;
    background: var(--dark-card-bg) !important;
    border-color: var(--dark-border-color) !important;
}

body[data-theme="dark"] .category-item:hover {
    color: var(--dark-primary-brand) !important;
    background: var(--dark-hover-bg) !important;
    border-color: var(--dark-primary-brand) !important;
}

body[data-theme="dark"] .category-count {
    background: var(--dark-primary-brand) !important;
    color: white !important;
}

body[data-theme="dark"] .popular-posts-sidebar {
    background: var(--dark-secondary-bg);
    border-color: var(--dark-border-color);
}

body[data-theme="dark"] .popular-posts-sidebar h3 {
    color: var(--dark-contrast-text) !important;
}

body[data-theme="dark"] .popular-posts .d-flex {
    border-bottom-color: var(--dark-border-color);
}

body[data-theme="dark"] .popular-posts .d-flex a {
    color: var(--dark-readable-text) !important;
}

body[data-theme="dark"] .popular-posts .d-flex a:hover {
    color: var(--dark-primary-brand) !important;
}


/* === CARDS === */

body[data-theme="dark"] .card {
    background: var(--dark-card-bg);
    border-color: var(--dark-border-color);
}

body[data-theme="dark"] .card-header {
    background: var(--dark-secondary-bg);
    border-bottom-color: var(--dark-border-color);
}

body[data-theme="dark"] .card-body {
    color: var(--dark-readable-text);
}

body[data-theme="dark"] .card-title {
    color: var(--dark-contrast-text);
}

body[data-theme="dark"] .card-text {
    color: var(--dark-readable-text);
}


/* === FORMS === */

body[data-theme="dark"] .form-control {
    background: var(--dark-secondary-bg);
    border-color: var(--dark-border-color);
    color: var(--dark-readable-text);
}

body[data-theme="dark"] .form-control:focus {
    background: var(--dark-secondary-bg);
    border-color: var(--dark-primary-brand);
    color: var(--dark-readable-text);
    box-shadow: 0 0 0 0.25rem rgba(116, 130, 252, 0.25);
}

body[data-theme="dark"] .form-control::placeholder {
    color: var(--dark-muted-text);
}

body[data-theme="dark"] .form-label {
    color: var(--dark-readable-text);
}


/* === BUTTONS === */

body[data-theme="dark"] .btn {
    border-color: var(--dark-border-color);
}

body[data-theme="dark"] .btn-primary {
    background: var(--dark-primary-brand);
    border-color: var(--dark-primary-brand);
}

body[data-theme="dark"] .btn-primary:hover {
    background: var(--dark-primary-brand-hover);
    border-color: var(--dark-primary-brand-hover);
}

body[data-theme="dark"] .btn-secondary {
    background: var(--dark-secondary-bg);
    border-color: var(--dark-border-color);
    color: var(--dark-readable-text);
}

body[data-theme="dark"] .btn-outline-primary {
    color: var(--dark-primary-brand);
    border-color: var(--dark-primary-brand);
}

body[data-theme="dark"] .btn-outline-primary:hover {
    background: var(--dark-primary-brand);
    border-color: var(--dark-primary-brand);
    color: white;
}


/* === NAVBAR === */

body[data-theme="dark"] .navbar {
    background: var(--dark-secondary-bg) !important;
    border-bottom-color: var(--dark-border-color);
}

body[data-theme="dark"] .navbar-brand {
    color: var(--dark-contrast-text) !important;
}

body[data-theme="dark"] .nav-link {
    color: var(--dark-readable-text) !important;
}

body[data-theme="dark"] .nav-link:hover {
    color: var(--dark-primary-brand) !important;
}


/* === TABLES === */

body[data-theme="dark"] .table {
    color: var(--dark-readable-text);
}

body[data-theme="dark"] .table th {
    color: var(--dark-contrast-text);
    border-bottom-color: var(--dark-border-color);
}

body[data-theme="dark"] .table td {
    border-top-color: var(--dark-border-color);
}

body[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd) {
    background: rgba(255, 255, 255, 0.02);
}

body[data-theme="dark"] .table-hover tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}


/* === ALERTS === */

body[data-theme="dark"] .alert {
    background: var(--dark-secondary-bg);
    border-color: var(--dark-border-color);
    color: var(--dark-readable-text);
}

body[data-theme="dark"] .alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--dark-success-color);
    color: var(--dark-success-color);
}

body[data-theme="dark"] .alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--dark-danger-color);
    color: var(--dark-danger-color);
}

body[data-theme="dark"] .alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--dark-warning-color);
    color: var(--dark-warning-color);
}

body[data-theme="dark"] .alert-info {
    background: rgba(116, 130, 252, 0.1);
    border-color: var(--dark-primary-brand);
    color: var(--dark-primary-brand);
}


/* === MODALS === */

body[data-theme="dark"] .modal-content {
    background: var(--dark-card-bg);
    border-color: var(--dark-border-color);
}

body[data-theme="dark"] .modal-header {
    background: var(--dark-secondary-bg);
    border-bottom-color: var(--dark-border-color);
}

body[data-theme="dark"] .modal-title {
    color: var(--dark-contrast-text);
}

body[data-theme="dark"] .modal-body {
    color: var(--dark-readable-text);
}


/* === DROPDOWNS === */

body[data-theme="dark"] .dropdown-menu {
    background: var(--dark-card-bg);
    border-color: var(--dark-border-color);
}

body[data-theme="dark"] .dropdown-item {
    color: var(--dark-readable-text);
}

body[data-theme="dark"] .dropdown-item:hover {
    background: var(--dark-hover-bg);
    color: var(--dark-contrast-text);
}

body[data-theme="dark"] .dropdown-divider {
    border-top-color: var(--dark-border-color);
}


/* === FOOTER === */

body[data-theme="dark"] .footer {
    background: var(--dark-secondary-bg);
    border-top-color: var(--dark-border-color);
}

body[data-theme="dark"] .footer h5,
body[data-theme="dark"] .footer h6 {
    color: var(--dark-contrast-text) !important;
}

body[data-theme="dark"] .footer a {
    color: var(--dark-readable-text);
}

body[data-theme="dark"] .footer a:hover {
    color: var(--dark-primary-brand);
}


/* === PAGINATION === */

body[data-theme="dark"] .pagination .page-link {
    background: var(--dark-secondary-bg);
    border-color: var(--dark-border-color);
    color: var(--dark-readable-text);
}

body[data-theme="dark"] .pagination .page-link:hover {
    background: var(--dark-primary-brand);
    border-color: var(--dark-primary-brand);
    color: white;
}

body[data-theme="dark"] .pagination .page-item.active .page-link {
    background: var(--dark-primary-brand);
    border-color: var(--dark-primary-brand);
    color: white;
}


/* === BREADCRUMBS === */

body[data-theme="dark"] .breadcrumb {
    background: var(--dark-accent-bg);
}

body[data-theme="dark"] .breadcrumb-item {
    color: var(--dark-muted-text);
}

body[data-theme="dark"] .breadcrumb-item.active {
    color: var(--dark-contrast-text);
}

body[data-theme="dark"] .breadcrumb-item a {
    color: var(--dark-primary-brand);
}


/* === SEARCH RESULTS === */

body[data-theme="dark"] .search-result-title {
    color: var(--dark-contrast-text) !important;
}

body[data-theme="dark"] .search-result-title a {
    color: var(--dark-primary-brand) !important;
}

body[data-theme="dark"] .search-result-snippet {
    color: var(--dark-readable-text) !important;
}

body[data-theme="dark"] .search-result-url {
    color: var(--dark-muted-text) !important;
}


/* === STATUS INDICATORS === */

body[data-theme="dark"] .status-good,
body[data-theme="dark"] .link-ok {
    color: var(--dark-success-color) !important;
}

body[data-theme="dark"] .status-warning {
    color: var(--dark-warning-color) !important;
}

body[data-theme="dark"] .status-danger,
body[data-theme="dark"] .status-bad,
body[data-theme="dark"] .link-broken {
    color: var(--dark-danger-color) !important;
}

body[data-theme="dark"] .link-error {
    color: var(--dark-warning-color) !important;
}

body[data-theme="dark"] .link-skipped {
    color: var(--dark-muted-text) !important;
}


/* === ARCHIVE ELEMENTS === */

body[data-theme="dark"] .archive-title {
    color: var(--dark-contrast-text) !important;
}

body[data-theme="dark"] .archive-description {
    color: var(--dark-readable-text) !important;
}

body[data-theme="dark"] .post-date {
    color: var(--dark-muted-text) !important;
}

body[data-theme="dark"] .post-author {
    color: var(--dark-muted-text) !important;
}


/* === NEWSLETTER ELEMENTS === */

body[data-theme="dark"] .newsletter-popup-content {
    background: var(--dark-secondary-bg);
    color: var(--dark-readable-text);
    border-color: var(--dark-border-color);
}

body[data-theme="dark"] .newsletter-form-side h3 {
    color: var(--dark-primary-brand) !important;
}

body[data-theme="dark"] .newsletter-popup-form p {
    color: var(--dark-muted-text) !important;
}

body[data-theme="dark"] .newsletter-section {
    background: var(--dark-secondary-bg);
    border-color: var(--dark-border-color);
}

body[data-theme="dark"] .newsletter-section h3 {
    color: var(--dark-contrast-text) !important;
}

body[data-theme="dark"] .newsletter-section p {
    color: var(--dark-readable-text) !important;
}


/* === SOCIAL SHARING === */

body[data-theme="dark"] .social-share-buttons {
    background: var(--dark-secondary-bg);
    border-color: var(--dark-border-color);
}

body[data-theme="dark"] .social-share-label {
    color: var(--dark-readable-text);
}

body[data-theme="dark"] .social-link {
    color: var(--dark-readable-text);
    background: var(--dark-secondary-bg);
    border-color: var(--dark-border-color);
}

body[data-theme="dark"] .social-link:hover {
    color: white;
    background: var(--dark-primary-brand);
    border-color: var(--dark-primary-brand);
}


/* === COOKIE NOTICE === */

body[data-theme="dark"] #cookieNotice {
    background: var(--dark-secondary-bg) !important;
    color: var(--dark-readable-text) !important;
    border-top-color: var(--dark-border-color);
}


/* === CODE ELEMENTS === */

body[data-theme="dark"] pre {
    background: rgba(31, 41, 55, 0.8);
    border-color: var(--dark-border-color);
    color: var(--dark-readable-text);
}

body[data-theme="dark"] code {
    background: rgba(116, 130, 252, 0.1);
    color: var(--dark-primary-brand);
}

body[data-theme="dark"] blockquote {
    background: var(--dark-secondary-bg);
    border-left-color: var(--dark-primary-brand);
    color: var(--dark-readable-text);
}


/* === SCROLLBAR === */

body[data-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
}

body[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--dark-secondary-bg);
}

body[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--dark-primary-brand);
    border-radius: 4px;
}

body[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--dark-primary-brand-hover);
}


/* === SELECTION === */

body[data-theme="dark"] ::selection {
    background: rgba(116, 130, 252, 0.3);
    color: var(--dark-contrast-text);
}

body[data-theme="dark"] ::-moz-selection {
    background: rgba(116, 130, 252, 0.3);
    color: var(--dark-contrast-text);
}


/* === FOCUS STYLES === */

body[data-theme="dark"] *:focus-visible {
    outline: 2px solid var(--dark-primary-brand);
    outline-offset: 2px;
}


/* === HERO POST === */

body[data-theme="dark"] .hero-post {
    background: var(--dark-gradient-primary);
}

body[data-theme="dark"] .hero-post-bg {
    opacity: 0.3;
}

body[data-theme="dark"] .hero-post-content {
    background: linear-gradient(transparent, rgba(15, 15, 35, 0.95));
    color: var(--dark-contrast-text);
}

body[data-theme="dark"] .hero-post-content .display-6 {
    color: var(--dark-contrast-text) !important;
}

body[data-theme="dark"] .hero-post-content .lead {
    color: rgba(255, 255, 255, 0.9) !important;
}


/* === SPINNER === */

body[data-theme="dark"] .spinner-border {
    color: var(--dark-primary-brand);
}


/* === BADGES === */

body[data-theme="dark"] .badge {
    background: var(--dark-primary-brand);
    color: white;
}

body[data-theme="dark"] .badge.bg-secondary {
    background: var(--dark-secondary-bg) !important;
    color: var(--dark-readable-text);
}


/* === THEME TOGGLE === */

body[data-theme="dark"] #theme-toggle {
    background: var(--dark-secondary-bg);
    color: var(--dark-readable-text);
    border-color: var(--dark-border-color);
}

body[data-theme="dark"] #theme-toggle:hover {
    background: var(--dark-primary-brand);
    color: white;
    border-color: var(--dark-primary-brand);
}


/* === UTILITY CLASSES === */

body[data-theme="dark"] .bg-light {
    background: var(--dark-secondary-bg) !important;
}

body[data-theme="dark"] .bg-dark {
    background: var(--dark-primary-bg) !important;
}

body[data-theme="dark"] .text-white-50 {
    color: rgba(255, 255, 255, 0.5) !important;
}

body[data-theme="dark"] .text-light {
    color: var(--dark-readable-text) !important;
}

body[data-theme="dark"] .text-info {
    color: var(--dark-primary-brand) !important;
}

body[data-theme="dark"] .text-success {
    color: var(--dark-success-color) !important;
}

body[data-theme="dark"] .text-warning {
    color: var(--dark-warning-color) !important;
}

body[data-theme="dark"] .text-danger {
    color: var(--dark-danger-color) !important;
}


/* === WIDGET ELEMENTS === */

body[data-theme="dark"] .widget-title {
    color: var(--dark-contrast-text) !important;
}

body[data-theme="dark"] .widget-content {
    color: var(--dark-readable-text) !important;
}

body[data-theme="dark"] .post-hero-title {
    color: var(--dark-contrast-text) !important;
}

body[data-theme="dark"] .page-title {
    color: var(--dark-contrast-text) !important;
}

body[data-theme="dark"] .section-title {
    color: var(--dark-contrast-text) !important;
}


/* === POST GRID TEXT VISIBILITY === */

body[data-theme="dark"] .post-card .post-title {
    color: var(--dark-contrast-text) !important;
}

body[data-theme="dark"] .post-card .post-title a {
    color: var(--dark-contrast-text) !important;
}

body[data-theme="dark"] .post-card .post-title a:hover {
    color: var(--dark-primary-brand) !important;
}

body[data-theme="dark"] .post-card .post-excerpt {
    color: var(--dark-readable-text) !important;
}

body[data-theme="dark"] .post-card .post-date {
    color: var(--dark-muted-text) !important;
}

body[data-theme="dark"] .post-card .post-author {
    color: var(--dark-muted-text) !important;
}

body[data-theme="dark"] .post-card .post-date i,
body[data-theme="dark"] .post-card .post-author i {
    color: var(--dark-muted-text) !important;
}


/* Post Statistics */

body[data-theme="dark"] .post-card .stat-number {
    color: var(--dark-contrast-text) !important;
}

body[data-theme="dark"] .post-card .stat-label {
    color: var(--dark-muted-text) !important;
}

body[data-theme="dark"] .post-card .stat-item i {
    color: var(--dark-primary-brand) !important;
}


/* Reading Time */

body[data-theme="dark"] .post-card .reading-time {
    color: var(--dark-muted-text) !important;
}

body[data-theme="dark"] .post-card .reading-time i {
    color: var(--dark-muted-text) !important;
}


/* Tag Links */

body[data-theme="dark"] .post-card .tag-link {
    color: var(--dark-primary-brand) !important;
    background: rgba(116, 130, 252, 0.1);
    border-color: var(--dark-primary-brand);
}

body[data-theme="dark"] .post-card .tag-link:hover {
    color: white !important;
    background: var(--dark-primary-brand) !important;
}


/* Read More Button */

body[data-theme="dark"] .post-card .read-more-btn {
    color: var(--dark-primary-brand) !important;
    border-color: var(--dark-primary-brand);
}

body[data-theme="dark"] .post-card .read-more-btn:hover {
    color: white !important;
    background: var(--dark-primary-brand) !important;
    border-color: var(--dark-primary-brand) !important;
}

body[data-theme="dark"] .post-card .read-more-btn i {
    color: inherit !important;
}


/* Engagement Footer */

body[data-theme="dark"] .post-card .engagement-stats {
    border-top-color: var(--dark-border-color);
}

body[data-theme="dark"] .post-card .post-footer {
    border-top-color: var(--dark-border-color);
}


/* Post Extras */

body[data-theme="dark"] .post-card .post-extras {
    color: var(--dark-muted-text);
}

body[data-theme="dark"] .post-card .post-tags {
    color: var(--dark-muted-text);
}


/* Layout Specific Fixes */

body[data-theme="dark"] .layout-grid .post-title,
body[data-theme="dark"] .layout-list .post-title,
body[data-theme="dark"] .layout-compact .post-title {
    color: var(--dark-contrast-text) !important;
}

body[data-theme="dark"] .layout-grid .post-title a,
body[data-theme="dark"] .layout-list .post-title a,
body[data-theme="dark"] .layout-compact .post-title a {
    color: var(--dark-contrast-text) !important;
}

body[data-theme="dark"] .layout-grid .post-title a:hover,
body[data-theme="dark"] .layout-list .post-title a:hover,
body[data-theme="dark"] .layout-compact .post-title a:hover {
    color: var(--dark-primary-brand) !important;
}

body[data-theme="dark"] .layout-grid .post-excerpt,
body[data-theme="dark"] .layout-list .post-excerpt,
body[data-theme="dark"] .layout-compact .post-excerpt {
    color: var(--dark-readable-text) !important;
}


/* Carousel Post Text */

body[data-theme="dark"] .carousel-post-card .post-title,
body[data-theme="dark"] .carousel-post-card .post-title a {
    color: var(--dark-contrast-text) !important;
}

body[data-theme="dark"] .carousel-post-card .post-title a:hover {
    color: var(--dark-primary-brand) !important;
}


/* General Post Content */

body[data-theme="dark"] .post-content p,
body[data-theme="dark"] .post-body p,
body[data-theme="dark"] .post-text {
    color: var(--dark-readable-text) !important;
}


/* Post Meta Elements */

body[data-theme="dark"] .post-meta-item,
body[data-theme="dark"] .post-metadata,
body[data-theme="dark"] .post-info {
    color: var(--dark-muted-text) !important;
}


/* Additional Text Elements */

body[data-theme="dark"] .post-summary,
body[data-theme="dark"] .post-description,
body[data-theme="dark"] .post-intro {
    color: var(--dark-readable-text) !important;
}


/* Quick Action Buttons */

body[data-theme="dark"] .quick-action-btn {
    color: var(--dark-muted-text) !important;
    background: var(--dark-secondary-bg);
    border-color: var(--dark-border-color);
}

body[data-theme="dark"] .quick-action-btn:hover {
    color: var(--dark-primary-brand) !important;
    background: var(--dark-hover-bg) !important;
    border-color: var(--dark-primary-brand) !important;
}


/* Post Actions */

body[data-theme="dark"] .post-actions a,
body[data-theme="dark"] .post-actions button {
    color: var(--dark-readable-text) !important;
}

body[data-theme="dark"] .post-actions a:hover,
body[data-theme="dark"] .post-actions button:hover {
    color: var(--dark-primary-brand) !important;
}


/* === ADDITIONAL TEXT VISIBILITY FIXES === */


/* Ensure all text in post cards is visible */

body[data-theme="dark"] .post-card * {
    color: var(--dark-readable-text);
}


/* Override for specific important elements */

body[data-theme="dark"] .post-card h1,
body[data-theme="dark"] .post-card h2,
body[data-theme="dark"] .post-card h3,
body[data-theme="dark"] .post-card h4,
body[data-theme="dark"] .post-card h5,
body[data-theme="dark"] .post-card h6 {
    color: var(--dark-contrast-text) !important;
}

body[data-theme="dark"] .post-card h1 a,
body[data-theme="dark"] .post-card h2 a,
body[data-theme="dark"] .post-card h3 a,
body[data-theme="dark"] .post-card h4 a,
body[data-theme="dark"] .post-card h5 a,
body[data-theme="dark"] .post-card h6 a {
    color: var(--dark-contrast-text) !important;
}


/* Text content in cards */

body[data-theme="dark"] .post-card p,
body[data-theme="dark"] .post-card span,
body[data-theme="dark"] .post-card div {
    color: var(--dark-readable-text) !important;
}


/* Links in post cards */

body[data-theme="dark"] .post-card a {
    color: var(--dark-primary-brand) !important;
}

body[data-theme="dark"] .post-card a:hover {
    color: var(--dark-primary-brand-hover) !important;
}


/* Icons in post cards */

body[data-theme="dark"] .post-card i,
body[data-theme="dark"] .post-card .fas,
body[data-theme="dark"] .post-card .far,
body[data-theme="dark"] .post-card .fab {
    color: var(--dark-muted-text) !important;
}


/* Small text elements */

body[data-theme="dark"] .post-card small,
body[data-theme="dark"] .post-card .small {
    color: var(--dark-muted-text) !important;
}


/* Muted text */

body[data-theme="dark"] .post-card .text-muted {
    color: var(--dark-muted-text) !important;
}


/* Make sure no text is completely invisible */

body[data-theme="dark"] .post-card .text-dark {
    color: var(--dark-contrast-text) !important;
}

body[data-theme="dark"] .post-card .text-light {
    color: var(--dark-readable-text) !important;
}


/* Post card overlays and backgrounds */

body[data-theme="dark"] .post-overlay {
    background: linear-gradient(transparent, rgba(15, 15, 35, 0.95));
}

body[data-theme="dark"] .post-overlay * {
    color: var(--dark-contrast-text) !important;
}


/* Category labels and badges in posts */

body[data-theme="dark"] .post-card .category,
body[data-theme="dark"] .post-card .label,
body[data-theme="dark"] .post-card .badge {
    background: var(--dark-primary-brand) !important;
    color: white !important;
}


/* Engagement elements visibility */

body[data-theme="dark"] .engagement-stats *,
body[data-theme="dark"] .post-footer * {
    color: var(--dark-readable-text) !important;
}

body[data-theme="dark"] .engagement-stats .stat-number {
    color: var(--dark-contrast-text) !important;
}


/* Make sure any remaining invisible text is caught */

body[data-theme="dark"] .post-card [style*="color: #000"],
body[data-theme="dark"] .post-card [style*="color: black"],
body[data-theme="dark"] .post-card [style*="color: #333"] {
    color: var(--dark-readable-text) !important;
}


/* === FORCE POST CARD VISIBILITY WITH MAXIMUM SPECIFICITY === */


/* Post card backgrounds - ensure they're dark */

body[data-theme="dark"] .post-card,
body[data-theme="dark"] article.post-card,
body[data-theme="dark"] .layout-grid .post-card,
body[data-theme="dark"] .layout-list .post-card,
body[data-theme="dark"] .layout-compact .post-card {
    background: var(--dark-card-bg) !important;
    border-color: var(--dark-border-color) !important;
}


/* Force post card body backgrounds */

body[data-theme="dark"] .post-card .card-body,
body[data-theme="dark"] .post-card .post-content,
body[data-theme="dark"] .post-card .post-body {
    background: var(--dark-card-bg) !important;
}


/* FORCE ALL TEXT TO BE VISIBLE - Maximum specificity */

body[data-theme="dark"] .post-card,
body[data-theme="dark"] .post-card *,
body[data-theme="dark"] .post-card *:before,
body[data-theme="dark"] .post-card *:after {
    color: var(--dark-readable-text) !important;
}


/* FORCE HEADINGS TO BE WHITE */

body[data-theme="dark"] .post-card h1,
body[data-theme="dark"] .post-card h2,
body[data-theme="dark"] .post-card h3,
body[data-theme="dark"] .post-card h4,
body[data-theme="dark"] .post-card h5,
body[data-theme="dark"] .post-card h6,
body[data-theme="dark"] .post-card .post-title,
body[data-theme="dark"] .post-card .card-title {
    color: var(--dark-contrast-text) !important;
    background: transparent !important;
}


/* FORCE ALL LINKS TO BE VISIBLE */

body[data-theme="dark"] .post-card a,
body[data-theme="dark"] .post-card a *,
body[data-theme="dark"] .post-card .post-title a,
body[data-theme="dark"] .post-card h1 a,
body[data-theme="dark"] .post-card h2 a,
body[data-theme="dark"] .post-card h3 a,
body[data-theme="dark"] .post-card h4 a,
body[data-theme="dark"] .post-card h5 a,
body[data-theme="dark"] .post-card h6 a {
    color: var(--dark-contrast-text) !important;
    background: transparent !important;
}


/* FORCE ALL PARAGRAPHS AND TEXT TO BE VISIBLE */

body[data-theme="dark"] .post-card p,
body[data-theme="dark"] .post-card span,
body[data-theme="dark"] .post-card div,
body[data-theme="dark"] .post-card .post-excerpt,
body[data-theme="dark"] .post-card .card-text,
body[data-theme="dark"] .post-card .text-muted,
body[data-theme="dark"] .post-card .post-meta,
body[data-theme="dark"] .post-card .post-date,
body[data-theme="dark"] .post-card .post-author {
    color: var(--dark-readable-text) !important;
    background: transparent !important;
}


/* FORCE METADATA TO BE VISIBLE */

body[data-theme="dark"] .post-card .post-meta *,
body[data-theme="dark"] .post-card .engagement-stats *,
body[data-theme="dark"] .post-card .post-footer *,
body[data-theme="dark"] .post-card .stat-number,
body[data-theme="dark"] .post-card .stat-label {
    color: var(--dark-muted-text) !important;
    background: transparent !important;
}


/* FORCE NUMBERS TO BE WHITE */

body[data-theme="dark"] .post-card .stat-number {
    color: var(--dark-contrast-text) !important;
}


/* FORCE BUTTONS TO BE VISIBLE */

body[data-theme="dark"] .post-card .btn,
body[data-theme="dark"] .post-card .read-more-btn,
body[data-theme="dark"] .post-card button {
    background: var(--dark-primary-brand) !important;
    color: white !important;
    border-color: var(--dark-primary-brand) !important;
}


/* FORCE SMALL TEXT TO BE VISIBLE */

body[data-theme="dark"] .post-card small,
body[data-theme="dark"] .post-card .small,
body[data-theme="dark"] .post-card .reading-time {
    color: var(--dark-muted-text) !important;
    background: transparent !important;
}


/* Override any inline styles that might be making text invisible */

body[data-theme="dark"] .post-card [style*="color:"],
body[data-theme="dark"] .post-card [style*="color "],
body[data-theme="dark"] .post-card [style*="background:"],
body[data-theme="dark"] .post-card [style*="background "] {
    color: var(--dark-readable-text) !important;
    background: transparent !important;
}


/* FORCE specific problem elements */

body[data-theme="dark"] .post-card .text-dark,
body[data-theme="dark"] .post-card .text-black {
    color: var(--dark-contrast-text) !important;
}

body[data-theme="dark"] .post-card .text-secondary {
    color: var(--dark-muted-text) !important;
}


/* Ensure no white backgrounds on text containers */

body[data-theme="dark"] .post-card .card-body,
body[data-theme="dark"] .post-card .card-content,
body[data-theme="dark"] .post-card .post-content,
body[data-theme="dark"] .post-card .content {
    background: var(--dark-card-bg) !important;
    color: var(--dark-readable-text) !important;
}


/* Make sure carousel posts are also visible */

body[data-theme="dark"] .carousel-post-card,
body[data-theme="dark"] .carousel-post-card * {
    color: var(--dark-readable-text) !important;
    background: transparent !important;
}

body[data-theme="dark"] .carousel-post-card h1,
body[data-theme="dark"] .carousel-post-card h2,
body[data-theme="dark"] .carousel-post-card h3,
body[data-theme="dark"] .carousel-post-card .post-title {
    color: var(--dark-contrast-text) !important;
}


/* === NUCLEAR OPTION - ABSOLUTE VISIBILITY ENFORCEMENT === */


/* Override absolutely everything in post cards */

body[data-theme="dark"] .post-card *:not(img):not(svg):not(iframe) {
    color: var(--dark-readable-text) !important;
    background-color: transparent !important;
}


/* Emergency headings override */

body[data-theme="dark"] .post-card *[class*="title"],
body[data-theme="dark"] .post-card *[class*="heading"],
body[data-theme="dark"] .post-card *[class*="header"] {
    color: var(--dark-contrast-text) !important;
}


/* Emergency text override for any missed elements */

body[data-theme="dark"] .post-card *[class*="text"],
body[data-theme="dark"] .post-card *[class*="content"],
body[data-theme="dark"] .post-card *[class*="description"],
body[data-theme="dark"] .post-card *[class*="excerpt"] {
    color: var(--dark-readable-text) !important;
}


/* Force override for Bootstrap classes */

body[data-theme="dark"] .post-card .text-primary,
body[data-theme="dark"] .post-card .text-info,
body[data-theme="dark"] .post-card .text-success,
body[data-theme="dark"] .post-card .text-warning,
body[data-theme="dark"] .post-card .text-danger {
    color: var(--dark-primary-brand) !important;
}


/* Catch-all for any remaining invisible text */

body[data-theme="dark"] .post-card *[style*="color: rgb(0, 0, 0)"],
body[data-theme="dark"] .post-card *[style*="color: #000000"],
body[data-theme="dark"] .post-card *[style*="color: #000"],
body[data-theme="dark"] .post-card *[style*="color:rgb(0,0,0)"],
body[data-theme="dark"] .post-card *[style*="color:#000000"],
body[data-theme="dark"] .post-card *[style*="color:#000"],
body[data-theme="dark"] .post-card *[style*="color: black"] {
    color: var(--dark-readable-text) !important;
}


/* Emergency meta information visibility */

body[data-theme="dark"] .post-card *[class*="meta"],
body[data-theme="dark"] .post-card *[class*="info"],
body[data-theme="dark"] .post-card *[class*="date"],
body[data-theme="dark"] .post-card *[class*="author"],
body[data-theme="dark"] .post-card *[class*="time"] {
    color: var(--dark-muted-text) !important;
}


/* Force visibility for any CSS Grid or Flexbox children */

body[data-theme="dark"] .post-card>*,
body[data-theme="dark"] .post-card>*>*,
body[data-theme="dark"] .post-card>*>*>* {
    color: var(--dark-readable-text) !important;
}


/* Specific emergency overrides for common frameworks */

body[data-theme="dark"] .post-card .card-text,
body[data-theme="dark"] .post-card .card-body,
body[data-theme="dark"] .post-card .media-body,
body[data-theme="dark"] .post-card .content-body {
    color: var(--dark-readable-text) !important;
    background: transparent !important;
}


/* Final safety net - ensure minimum contrast */

body[data-theme="dark"] .post-card *[style*="color"],
body[data-theme="dark"] .post-card *[style*="background"],
body[data-theme="dark"] .post-card *[class*="bg-"] {
    color: var(--dark-readable-text) !important;
}


/* Ensure white text for important headings */

body[data-theme="dark"] .post-card h1,
body[data-theme="dark"] .post-card h2,
body[data-theme="dark"] .post-card h3 {
    color: var(--dark-contrast-text) !important;
    text-shadow: none !important;
}


/* Make links stand out */

body[data-theme="dark"] .post-card a {
    color: var(--dark-primary-brand) !important;
    text-decoration: underline !important;
}

body[data-theme="dark"] .post-card a:hover {
    color: var(--dark-primary-brand-hover) !important;
}


/* Debug: Add a subtle border to see post card boundaries */

body[data-theme="dark"] .post-card {
    border: 1px solid var(--dark-border-color) !important;
    background: var(--dark-card-bg) !important;
}


/* === CATEGORIES PAGE TEXT VISIBILITY === */


/* Category listing page */

body[data-theme="dark"] .categories-page *:not(img):not(svg):not(iframe),
body[data-theme="dark"] .category-page *:not(img):not(svg):not(iframe),
body[data-theme="dark"] .category-listing *:not(img):not(svg):not(iframe) {
    color: var(--dark-readable-text) !important;
    background-color: transparent !important;
}


/* Category items and badges */

body[data-theme="dark"] .category-item,
body[data-theme="dark"] .category-item *,
body[data-theme="dark"] .category-badge,
body[data-theme="dark"] .category-badge * {
    color: var(--dark-readable-text) !important;
    background: var(--dark-card-bg) !important;
    border-color: var(--dark-border-color) !important;
}


/* Category titles and headers */

body[data-theme="dark"] .category-item h1,
body[data-theme="dark"] .category-item h2,
body[data-theme="dark"] .category-item h3,
body[data-theme="dark"] .category-item h4,
body[data-theme="dark"] .category-item h5,
body[data-theme="dark"] .category-item h6,
body[data-theme="dark"] .category-item .category-title,
body[data-theme="dark"] .category-item .category-name {
    color: var(--dark-contrast-text) !important;
}


/* Category counts and metadata */

body[data-theme="dark"] .category-count,
body[data-theme="dark"] .category-meta,
body[data-theme="dark"] .category-description {
    color: var(--dark-muted-text) !important;
}


/* Category links */

body[data-theme="dark"] .category-item a,
body[data-theme="dark"] .category-badge a {
    color: var(--dark-primary-brand) !important;
    text-decoration: underline !important;
}

body[data-theme="dark"] .category-item a:hover,
body[data-theme="dark"] .category-badge a:hover {
    color: var(--dark-primary-brand-hover) !important;
}


/* === VIEW PAGE TEXT VISIBILITY === */


/* Post/Page view main content */

body[data-theme="dark"] .post-hero-content,
body[data-theme="dark"] .post-hero-content *,
body[data-theme="dark"] .post-content-area,
body[data-theme="dark"] .post-content-area *,
body[data-theme="dark"] .post-content-body,
body[data-theme="dark"] .post-content-body *,
body[data-theme="dark"] .content-article,
body[data-theme="dark"] .content-article *,
body[data-theme="dark"] .content-body,
body[data-theme="dark"] .content-body * {
    color: var(--dark-readable-text) !important;
    background-color: transparent !important;
}


/* Page/Post titles */

body[data-theme="dark"] .page-title,
body[data-theme="dark"] .post-title,
body[data-theme="dark"] .content-article h1,
body[data-theme="dark"] .content-body h1,
body[data-theme="dark"] .post-hero-content h1,
body[data-theme="dark"] .post-content-area h1,
body[data-theme="dark"] .post-content-body h1 {
    color: var(--dark-contrast-text) !important;
}


/* All headings in content */

body[data-theme="dark"] .content-article h1,
body[data-theme="dark"] .content-article h2,
body[data-theme="dark"] .content-article h3,
body[data-theme="dark"] .content-article h4,
body[data-theme="dark"] .content-article h5,
body[data-theme="dark"] .content-article h6,
body[data-theme="dark"] .content-body h1,
body[data-theme="dark"] .content-body h2,
body[data-theme="dark"] .content-body h3,
body[data-theme="dark"] .content-body h4,
body[data-theme="dark"] .content-body h5,
body[data-theme="dark"] .content-body h6,
body[data-theme="dark"] .post-content-body h1,
body[data-theme="dark"] .post-content-body h2,
body[data-theme="dark"] .post-content-body h3,
body[data-theme="dark"] .post-content-body h4,
body[data-theme="dark"] .post-content-body h5,
body[data-theme="dark"] .post-content-body h6 {
    color: var(--dark-contrast-text) !important;
}


/* Content paragraphs and text */

body[data-theme="dark"] .content-article p,
body[data-theme="dark"] .content-body p,
body[data-theme="dark"] .post-content-body p,
body[data-theme="dark"] .content-article div,
body[data-theme="dark"] .content-body div,
body[data-theme="dark"] .post-content-body div,
body[data-theme="dark"] .content-article span,
body[data-theme="dark"] .content-body span,
body[data-theme="dark"] .post-content-body span {
    color: var(--dark-readable-text) !important;
}


/* Content links */

body[data-theme="dark"] .content-article a,
body[data-theme="dark"] .content-body a,
body[data-theme="dark"] .post-content-body a {
    color: var(--dark-primary-brand) !important;
    text-decoration: underline !important;
}

body[data-theme="dark"] .content-article a:hover,
body[data-theme="dark"] .content-body a:hover,
body[data-theme="dark"] .post-content-body a:hover {
    color: var(--dark-primary-brand-hover) !important;
}


/* === AUTHOR AND METADATA VISIBILITY === */


/* Author information */

body[data-theme="dark"] .author-name,
body[data-theme="dark"] .author-info,
body[data-theme="dark"] .author-section,
body[data-theme="dark"] .author-section * {
    color: var(--dark-readable-text) !important;
    background-color: transparent !important;
}

body[data-theme="dark"] .author-name {
    color: var(--dark-contrast-text) !important;
}


/* Post metadata */

body[data-theme="dark"] .post-meta,
body[data-theme="dark"] .post-meta *,
body[data-theme="dark"] .post-date,
body[data-theme="dark"] .post-author,
body[data-theme="dark"] .post-category,
body[data-theme="dark"] .post-tags {
    color: var(--dark-muted-text) !important;
}


/* === STATISTICS AND COUNTS === */


/* Statistics */

body[data-theme="dark"] .stat-number,
body[data-theme="dark"] .stat-mini-label,
body[data-theme="dark"] .stat-label {
    color: var(--dark-contrast-text) !important;
}

body[data-theme="dark"] .stat-mini-label,
body[data-theme="dark"] .stat-label {
    color: var(--dark-muted-text) !important;
}


/* === SEARCH RESULTS VISIBILITY === */


/* Search result content */

body[data-theme="dark"] .search-result-content,
body[data-theme="dark"] .search-result-content *,
body[data-theme="dark"] .search-results,
body[data-theme="dark"] .search-results * {
    color: var(--dark-readable-text) !important;
    background-color: transparent !important;
}


/* Search result titles */

body[data-theme="dark"] .search-result-content h1,
body[data-theme="dark"] .search-result-content h2,
body[data-theme="dark"] .search-result-content h3,
body[data-theme="dark"] .search-result-content h4,
body[data-theme="dark"] .search-result-content h5,
body[data-theme="dark"] .search-result-content h6,
body[data-theme="dark"] .search-results h1,
body[data-theme="dark"] .search-results h2,
body[data-theme="dark"] .search-results h3,
body[data-theme="dark"] .search-results h4,
body[data-theme="dark"] .search-results h5,
body[data-theme="dark"] .search-results h6 {
    color: var(--dark-contrast-text) !important;
}


/* === TIMELINE AND LIST VIEWS === */


/* Timeline content */

body[data-theme="dark"] .timeline-content,
body[data-theme="dark"] .timeline-content *,
body[data-theme="dark"] .list-content,
body[data-theme="dark"] .list-content * {
    color: var(--dark-readable-text) !important;
    background-color: transparent !important;
}


/* Timeline headings */

body[data-theme="dark"] .timeline-content h1,
body[data-theme="dark"] .timeline-content h2,
body[data-theme="dark"] .timeline-content h3,
body[data-theme="dark"] .timeline-content h4,
body[data-theme="dark"] .timeline-content h5,
body[data-theme="dark"] .timeline-content h6,
body[data-theme="dark"] .list-content h1,
body[data-theme="dark"] .list-content h2,
body[data-theme="dark"] .list-content h3,
body[data-theme="dark"] .list-content h4,
body[data-theme="dark"] .list-content h5,
body[data-theme="dark"] .list-content h6 {
    color: var(--dark-contrast-text) !important;
}


/* === WELCOME AND HERO SECTIONS === */


/* Welcome content */

body[data-theme="dark"] .welcome-content,
body[data-theme="dark"] .welcome-content *,
body[data-theme="dark"] .welcome-description,
body[data-theme="dark"] .hero-section,
body[data-theme="dark"] .hero-section * {
    color: var(--dark-readable-text) !important;
    background-color: transparent !important;
}


/* Welcome headings */

body[data-theme="dark"] .welcome-content h1,
body[data-theme="dark"] .welcome-content h2,
body[data-theme="dark"] .welcome-content h3,
body[data-theme="dark"] .welcome-content h4,
body[data-theme="dark"] .welcome-content h5,
body[data-theme="dark"] .welcome-content h6,
body[data-theme="dark"] .hero-section h1,
body[data-theme="dark"] .hero-section h2,
body[data-theme="dark"] .hero-section h3,
body[data-theme="dark"] .hero-section h4,
body[data-theme="dark"] .hero-section h5,
body[data-theme="dark"] .hero-section h6 {
    color: var(--dark-contrast-text) !important;
}


/* === COMMENT SECTIONS === */


/* Comment content */

body[data-theme="dark"] .comment-content,
body[data-theme="dark"] .comment-content *,
body[data-theme="dark"] .comment-header,
body[data-theme="dark"] .comment-header *,
body[data-theme="dark"] .comment-body,
body[data-theme="dark"] .comment-body * {
    color: var(--dark-readable-text) !important;
    background: var(--dark-card-bg) !important;
    border-color: var(--dark-border-color) !important;
}


/* Comment author names */

body[data-theme="dark"] .comment-author,
body[data-theme="dark"] .comment-author-name {
    color: var(--dark-contrast-text) !important;
}


/* Comment metadata */

body[data-theme="dark"] .comment-date,
body[data-theme="dark"] .comment-meta,
body[data-theme="dark"] .comment-time {
    color: var(--dark-muted-text) !important;
}


/* === EMERGENCY OVERRIDES FOR MISSED ELEMENTS === */


/* Nuclear option for any remaining invisible text */

body[data-theme="dark"] .content-article *:not(img):not(svg):not(iframe),
body[data-theme="dark"] .content-body *:not(img):not(svg):not(iframe),
body[data-theme="dark"] .post-content-body *:not(img):not(svg):not(iframe),
body[data-theme="dark"] .post-content-area *:not(img):not(svg):not(iframe),
body[data-theme="dark"] .post-hero-content *:not(img):not(svg):not(iframe) {
    color: var(--dark-readable-text) !important;
    background-color: transparent !important;
}


/* Override any Bootstrap utility classes */

body[data-theme="dark"] .text-dark,
body[data-theme="dark"] .text-black,
body[data-theme="dark"] .text-body {
    color: var(--dark-readable-text) !important;
}

body[data-theme="dark"] .text-muted {
    color: var(--dark-muted-text) !important;
}

body[data-theme="dark"] .text-primary {
    color: var(--dark-primary-brand) !important;
}


/* Force visibility for any inline styles */

body[data-theme="dark"] .content-article *[style*="color"],
body[data-theme="dark"] .content-body *[style*="color"],
body[data-theme="dark"] .post-content-body *[style*="color"],
body[data-theme="dark"] .category-item *[style*="color"],
body[data-theme="dark"] .search-result-content *[style*="color"] {
    color: var(--dark-readable-text) !important;
}


/* Debug borders for content areas */

body[data-theme="dark"] .content-article,
body[data-theme="dark"] .content-body,
body[data-theme="dark"] .post-content-body,
body[data-theme="dark"] .category-item,
body[data-theme="dark"] .search-result-content {
    border: 1px solid var(--dark-border-color) !important;
    background: var(--dark-card-bg) !important;
}


/* === FINAL COMPREHENSIVE VISIBILITY OVERRIDES === */


/* Navigation and menu visibility */

body[data-theme="dark"] .navbar,
body[data-theme="dark"] .navbar *,
body[data-theme="dark"] .nav,
body[data-theme="dark"] .nav *,
body[data-theme="dark"] .dropdown-menu,
body[data-theme="dark"] .dropdown-menu * {
    color: var(--dark-readable-text) !important;
    background-color: transparent !important;
}

body[data-theme="dark"] .navbar-brand,
body[data-theme="dark"] .nav-link,
body[data-theme="dark"] .navbar-nav .nav-link {
    color: var(--dark-contrast-text) !important;
}

body[data-theme="dark"] .nav-link:hover,
body[data-theme="dark"] .navbar-nav .nav-link:hover {
    color: var(--dark-primary-brand) !important;
}


/* Form elements visibility */

body[data-theme="dark"] .form-control,
body[data-theme="dark"] .form-select,
body[data-theme="dark"] .form-check-label,
body[data-theme="dark"] .form-label,
body[data-theme="dark"] textarea,
body[data-theme="dark"] input,
body[data-theme="dark"] select {
    color: var(--dark-readable-text) !important;
    background: var(--dark-card-bg) !important;
    border-color: var(--dark-border-color) !important;
}

body[data-theme="dark"] .form-control::placeholder,
body[data-theme="dark"] textarea::placeholder,
body[data-theme="dark"] input::placeholder {
    color: var(--dark-muted-text) !important;
}


/* Button visibility */

body[data-theme="dark"] .btn,
body[data-theme="dark"] .btn *,
body[data-theme="dark"] button,
body[data-theme="dark"] button * {
    color: var(--dark-contrast-text) !important;
    background: var(--dark-primary-brand) !important;
    border-color: var(--dark-primary-brand) !important;
}

body[data-theme="dark"] .btn:hover,
body[data-theme="dark"] button:hover {
    color: var(--dark-contrast-text) !important;
    background: var(--dark-primary-brand-hover) !important;
}


/* Pagination visibility */

body[data-theme="dark"] .pagination,
body[data-theme="dark"] .pagination *,
body[data-theme="dark"] .page-link,
body[data-theme="dark"] .page-item {
    color: var(--dark-readable-text) !important;
    background: var(--dark-card-bg) !important;
    border-color: var(--dark-border-color) !important;
}

body[data-theme="dark"] .page-link:hover,
body[data-theme="dark"] .page-item:hover {
    color: var(--dark-primary-brand) !important;
}


/* Breadcrumb visibility */

body[data-theme="dark"] .breadcrumb,
body[data-theme="dark"] .breadcrumb *,
body[data-theme="dark"] .breadcrumb-item {
    color: var(--dark-readable-text) !important;
    background-color: transparent !important;
}

body[data-theme="dark"] .breadcrumb-item a {
    color: var(--dark-primary-brand) !important;
}


/* Alert and notification visibility */

body[data-theme="dark"] .alert,
body[data-theme="dark"] .alert *,
body[data-theme="dark"] .notification,
body[data-theme="dark"] .notification * {
    color: var(--dark-readable-text) !important;
    background: var(--dark-card-bg) !important;
    border-color: var(--dark-border-color) !important;
}


/* Table visibility */

body[data-theme="dark"] .table,
body[data-theme="dark"] .table *,
body[data-theme="dark"] table,
body[data-theme="dark"] table *,
body[data-theme="dark"] td,
body[data-theme="dark"] th,
body[data-theme="dark"] tbody,
body[data-theme="dark"] thead,
body[data-theme="dark"] tfoot {
    color: var(--dark-readable-text) !important;
    background: var(--dark-card-bg) !important;
    border-color: var(--dark-border-color) !important;
}

body[data-theme="dark"] th {
    color: var(--dark-contrast-text) !important;
}


/* Modal and popover visibility */

body[data-theme="dark"] .modal,
body[data-theme="dark"] .modal *,
body[data-theme="dark"] .modal-content,
body[data-theme="dark"] .modal-header,
body[data-theme="dark"] .modal-body,
body[data-theme="dark"] .modal-footer,
body[data-theme="dark"] .popover,
body[data-theme="dark"] .popover *,
body[data-theme="dark"] .tooltip,
body[data-theme="dark"] .tooltip * {
    color: var(--dark-readable-text) !important;
    background: var(--dark-card-bg) !important;
    border-color: var(--dark-border-color) !important;
}

body[data-theme="dark"] .modal-title {
    color: var(--dark-contrast-text) !important;
}


/* List and list group visibility */

body[data-theme="dark"] .list-group,
body[data-theme="dark"] .list-group *,
body[data-theme="dark"] .list-group-item,
body[data-theme="dark"] ul,
body[data-theme="dark"] ol,
body[data-theme="dark"] li {
    color: var(--dark-readable-text) !important;
    background-color: transparent !important;
}


/* Badge and label visibility */

body[data-theme="dark"] .badge,
body[data-theme="dark"] .badge *,
body[data-theme="dark"] .label,
body[data-theme="dark"] .tag {
    color: var(--dark-contrast-text) !important;
    background: var(--dark-primary-brand) !important;
}


/* Progress and loading visibility */

body[data-theme="dark"] .progress,
body[data-theme="dark"] .progress *,
body[data-theme="dark"] .progress-bar,
body[data-theme="dark"] .spinner,
body[data-theme="dark"] .loading {
    color: var(--dark-readable-text) !important;
    background: var(--dark-card-bg) !important;
}


/* Footer visibility */

body[data-theme="dark"] .footer,
body[data-theme="dark"] .footer *,
body[data-theme="dark"] footer,
body[data-theme="dark"] footer * {
    color: var(--dark-readable-text) !important;
    background-color: transparent !important;
}

body[data-theme="dark"] .footer h1,
body[data-theme="dark"] .footer h2,
body[data-theme="dark"] .footer h3,
body[data-theme="dark"] .footer h4,
body[data-theme="dark"] .footer h5,
body[data-theme="dark"] .footer h6,
body[data-theme="dark"] footer h1,
body[data-theme="dark"] footer h2,
body[data-theme="dark"] footer h3,
body[data-theme="dark"] footer h4,
body[data-theme="dark"] footer h5,
body[data-theme="dark"] footer h6 {
    color: var(--dark-contrast-text) !important;
}


/* Code and pre visibility */

body[data-theme="dark"] code,
body[data-theme="dark"] pre,
body[data-theme="dark"] .code,
body[data-theme="dark"] .pre,
body[data-theme="dark"] .highlight {
    color: var(--dark-readable-text) !important;
    background: var(--dark-secondary-bg) !important;
}


/* Blockquote visibility */

body[data-theme="dark"] blockquote,
body[data-theme="dark"] blockquote * {
    color: var(--dark-readable-text) !important;
    background-color: transparent !important;
    border-color: var(--dark-border-color) !important;
}


/* === ABSOLUTE FINAL NUCLEAR OPTION === */


/* Catch absolutely everything that might be missed */

body[data-theme="dark"] *:not(img):not(svg):not(iframe):not(video):not(audio):not(canvas):not(object):not(embed) {
    color: var(--dark-readable-text) !important;
}


/* Override any remaining headings */

body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3,
body[data-theme="dark"] h4,
body[data-theme="dark"] h5,
body[data-theme="dark"] h6,
body[data-theme="dark"] .h1,
body[data-theme="dark"] .h2,
body[data-theme="dark"] .h3,
body[data-theme="dark"] .h4,
body[data-theme="dark"] .h5,
body[data-theme="dark"] .h6 {
    color: var(--dark-contrast-text) !important;
}


/* Override any remaining links */

body[data-theme="dark"] a,
body[data-theme="dark"] a:visited {
    color: var(--dark-primary-brand) !important;
}

body[data-theme="dark"] a:hover,
body[data-theme="dark"] a:focus,
body[data-theme="dark"] a:active {
    color: var(--dark-primary-brand-hover) !important;
}


/* Override any remaining paragraphs and text elements */

body[data-theme="dark"] p,
body[data-theme="dark"] span,
body[data-theme="dark"] div,
body[data-theme="dark"] section,
body[data-theme="dark"] article,
body[data-theme="dark"] aside,
body[data-theme="dark"] main,
body[data-theme="dark"] header,
body[data-theme="dark"] .text {
    color: var(--dark-readable-text) !important;
}


/* Force override for any remaining Bootstrap classes */

body[data-theme="dark"] .text-light {
    color: var(--dark-readable-text) !important;
}

body[data-theme="dark"] .text-white {
    color: var(--dark-contrast-text) !important;
}


/* Force override for any remaining background issues */

body[data-theme="dark"] .bg-light,
body[data-theme="dark"] .bg-white,
body[data-theme="dark"] .bg-secondary {
    background: var(--dark-card-bg) !important;
    color: var(--dark-readable-text) !important;
}


/* Emergency override for any inline styles that might cause issues */

body[data-theme="dark"] *[style*="color: #000"],
body[data-theme="dark"] *[style*="color:#000"],
body[data-theme="dark"] *[style*="color: black"],
body[data-theme="dark"] *[style*="color:black"],
body[data-theme="dark"] *[style*="background: white"],
body[data-theme="dark"] *[style*="background:white"],
body[data-theme="dark"] *[style*="background: #fff"],
body[data-theme="dark"] *[style*="background:#fff"] {
    color: var(--dark-readable-text) !important;
    background: var(--dark-card-bg) !important;
}


/* === COMMENT SECTION NUCLEAR OVERRIDES === */


/* Comment section container */

body[data-theme="dark"] .comments-section,
body[data-theme="dark"] .comment-section,
body[data-theme="dark"] .comments-area,
body[data-theme="dark"] .comment-area {
    background: var(--dark-card-bg) !important;
    border: 1px solid var(--dark-border-color) !important;
    border-radius: 8px !important;
    color: var(--dark-readable-text) !important;
}


/* Comment form styling */

body[data-theme="dark"] .comment-form,
body[data-theme="dark"] .comment-form *,
body[data-theme="dark"] .add-comment-form,
body[data-theme="dark"] .add-comment-form * {
    color: var(--dark-readable-text) !important;
    background-color: transparent !important;
}


/* Comment form labels */

body[data-theme="dark"] .comment-form label,
body[data-theme="dark"] .add-comment-form label {
    color: var(--dark-contrast-text) !important;
    font-weight: 600 !important;
}


/* Comment form inputs */

body[data-theme="dark"] .comment-form input,
body[data-theme="dark"] .comment-form textarea,
body[data-theme="dark"] .comment-form select,
body[data-theme="dark"] .add-comment-form input,
body[data-theme="dark"] .add-comment-form textarea,
body[data-theme="dark"] .add-comment-form select {
    background: var(--dark-secondary-bg) !important;
    border: 2px solid var(--dark-border-color) !important;
    color: var(--dark-readable-text) !important;
    border-radius: 6px !important;
}


/* Comment form input focus */

body[data-theme="dark"] .comment-form input:focus,
body[data-theme="dark"] .comment-form textarea:focus,
body[data-theme="dark"] .add-comment-form input:focus,
body[data-theme="dark"] .add-comment-form textarea:focus {
    border-color: var(--dark-primary-brand) !important;
    background: var(--dark-card-bg) !important;
    box-shadow: 0 0 0 3px rgba(116, 130, 252, 0.1) !important;
}


/* Comment form placeholders */

body[data-theme="dark"] .comment-form input::placeholder,
body[data-theme="dark"] .comment-form textarea::placeholder,
body[data-theme="dark"] .add-comment-form input::placeholder,
body[data-theme="dark"] .add-comment-form textarea::placeholder {
    color: var(--dark-muted-text) !important;
}


/* Comment form buttons */

body[data-theme="dark"] .comment-form button,
body[data-theme="dark"] .comment-form .btn,
body[data-theme="dark"] .add-comment-form button,
body[data-theme="dark"] .add-comment-form .btn {
    background: var(--dark-primary-brand) !important;
    color: white !important;
    border: none !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
}

body[data-theme="dark"] .comment-form button:hover,
body[data-theme="dark"] .comment-form .btn:hover,
body[data-theme="dark"] .add-comment-form button:hover,
body[data-theme="dark"] .add-comment-form .btn:hover {
    background: var(--dark-primary-brand-hover) !important;
    transform: translateY(-1px) !important;
}


/* Individual comment styling */

body[data-theme="dark"] .comment,
body[data-theme="dark"] .comment-item,
body[data-theme="dark"] .single-comment {
    background: var(--dark-secondary-bg) !important;
    border: 1px solid var(--dark-border-color) !important;
    border-radius: 8px !important;
    color: var(--dark-readable-text) !important;
}


/* Comment content area */

body[data-theme="dark"] .comment-content,
body[data-theme="dark"] .comment-body,
body[data-theme="dark"] .comment-text {
    color: var(--dark-readable-text) !important;
    background: transparent !important;
}


/* Comment author name */

body[data-theme="dark"] .comment-author,
body[data-theme="dark"] .comment-author-name,
body[data-theme="dark"] .commenter-name {
    color: var(--dark-contrast-text) !important;
    font-weight: 700 !important;
}


/* Comment metadata */

body[data-theme="dark"] .comment-meta,
body[data-theme="dark"] .comment-date,
body[data-theme="dark"] .comment-time {
    color: var(--dark-muted-text) !important;
}


/* Comment actions (Reply, Edit, Delete) */

body[data-theme="dark"] .comment-actions,
body[data-theme="dark"] .comment-actions *,
body[data-theme="dark"] .comment-buttons,
body[data-theme="dark"] .comment-buttons * {
    color: var(--dark-readable-text) !important;
    background-color: transparent !important;
}

body[data-theme="dark"] .comment-actions button,
body[data-theme="dark"] .comment-actions .btn,
body[data-theme="dark"] .comment-buttons button,
body[data-theme="dark"] .comment-buttons .btn {
    background: var(--dark-accent-bg) !important;
    color: var(--dark-readable-text) !important;
    border: 1px solid var(--dark-border-color) !important;
}

body[data-theme="dark"] .comment-actions button:hover,
body[data-theme="dark"] .comment-actions .btn:hover,
body[data-theme="dark"] .comment-buttons button:hover,
body[data-theme="dark"] .comment-buttons .btn:hover {
    background: var(--dark-primary-brand) !important;
    color: white !important;
}


/* Comment replies */

body[data-theme="dark"] .comment-replies,
body[data-theme="dark"] .comment-children,
body[data-theme="dark"] .nested-comments {
    border-left: 3px solid var(--dark-primary-brand) !important;
    background: var(--dark-primary-bg) !important;
}

body[data-theme="dark"] .comment-reply,
body[data-theme="dark"] .reply-comment {
    background: var(--dark-card-bg) !important;
    border: 1px solid var(--dark-border-color) !important;
    color: var(--dark-readable-text) !important;
}


/* Comment form titles and headers */

body[data-theme="dark"] .comment-form h1,
body[data-theme="dark"] .comment-form h2,
body[data-theme="dark"] .comment-form h3,
body[data-theme="dark"] .comment-form h4,
body[data-theme="dark"] .comment-form h5,
body[data-theme="dark"] .comment-form h6,
body[data-theme="dark"] .comments-section h1,
body[data-theme="dark"] .comments-section h2,
body[data-theme="dark"] .comments-section h3,
body[data-theme="dark"] .comments-section h4,
body[data-theme="dark"] .comments-section h5,
body[data-theme="dark"] .comments-section h6 {
    color: var(--dark-contrast-text) !important;
}


/* Comment count */

body[data-theme="dark"] .comment-count,
body[data-theme="dark"] .comments-count {
    color: var(--dark-muted-text) !important;
}


/* ReCAPTCHA styling */

body[data-theme="dark"] .recaptcha-container,
body[data-theme="dark"] .g-recaptcha {
    filter: invert(1) hue-rotate(180deg) !important;
}


/* === BELOW COMMENT SECTION ELEMENTS === */


/* Related posts section */

body[data-theme="dark"] .related-posts,
body[data-theme="dark"] .related-posts *,
body[data-theme="dark"] .similar-posts,
body[data-theme="dark"] .similar-posts * {
    color: var(--dark-readable-text) !important;
    background-color: transparent !important;
}

body[data-theme="dark"] .related-posts h1,
body[data-theme="dark"] .related-posts h2,
body[data-theme="dark"] .related-posts h3,
body[data-theme="dark"] .related-posts h4,
body[data-theme="dark"] .related-posts h5,
body[data-theme="dark"] .related-posts h6,
body[data-theme="dark"] .similar-posts h1,
body[data-theme="dark"] .similar-posts h2,
body[data-theme="dark"] .similar-posts h3,
body[data-theme="dark"] .similar-posts h4,
body[data-theme="dark"] .similar-posts h5,
body[data-theme="dark"] .similar-posts h6 {
    color: var(--dark-contrast-text) !important;
}


/* Author bio section */

body[data-theme="dark"] .author-bio,
body[data-theme="dark"] .author-bio *,
body[data-theme="dark"] .author-card,
body[data-theme="dark"] .author-card * {
    color: var(--dark-readable-text) !important;
    background: var(--dark-card-bg) !important;
    border-color: var(--dark-border-color) !important;
}

body[data-theme="dark"] .author-bio h1,
body[data-theme="dark"] .author-bio h2,
body[data-theme="dark"] .author-bio h3,
body[data-theme="dark"] .author-bio h4,
body[data-theme="dark"] .author-bio h5,
body[data-theme="dark"] .author-bio h6,
body[data-theme="dark"] .author-card h1,
body[data-theme="dark"] .author-card h2,
body[data-theme="dark"] .author-card h3,
body[data-theme="dark"] .author-card h4,
body[data-theme="dark"] .author-card h5,
body[data-theme="dark"] .author-card h6 {
    color: var(--dark-contrast-text) !important;
}


/* Social sharing section */

body[data-theme="dark"] .social-sharing,
body[data-theme="dark"] .social-sharing *,
body[data-theme="dark"] .share-buttons,
body[data-theme="dark"] .share-buttons * {
    color: var(--dark-readable-text) !important;
    background-color: transparent !important;
}

body[data-theme="dark"] .social-sharing button,
body[data-theme="dark"] .social-sharing .btn,
body[data-theme="dark"] .share-buttons button,
body[data-theme="dark"] .share-buttons .btn {
    background: var(--dark-accent-bg) !important;
    color: var(--dark-readable-text) !important;
    border: 1px solid var(--dark-border-color) !important;
}

body[data-theme="dark"] .social-sharing button:hover,
body[data-theme="dark"] .social-sharing .btn:hover,
body[data-theme="dark"] .share-buttons button:hover,
body[data-theme="dark"] .share-buttons .btn:hover {
    background: var(--dark-primary-brand) !important;
    color: white !important;
}


/* Newsletter signup */

body[data-theme="dark"] .newsletter-signup,
body[data-theme="dark"] .newsletter-signup *,
body[data-theme="dark"] .subscription-form,
body[data-theme="dark"] .subscription-form * {
    color: var(--dark-readable-text) !important;
    background: var(--dark-card-bg) !important;
    border-color: var(--dark-border-color) !important;
}

body[data-theme="dark"] .newsletter-signup input,
body[data-theme="dark"] .subscription-form input {
    background: var(--dark-secondary-bg) !important;
    border: 2px solid var(--dark-border-color) !important;
    color: var(--dark-readable-text) !important;
}

body[data-theme="dark"] .newsletter-signup button,
body[data-theme="dark"] .subscription-form button {
    background: var(--dark-primary-brand) !important;
    color: white !important;
    border: none !important;
}


/* === EMERGENCY COMMENT OVERRIDES === */


/* Catch any missed comment elements */

body[data-theme="dark"] *[class*="comment"] {
    color: var(--dark-readable-text) !important;
}

body[data-theme="dark"] *[class*="comment"] h1,
body[data-theme="dark"] *[class*="comment"] h2,
body[data-theme="dark"] *[class*="comment"] h3,
body[data-theme="dark"] *[class*="comment"] h4,
body[data-theme="dark"] *[class*="comment"] h5,
body[data-theme="dark"] *[class*="comment"] h6 {
    color: var(--dark-contrast-text) !important;
}

body[data-theme="dark"] *[class*="comment"] a {
    color: var(--dark-primary-brand) !important;
}

body[data-theme="dark"] *[class*="comment"] a:hover {
    color: var(--dark-primary-brand-hover) !important;
}


/* Force visibility for any remaining comment text */

body[data-theme="dark"] .comment *:not(img):not(svg):not(iframe),
body[data-theme="dark"] .comment-item *:not(img):not(svg):not(iframe),
body[data-theme="dark"] .comment-section *:not(img):not(svg):not(iframe),
body[data-theme="dark"] .comments-section *:not(img):not(svg):not(iframe) {
    color: var(--dark-readable-text) !important;
}


/* Debug borders for comment sections */

body[data-theme="dark"] .comment,
body[data-theme="dark"] .comment-item,
body[data-theme="dark"] .comment-section,
body[data-theme="dark"] .comments-section {
    border: 1px solid var(--dark-border-color) !important;
    background: var(--dark-card-bg) !important;
}


/* === ULTRA-AGGRESSIVE COMMENT VISIBILITY FIXES === */


/* Discussion heading and title */

body[data-theme="dark"] .discussion-heading,
body[data-theme="dark"] .discussion-title,
body[data-theme="dark"] .comments-heading,
body[data-theme="dark"] .comments-title,
body[data-theme="dark"] h1:contains("Discussion"),
body[data-theme="dark"] h2:contains("Discussion"),
body[data-theme="dark"] h3:contains("Discussion"),
body[data-theme="dark"] h4:contains("Discussion"),
body[data-theme="dark"] h5:contains("Discussion"),
body[data-theme="dark"] h6:contains("Discussion") {
    color: var(--dark-contrast-text) !important;
    background: transparent !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
}


/* Force all headings in comment area to be visible */

body[data-theme="dark"] .comment-container h1,
body[data-theme="dark"] .comment-container h2,
body[data-theme="dark"] .comment-container h3,
body[data-theme="dark"] .comment-wrapper h1,
body[data-theme="dark"] .comment-wrapper h2,
body[data-theme="dark"] .comment-wrapper h3,
body[data-theme="dark"] .comments-wrapper h1,
body[data-theme="dark"] .comments-wrapper h2,
body[data-theme="dark"] .comments-wrapper h3 {
    color: var(--dark-contrast-text) !important;
    background: transparent !important;
}


/* Comment container backgrounds */

body[data-theme="dark"] .comment-container,
body[data-theme="dark"] .comment-wrapper,
body[data-theme="dark"] .comments-wrapper,
body[data-theme="dark"] .discussion-container,
body[data-theme="dark"] .discussion-wrapper {
    background: var(--dark-card-bg) !important;
    border: 1px solid var(--dark-border-color) !important;
    color: var(--dark-readable-text) !important;
}


/* Individual comment card fixes */

body[data-theme="dark"] .comment-card,
body[data-theme="dark"] .comment-box,
body[data-theme="dark"] .individual-comment,
body[data-theme="dark"] .user-comment {
    background: var(--dark-secondary-bg) !important;
    border: 1px solid var(--dark-border-color) !important;
    color: var(--dark-readable-text) !important;
    border-radius: 8px !important;
}


/* Comment text content - ultra aggressive */

body[data-theme="dark"] .comment-text,
body[data-theme="dark"] .comment-body,
body[data-theme="dark"] .comment-content,
body[data-theme="dark"] .comment-message,
body[data-theme="dark"] .user-comment-text,
body[data-theme="dark"] .comment-card p,
body[data-theme="dark"] .comment-box p,
body[data-theme="dark"] .individual-comment p,
body[data-theme="dark"] .user-comment p {
    color: var(--dark-readable-text) !important;
    background: transparent !important;
}


/* Comment author and metadata ultra-aggressive */

body[data-theme="dark"] .comment-author,
body[data-theme="dark"] .comment-user,
body[data-theme="dark"] .commenter-name,
body[data-theme="dark"] .comment-author-name,
body[data-theme="dark"] .user-name,
body[data-theme="dark"] .comment-card .author,
body[data-theme="dark"] .comment-box .author,
body[data-theme="dark"] .individual-comment .author,
body[data-theme="dark"] .user-comment .author {
    color: var(--dark-contrast-text) !important;
    background: transparent !important;
    font-weight: 700 !important;
}


/* Comment date and time ultra-aggressive */

body[data-theme="dark"] .comment-date,
body[data-theme="dark"] .comment-time,
body[data-theme="dark"] .comment-timestamp,
body[data-theme="dark"] .post-date,
body[data-theme="dark"] .comment-meta-date,
body[data-theme="dark"] .comment-card .date,
body[data-theme="dark"] .comment-box .date,
body[data-theme="dark"] .individual-comment .date,
body[data-theme="dark"] .user-comment .date {
    color: var(--dark-muted-text) !important;
    background: transparent !important;
}


/* Comment badges (Admin, Author, etc.) */

body[data-theme="dark"] .comment-badge,
body[data-theme="dark"] .user-badge,
body[data-theme="dark"] .admin-badge,
body[data-theme="dark"] .author-badge,
body[data-theme="dark"] .role-badge,
body[data-theme="dark"] .comment-card .badge,
body[data-theme="dark"] .comment-box .badge,
body[data-theme="dark"] .individual-comment .badge,
body[data-theme="dark"] .user-comment .badge {
    background: var(--dark-primary-brand) !important;
    color: white !important;
    border: none !important;
}


/* Comment action buttons ultra-aggressive */

body[data-theme="dark"] .comment-actions,
body[data-theme="dark"] .comment-buttons,
body[data-theme="dark"] .comment-controls,
body[data-theme="dark"] .comment-footer {
    background: transparent !important;
    color: var(--dark-readable-text) !important;
}

body[data-theme="dark"] .comment-actions button,
body[data-theme="dark"] .comment-buttons button,
body[data-theme="dark"] .comment-controls button,
body[data-theme="dark"] .comment-footer button,
body[data-theme="dark"] .comment-actions .btn,
body[data-theme="dark"] .comment-buttons .btn,
body[data-theme="dark"] .comment-controls .btn,
body[data-theme="dark"] .comment-footer .btn {
    background: var(--dark-accent-bg) !important;
    color: var(--dark-readable-text) !important;
    border: 1px solid var(--dark-border-color) !important;
    border-radius: 4px !important;
}

body[data-theme="dark"] .comment-actions button:hover,
body[data-theme="dark"] .comment-buttons button:hover,
body[data-theme="dark"] .comment-controls button:hover,
body[data-theme="dark"] .comment-footer button:hover,
body[data-theme="dark"] .comment-actions .btn:hover,
body[data-theme="dark"] .comment-buttons .btn:hover,
body[data-theme="dark"] .comment-controls .btn:hover,
body[data-theme="dark"] .comment-footer .btn:hover {
    background: var(--dark-primary-brand) !important;
    color: white !important;
}


/* Nuclear option for any white/light backgrounds in comment area */

body[data-theme="dark"] .comment-section .bg-white,
body[data-theme="dark"] .comment-section .bg-light,
body[data-theme="dark"] .comments-section .bg-white,
body[data-theme="dark"] .comments-section .bg-light,
body[data-theme="dark"] .comment-wrapper .bg-white,
body[data-theme="dark"] .comment-wrapper .bg-light,
body[data-theme="dark"] .comments-wrapper .bg-white,
body[data-theme="dark"] .comments-wrapper .bg-light {
    background: var(--dark-card-bg) !important;
    color: var(--dark-readable-text) !important;
}


/* Force all text in comment areas to be visible */

body[data-theme="dark"] .comment-section *,
body[data-theme="dark"] .comments-section *,
body[data-theme="dark"] .comment-wrapper *,
body[data-theme="dark"] .comments-wrapper *,
body[data-theme="dark"] .comment-container *,
body[data-theme="dark"] .discussion-container * {
    color: var(--dark-readable-text) !important;
}


/* Force headings in comment areas to be white */

body[data-theme="dark"] .comment-section h1,
body[data-theme="dark"] .comment-section h2,
body[data-theme="dark"] .comment-section h3,
body[data-theme="dark"] .comment-section h4,
body[data-theme="dark"] .comment-section h5,
body[data-theme="dark"] .comment-section h6,
body[data-theme="dark"] .comments-section h1,
body[data-theme="dark"] .comments-section h2,
body[data-theme="dark"] .comments-section h3,
body[data-theme="dark"] .comments-section h4,
body[data-theme="dark"] .comments-section h5,
body[data-theme="dark"] .comments-section h6 {
    color: var(--dark-contrast-text) !important;
    background: transparent !important;
}


/* Force links in comment areas to be visible */

body[data-theme="dark"] .comment-section a,
body[data-theme="dark"] .comments-section a,
body[data-theme="dark"] .comment-wrapper a,
body[data-theme="dark"] .comments-wrapper a,
body[data-theme="dark"] .comment-container a,
body[data-theme="dark"] .discussion-container a {
    color: var(--dark-primary-brand) !important;
    text-decoration: underline !important;
}

body[data-theme="dark"] .comment-section a:hover,
body[data-theme="dark"] .comments-section a:hover,
body[data-theme="dark"] .comment-wrapper a:hover,
body[data-theme="dark"] .comments-wrapper a:hover,
body[data-theme="dark"] .comment-container a:hover,
body[data-theme="dark"] .discussion-container a:hover {
    color: var(--dark-primary-brand-hover) !important;
}


/* Final nuclear override - catch everything in comment areas */

body[data-theme="dark"] *[class*="comment"]:not(img):not(svg):not(iframe),
body[data-theme="dark"] *[class*="discussion"]:not(img):not(svg):not(iframe),
body[data-theme="dark"] *[id*="comment"]:not(img):not(svg):not(iframe),
body[data-theme="dark"] *[id*="discussion"]:not(img):not(svg):not(iframe) {
    color: var(--dark-readable-text) !important;
    background-color: transparent !important;
}


/* Force headings with comment/discussion in class or id */

body[data-theme="dark"] *[class*="comment"] h1,
body[data-theme="dark"] *[class*="comment"] h2,
body[data-theme="dark"] *[class*="comment"] h3,
body[data-theme="dark"] *[class*="comment"] h4,
body[data-theme="dark"] *[class*="comment"] h5,
body[data-theme="dark"] *[class*="comment"] h6,
body[data-theme="dark"] *[class*="discussion"] h1,
body[data-theme="dark"] *[class*="discussion"] h2,
body[data-theme="dark"] *[class*="discussion"] h3,
body[data-theme="dark"] *[class*="discussion"] h4,
body[data-theme="dark"] *[class*="discussion"] h5,
body[data-theme="dark"] *[class*="discussion"] h6,
body[data-theme="dark"] *[id*="comment"] h1,
body[data-theme="dark"] *[id*="comment"] h2,
body[data-theme="dark"] *[id*="comment"] h3,
body[data-theme="dark"] *[id*="comment"] h4,
body[data-theme="dark"] *[id*="comment"] h5,
body[data-theme="dark"] *[id*="comment"] h6,
body[data-theme="dark"] *[id*="discussion"] h1,
body[data-theme="dark"] *[id*="discussion"] h2,
body[data-theme="dark"] *[id*="discussion"] h3,
body[data-theme="dark"] *[id*="discussion"] h4,
body[data-theme="dark"] *[id*="discussion"] h5,
body[data-theme="dark"] *[id*="discussion"] h6 {
    color: var(--dark-contrast-text) !important;
    background: transparent !important;
}


/* === EXACT COMMENT TEMPLATE OVERRIDES === */


/* Main comments section */

body[data-theme="dark"] .comments-section {
    background: var(--dark-card-bg) !important;
    border: 1px solid var(--dark-border-color) !important;
    color: var(--dark-readable-text) !important;
}


/* Comments list and Discussion heading */

body[data-theme="dark"] .comments-list {
    background: transparent !important;
    color: var(--dark-readable-text) !important;
}

body[data-theme="dark"] .comments-list h4 {
    color: var(--dark-contrast-text) !important;
    background: transparent !important;
}


/* Comment form */

body[data-theme="dark"] .comment-form {
    background: transparent !important;
    color: var(--dark-readable-text) !important;
}

body[data-theme="dark"] .comment-form h4 {
    color: var(--dark-contrast-text) !important;
    background: transparent !important;
}


/* Individual comment container */

body[data-theme="dark"] .comment {
    background: transparent !important;
    color: var(--dark-readable-text) !important;
}


/* CRITICAL: Override the .bg-light class in comment content */

body[data-theme="dark"] .comment-content.bg-light {
    background: var(--dark-secondary-bg) !important;
    color: var(--dark-readable-text) !important;
    border: 1px solid var(--dark-border-color) !important;
}


/* CRITICAL: Override the .bg-white class in reply comments */

body[data-theme="dark"] .comment-content.bg-white {
    background: var(--dark-card-bg) !important;
    color: var(--dark-readable-text) !important;
    border: 1px solid var(--dark-border-color) !important;
}


/* Comment header */

body[data-theme="dark"] .comment-header {
    background: transparent !important;
    color: var(--dark-readable-text) !important;
}


/* Comment author */

body[data-theme="dark"] .comment-author {
    color: var(--dark-contrast-text) !important;
    background: transparent !important;
    font-weight: 700 !important;
}


/* Comment meta (dates, etc.) */

body[data-theme="dark"] .comment-meta {
    color: var(--dark-muted-text) !important;
    background: transparent !important;
}


/* Comment body text */

body[data-theme="dark"] .comment-body {
    color: var(--dark-readable-text) !important;
    background: transparent !important;
}

body[data-theme="dark"] .comment-body p {
    color: var(--dark-readable-text) !important;
    background: transparent !important;
}


/* Comment actions */

body[data-theme="dark"] .comment-actions {
    background: transparent !important;
    color: var(--dark-readable-text) !important;
}

body[data-theme="dark"] .comment-actions button {
    background: var(--dark-accent-bg) !important;
    color: var(--dark-readable-text) !important;
    border: 1px solid var(--dark-border-color) !important;
}

body[data-theme="dark"] .comment-actions button:hover {
    background: var(--dark-primary-brand) !important;
    color: white !important;
}


/* Comment replies */

body[data-theme="dark"] .comment-replies {
    background: transparent !important;
    border-left: 3px solid var(--dark-primary-brand) !important;
}

body[data-theme="dark"] .comment.reply {
    background: transparent !important;
    color: var(--dark-readable-text) !important;
}


/* Reply form */

body[data-theme="dark"] .reply-form {
    background: var(--dark-card-bg) !important;
    color: var(--dark-readable-text) !important;
    border: 1px solid var(--dark-border-color) !important;
}

body[data-theme="dark"] .reply-comment-form {
    background: transparent !important;
    color: var(--dark-readable-text) !important;
}


/* No comments message */

body[data-theme="dark"] .no-comments.bg-light {
    background: var(--dark-card-bg) !important;
    color: var(--dark-readable-text) !important;
    border: 1px solid var(--dark-border-color) !important;
}

body[data-theme="dark"] .no-comments h5 {
    color: var(--dark-contrast-text) !important;
}


/* === BOOTSTRAP UTILITY CLASS OVERRIDES IN COMMENTS === */


/* Override Bootstrap .bg-light anywhere in comments */

body[data-theme="dark"] .comments-section .bg-light,
body[data-theme="dark"] .comment .bg-light,
body[data-theme="dark"] .comment-content.bg-light,
body[data-theme="dark"] .comment-form .bg-light {
    background: var(--dark-secondary-bg) !important;
    color: var(--dark-readable-text) !important;
}


/* Override Bootstrap .bg-white anywhere in comments */

body[data-theme="dark"] .comments-section .bg-white,
body[data-theme="dark"] .comment .bg-white,
body[data-theme="dark"] .comment-content.bg-white,
body[data-theme="dark"] .comment-form .bg-white {
    background: var(--dark-card-bg) !important;
    color: var(--dark-readable-text) !important;
}


/* Override Bootstrap .text-muted in comments */

body[data-theme="dark"] .comments-section .text-muted,
body[data-theme="dark"] .comment .text-muted,
body[data-theme="dark"] .comment-meta.text-muted {
    color: var(--dark-muted-text) !important;
}


/* Override Bootstrap .text-dark in comments */

body[data-theme="dark"] .comments-section .text-dark,
body[data-theme="dark"] .comment .text-dark {
    color: var(--dark-readable-text) !important;
}


/* === FINAL NUCLEAR COMMENT OVERRIDE === */


/* Force everything inside comments-section to be visible */

body[data-theme="dark"] .comments-section *:not(img):not(svg):not(iframe) {
    color: var(--dark-readable-text) !important;
}


/* Force all headings in comments-section to be white */

body[data-theme="dark"] .comments-section h1,
body[data-theme="dark"] .comments-section h2,
body[data-theme="dark"] .comments-section h3,
body[data-theme="dark"] .comments-section h4,
body[data-theme="dark"] .comments-section h5,
body[data-theme="dark"] .comments-section h6 {
    color: var(--dark-contrast-text) !important;
    background: transparent !important;
}


/* Force all links in comments-section to be brand color */

body[data-theme="dark"] .comments-section a {
    color: var(--dark-primary-brand) !important;
}

body[data-theme="dark"] .comments-section a:hover {
    color: var(--dark-primary-brand-hover) !important;
}


/* Force all paragraphs in comments-section to be readable */

body[data-theme="dark"] .comments-section p {
    color: var(--dark-readable-text) !important;
    background: transparent !important;
}


/* Force all divs in comments-section to be readable */

body[data-theme="dark"] .comments-section div {
    color: var(--dark-readable-text) !important;
}


/* Force all spans in comments-section to be readable */

body[data-theme="dark"] .comments-section span {
    color: var(--dark-readable-text) !important;
}


/* Emergency override for any missed background classes */

body[data-theme="dark"] .comments-section [class*="bg-"] {
    background: var(--dark-card-bg) !important;
    color: var(--dark-readable-text) !important;
}


/* === CAROUSEL NAVIGATION ARROWS DARK MODE === */


/* Carousel container */

body[data-theme="dark"] .carousel,
body[data-theme="dark"] .carousel-inner {
    background: transparent !important;
}


/* Carousel navigation arrows (prev/next) */

body[data-theme="dark"] .carousel-control-prev,
body[data-theme="dark"] .carousel-control-next {
    background: rgba(38, 38, 80, 0.8) !important;
    border: 2px solid var(--dark-border-color) !important;
    border-radius: 50% !important;
    width: 50px !important;
    height: 50px !important;
    opacity: 1 !important;
    transition: all 0.3s ease !important;
}

body[data-theme="dark"] .carousel-control-prev:hover,
body[data-theme="dark"] .carousel-control-next:hover {
    background: var(--dark-primary-brand) !important;
    border-color: var(--dark-primary-brand) !important;
    transform: scale(1.1) !important;
}


/* Carousel arrow icons */

body[data-theme="dark"] .carousel-control-prev-icon,
body[data-theme="dark"] .carousel-control-next-icon {
    background-image: none !important;
    width: 24px !important;
    height: 24px !important;
}


/* Create custom arrow icons with CSS */

body[data-theme="dark"] .carousel-control-prev-icon::before {
    content: "❮" !important;
    font-size: 24px !important;
    color: var(--dark-contrast-text) !important;
    font-weight: bold !important;
    line-height: 1 !important;
}

body[data-theme="dark"] .carousel-control-next-icon::before {
    content: "❯" !important;
    font-size: 24px !important;
    color: var(--dark-contrast-text) !important;
    font-weight: bold !important;
    line-height: 1 !important;
}


/* Alternative arrow styling with FontAwesome if available */

body[data-theme="dark"] .carousel-control-prev-icon.fa::before {
    content: "\f104" !important;
    font-family: "Font Awesome 5 Free" !important;
    font-weight: 900 !important;
}

body[data-theme="dark"] .carousel-control-next-icon.fa::before {
    content: "\f105" !important;
    font-family: "Font Awesome 5 Free" !important;
    font-weight: 900 !important;
}


/* Carousel indicators (dots) */

body[data-theme="dark"] .carousel-indicators {
    bottom: 20px !important;
}

body[data-theme="dark"] .carousel-indicators li,
body[data-theme="dark"] .carousel-indicators button {
    background: rgba(255, 255, 255, 0.5) !important;
    border: 2px solid var(--dark-border-color) !important;
    border-radius: 50% !important;
    width: 12px !important;
    height: 12px !important;
    opacity: 1 !important;
    transition: all 0.3s ease !important;
}

body[data-theme="dark"] .carousel-indicators li.active,
body[data-theme="dark"] .carousel-indicators button.active {
    background: var(--dark-primary-brand) !important;
    border-color: var(--dark-primary-brand) !important;
    transform: scale(1.3) !important;
}

body[data-theme="dark"] .carousel-indicators li:hover,
body[data-theme="dark"] .carousel-indicators button:hover {
    background: var(--dark-primary-brand-hover) !important;
    border-color: var(--dark-primary-brand-hover) !important;
    transform: scale(1.1) !important;
}


/* Custom carousel navigation for featured posts */

body[data-theme="dark"] .featured-carousel .carousel-control-prev,
body[data-theme="dark"] .featured-carousel .carousel-control-next {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: rgba(38, 38, 80, 0.9) !important;
    border: 2px solid var(--dark-border-color) !important;
    border-radius: 8px !important;
    width: 45px !important;
    height: 45px !important;
    z-index: 10 !important;
}

body[data-theme="dark"] .featured-carousel .carousel-control-prev {
    left: 15px !important;
}

body[data-theme="dark"] .featured-carousel .carousel-control-next {
    right: 15px !important;
}


/* Hero carousel navigation */

body[data-theme="dark"] .hero-carousel .carousel-control-prev,
body[data-theme="dark"] .hero-carousel .carousel-control-next {
    background: rgba(15, 15, 35, 0.8) !important;
    border: 2px solid var(--dark-primary-brand) !important;
    border-radius: 50% !important;
    width: 55px !important;
    height: 55px !important;
}

body[data-theme="dark"] .hero-carousel .carousel-control-prev:hover,
body[data-theme="dark"] .hero-carousel .carousel-control-next:hover {
    background: var(--dark-primary-brand) !important;
    box-shadow: 0 0 15px rgba(116, 130, 252, 0.5) !important;
}


/* Ensure carousel navigation is always visible */

body[data-theme="dark"] .carousel:hover .carousel-control-prev,
body[data-theme="dark"] .carousel:hover .carousel-control-next {
    opacity: 1 !important;
}


/* Alternative arrow styling with Unicode symbols */

body[data-theme="dark"] .carousel-control-prev-icon::after {
    content: "" !important;
    display: block !important;
    width: 0 !important;
    height: 0 !important;
    border-top: 8px solid transparent !important;
    border-bottom: 8px solid transparent !important;
    border-right: 12px solid var(--dark-contrast-text) !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
}

body[data-theme="dark"] .carousel-control-next-icon::after {
    content: "" !important;
    display: block !important;
    width: 0 !important;
    height: 0 !important;
    border-top: 8px solid transparent !important;
    border-bottom: 8px solid transparent !important;
    border-left: 12px solid var(--dark-contrast-text) !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
}


/* Override for better visibility */

body[data-theme="dark"] .carousel-control-prev-icon,
body[data-theme="dark"] .carousel-control-next-icon {
    filter: none !important;
    background: none !important;
    position: relative !important;
}


/* Swiper carousel navigation if using Swiper */

body[data-theme="dark"] .swiper-button-prev,
body[data-theme="dark"] .swiper-button-next {
    background: rgba(38, 38, 80, 0.9) !important;
    border: 2px solid var(--dark-border-color) !important;
    border-radius: 50% !important;
    width: 50px !important;
    height: 50px !important;
    color: var(--dark-contrast-text) !important;
}

body[data-theme="dark"] .swiper-button-prev:hover,
body[data-theme="dark"] .swiper-button-next:hover {
    background: var(--dark-primary-brand) !important;
    border-color: var(--dark-primary-brand) !important;
}

body[data-theme="dark"] .swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.5) !important;
    border: 2px solid var(--dark-border-color) !important;
}

body[data-theme="dark"] .swiper-pagination-bullet-active {
    background: var(--dark-primary-brand) !important;
    border-color: var(--dark-primary-brand) !important;
}


/* === SIDEBAR AND FOOTER SPACING (DARK THEME) === */


/* Ensure proper spacing between sidebar and footer */

body[data-theme="dark"] .sidebar {
    margin-bottom: 4rem !important;
    /* 64px gap between sidebar and footer */
    padding-bottom: 2rem !important;
    /* Additional padding within sidebar */
}

body[data-theme="dark"] .sidebar-section:last-child {
    margin-bottom: 2rem !important;
    /* Extra space for the last sidebar section */
}


/* Container spacing to prevent content from touching footer */

body[data-theme="dark"] .container-fluid,
body[data-theme="dark"] .container {
    margin-bottom: 3rem !important;
    /* Space between main content and footer */
}


/* Responsive spacing adjustments */

@media (max-width: 991.98px) {
    body[data-theme="dark"] .sidebar {
        margin-bottom: 3rem !important;
        /* Reduced gap on mobile */
        padding-bottom: 1.5rem !important;
    }
    body[data-theme="dark"] .container-fluid,
    body[data-theme="dark"] .container {
        margin-bottom: 2rem !important;
    }
}

@media (max-width: 767.98px) {
    body[data-theme="dark"] .sidebar {
        margin-bottom: 2rem !important;
        /* Smaller gap on very small screens */
        padding-bottom: 1rem !important;
    }
    body[data-theme="dark"] .container-fluid,
    body[data-theme="dark"] .container {
        margin-bottom: 1.5rem !important;
    }
}


/* Specific spacing for index page layout */

body[data-theme="dark"] .row:has(.sidebar) {
    margin-bottom: 3rem !important;
    /* Space for the row containing sidebar */
}


/* Additional footer spacing */

body[data-theme="dark"] footer {
    margin-top: 2rem !important;
    /* Ensure footer has top margin */
}


/* Sidebar sections spacing */

body[data-theme="dark"] .sidebar-section {
    margin-bottom: 2rem !important;
    /* Space between sidebar sections */
}

body[data-theme="dark"] .sidebar-section:first-child {
    margin-top: 0 !important;
    /* No top margin for first section */
}

body[data-theme="dark"] .sidebar-section:last-child {
    margin-bottom: 3rem !important;
    /* Extra bottom margin for last section */
}


/* Enhanced visual separation for dark theme */

body[data-theme="dark"] .sidebar {
    border-bottom: 2px solid var(--dark-border-color) !important;
    border-radius: 0 0 8px 8px !important;
}


/* Additional spacing for visual breathing room */

body[data-theme="dark"] .main-content {
    margin-bottom: 2rem !important;
}


/* Ensure proper spacing in grid layout */

body[data-theme="dark"] .col-lg-4:has(.sidebar) {
    margin-bottom: 3rem !important;
}

body[data-theme="dark"] .col-lg-8 {
    margin-bottom: 2rem !important;
}


/* === INDIVIDUAL SIDEBAR SECTION SCROLLING (DARK THEME) === */


/* Base sidebar section styling with max height and scroll */

body[data-theme="dark"] .sidebar-section {
    max-height: none !important;
    /* Default: no height restriction */
    overflow: visible !important;
    /* Default: no scrolling */
    transition: all 0.3s ease !important;
}


/* Scrollable sidebar sections - apply to sections that might have lots of content */

body[data-theme="dark"] .sidebar-section.scrollable {
    max-height: 400px !important;
    /* Fixed maximum height */
    overflow-y: auto !important;
    /* Enable vertical scrolling */
    overflow-x: hidden !important;
    /* Hide horizontal scroll */
    padding-right: 8px !important;
    /* Space for scrollbar */
}


/* Specific sections that should be scrollable */

body[data-theme="dark"] .sidebar-section.popular-posts-section,
body[data-theme="dark"] .sidebar-section.categories-section,
body[data-theme="dark"] .sidebar-section.main-pages-section,
body[data-theme="dark"] .sidebar-section.featured-posts-section,
body[data-theme="dark"] .sidebar-section.recent-activity-section,
body[data-theme="dark"] .sidebar-section.tags-section {
    max-height: 350px !important;
    /* Reasonable height for content sections */
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-right: 8px !important;
}


/* Content wrapper within scrollable sections */

body[data-theme="dark"] .sidebar-section.scrollable .sidebar-content,
body[data-theme="dark"] .popular-posts-section .sidebar-content,
body[data-theme="dark"] .categories-section .sidebar-content,
body[data-theme="dark"] .main-pages-section .sidebar-content,
body[data-theme="dark"] .featured-posts-section .sidebar-content,
body[data-theme="dark"] .recent-activity-section .sidebar-content,
body[data-theme="dark"] .tags-section .sidebar-content {
    padding-right: 4px !important;
    /* Additional padding for content */
}


/* Custom scrollbar for sidebar sections in dark theme */

body[data-theme="dark"] .sidebar-section::-webkit-scrollbar {
    width: 6px !important;
}

body[data-theme="dark"] .sidebar-section::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05) !important;
    border-radius: 3px !important;
}

body[data-theme="dark"] .sidebar-section::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 3px !important;
    transition: background 0.3s ease !important;
}

body[data-theme="dark"] .sidebar-section::-webkit-scrollbar-thumb:hover {
    background: var(--dark-primary-brand) !important;
}


/* Firefox scrollbar for sidebar sections in dark theme */

body[data-theme="dark"] .sidebar-section {
    scrollbar-width: thin !important;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.05) !important;
}


/* Responsive max heights for dark theme */

@media (max-width: 991.98px) {
    body[data-theme="dark"] .sidebar-section.scrollable,
    body[data-theme="dark"] .sidebar-section.popular-posts-section,
    body[data-theme="dark"] .sidebar-section.categories-section,
    body[data-theme="dark"] .sidebar-section.main-pages-section,
    body[data-theme="dark"] .sidebar-section.featured-posts-section,
    body[data-theme="dark"] .sidebar-section.recent-activity-section,
    body[data-theme="dark"] .sidebar-section.tags-section {
        max-height: 300px !important;
        /* Smaller height on tablets */
    }
}

@media (max-width: 767.98px) {
    body[data-theme="dark"] .sidebar-section.scrollable,
    body[data-theme="dark"] .sidebar-section.popular-posts-section,
    body[data-theme="dark"] .sidebar-section.categories-section,
    body[data-theme="dark"] .sidebar-section.main-pages-section,
    body[data-theme="dark"] .sidebar-section.featured-posts-section,
    body[data-theme="dark"] .sidebar-section.recent-activity-section,
    body[data-theme="dark"] .sidebar-section.tags-section {
        max-height: 250px !important;
        /* Even smaller on mobile */
    }
}


/* Fade effect at bottom to indicate more content (dark theme) */

body[data-theme="dark"] .sidebar-section.scrollable::after,
body[data-theme="dark"] .sidebar-section.popular-posts-section::after,
body[data-theme="dark"] .sidebar-section.categories-section::after,
body[data-theme="dark"] .sidebar-section.main-pages-section::after,
body[data-theme="dark"] .sidebar-section.featured-posts-section::after,
body[data-theme="dark"] .sidebar-section.recent-activity-section::after,
body[data-theme="dark"] .sidebar-section.tags-section::after {
    content: "" !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 20px !important;
    background: linear-gradient(transparent, var(--dark-card-bg)) !important;
    pointer-events: none !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
}


/* Show fade effect when content is scrollable (dark theme) */

body[data-theme="dark"] .sidebar-section.has-scroll::after {
    opacity: 1 !important;
}


/* Ensure sidebar sections are positioned relatively for fade effect */

body[data-theme="dark"] .sidebar-section {
    position: relative !important;
}


/* Hover effect for better scrollbar visibility (dark theme) */

body[data-theme="dark"] .sidebar-section:hover::-webkit-scrollbar-thumb {
    background: rgba(116, 130, 252, 0.6) !important;
}


/* Newsletter section should not be scrollable (usually short content) */

body[data-theme="dark"] .sidebar-section.newsletter-section {
    max-height: none !important;
    overflow: visible !important;
}


/* Welcome section should not be scrollable */

body[data-theme="dark"] .sidebar-section.welcome-section {
    max-height: none !important;
    overflow: visible !important;
}


/* Enhanced scrollbar appearance on hover */

body[data-theme="dark"] .sidebar-section:hover::-webkit-scrollbar {
    width: 8px !important;
}


/* Visual indicator when section is scrollable */

body[data-theme="dark"] .sidebar-section.has-scroll {
    border: 1px solid rgba(116, 130, 252, 0.2) !important;
    border-radius: 8px !important;
}


/* === ENHANCED SCROLLING FEATURES (DARK THEME) === */


/* Collapsed state for sidebar sections */

body[data-theme="dark"] .sidebar-section.collapsed {
    overflow: hidden !important;
    transition: max-height 0.4s ease, opacity 0.3s ease !important;
}

body[data-theme="dark"] .sidebar-section.collapsed .sidebar-item,
body[data-theme="dark"] .sidebar-section.collapsed .sidebar-content {
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
}


/* Toggle button styling for dark theme */

body[data-theme="dark"] .sidebar-title .toggle-btn {
    float: right !important;
    opacity: 0.7 !important;
    transition: all 0.3s ease !important;
    color: var(--dark-readable-text) !important;
}

body[data-theme="dark"] .sidebar-title .toggle-btn:hover {
    opacity: 1 !important;
    transform: scale(1.1) !important;
    color: var(--dark-primary-brand) !important;
}


/* Scroll shadow effects for dark theme */

body[data-theme="dark"] .sidebar-section.scrolled-top {
    box-shadow: inset 0 8px 8px -8px rgba(255, 255, 255, 0.1) !important;
}

body[data-theme="dark"] .sidebar-section.scrolled-bottom::after {
    opacity: 0 !important;
}


/* Visual scroll indicator for dark theme */

body[data-theme="dark"] .sidebar-section.has-scroll::before {
    content: "↕" !important;
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    color: rgba(255, 255, 255, 0.4) !important;
    font-size: 12px !important;
    z-index: 10 !important;
    pointer-events: none !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
}

body[data-theme="dark"] .sidebar-section.has-scroll:hover::before {
    opacity: 1 !important;
    color: var(--dark-primary-brand) !important;
}


/* Enhanced scrollbar on focus for dark theme */

body[data-theme="dark"] .sidebar-section:focus-within::-webkit-scrollbar {
    width: 8px !important;
}

body[data-theme="dark"] .sidebar-section:focus-within::-webkit-scrollbar-thumb {
    background: var(--dark-primary-brand) !important;
}


/* Smooth scrolling animation for dark theme */

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

body[data-theme="dark"] .sidebar-section.has-scroll .sidebar-item {
    animation: fadeInScrollDark 0.3s ease-out !important;
}


/* Better mobile scrolling for dark theme */

@media (max-width: 767.98px) {
    body[data-theme="dark"] .sidebar-section.has-scroll {
        -webkit-overflow-scrolling: touch !important;
        scroll-snap-type: y proximity !important;
    }
    body[data-theme="dark"] .sidebar-section .sidebar-item {
        scroll-snap-align: start !important;
    }
}


/* Accessibility improvements for dark theme */

body[data-theme="dark"] .sidebar-section[tabindex]:focus {
    outline: 2px solid var(--dark-primary-brand) !important;
    outline-offset: 2px !important;
}


/* Loading state for dynamic content in dark theme */

body[data-theme="dark"] .sidebar-section.loading {
    position: relative !important;
    pointer-events: none !important;
}

body[data-theme="dark"] .sidebar-section.loading::before {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(15, 15, 35, 0.8) !important;
    z-index: 100 !important;
}

body[data-theme="dark"] .sidebar-section.loading::after {
    content: "⟳" !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    font-size: 20px !important;
    color: var(--dark-primary-brand) !important;
    animation: spinDark 1s linear infinite !important;
    z-index: 101 !important;
}

@keyframes spinDark {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}


/* Enhanced visual feedback for dark theme */

body[data-theme="dark"] .sidebar-section.has-scroll {
    border: 1px solid rgba(116, 130, 252, 0.1) !important;
    transition: border-color 0.3s ease !important;
}

body[data-theme="dark"] .sidebar-section.has-scroll:hover {
    border-color: rgba(116, 130, 252, 0.3) !important;
}


/* Better contrast for scrollable sections */

body[data-theme="dark"] .sidebar-section.has-scroll {
    background: linear-gradient(var(--dark-card-bg), var(--dark-secondary-bg)) !important;
}


/* Enhanced toggle button appearance */

body[data-theme="dark"] .sidebar-title .toggle-btn {
    background: rgba(116, 130, 252, 0.1) !important;
    border-radius: 50% !important;
    width: 20px !important;
    height: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

body[data-theme="dark"] .sidebar-title .toggle-btn:hover {
    background: rgba(116, 130, 252, 0.2) !important;
}