/* Dark Theme Fixes - Ensure proper dark backgrounds and white text */

/* =========================
   Dark Theme Core Overrides
   ========================= */

[data-theme="dark"] {
    /* Main body and sections */
    --bg-color: #0f172a !important;
    --surface-color: #1e293b !important;
    --border-color: #334155 !important;
    --text-primary: #f1f5f9 !important;
    --text-secondary: #cbd5e1 !important;
    --text-muted: #94a3b8 !important;
    background-color: #0f172a !important;
}

[data-theme="dark"] body {
    background-color: #0f172a !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .main-content {
    background-color: #0f172a !important;
}

/* =========================
   Cards and Sections
   ========================= */

[data-theme="dark"] .article-card {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .article-content {
    background-color: #1e293b !important;
}

[data-theme="dark"] .hero-featured {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .hero-section {
    background-color: #0f172a !important;
}

[data-theme="dark"] .articles-section {
    background-color: #0f172a !important;
}

/* =========================
   Sidebar
   ========================= */

[data-theme="dark"] .sidebar-widget {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .category-card {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .category-card:hover {
    background-color: #0f172a !important;
}

[data-theme="dark"] .trending-item:hover {
    background-color: #1e293b !important;
}

[data-theme="dark"] .tag-pill {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

/* =========================
   Text Colors
   ========================= */

[data-theme="dark"] .article-title,
[data-theme="dark"] .article-title a {
    color: #ffffff !important;
}

[data-theme="dark"] .article-title a:hover {
    color: #60a5fa !important;
}

[data-theme="dark"] .article-excerpt,
[data-theme="dark"] .article-meta,
[data-theme="dark"] p {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .section-title,
[data-theme="dark"] .widget-title,
[data-theme="dark"] .category-info h4,
[data-theme="dark"] .trending-content h4 a {
    color: #ffffff !important;
}

[data-theme="dark"] .trending-content h4 a:hover {
    color: #60a5fa !important;
}

[data-theme="dark"] .section-subtitle,
[data-theme="dark"] .author-info,
[data-theme="dark"] .article-footer,
[data-theme="dark"] .trending-meta,
[data-theme="dark"] .category-info span {
    color: #94a3b8 !important;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: #ffffff !important;
}

/* Article card specific titles */
[data-theme="dark"] .article-card .article-title,
[data-theme="dark"] .article-card .article-title a,
[data-theme="dark"] .article-card h2,
[data-theme="dark"] .article-card h3,
[data-theme="dark"] .article-card h4 {
    color: #ffffff !important;
}

[data-theme="dark"] .article-card .article-title a:hover,
[data-theme="dark"] .article-card h2 a:hover,
[data-theme="dark"] .article-card h3 a:hover,
[data-theme="dark"] .article-card h4 a:hover {
    color: #60a5fa !important;
}

/* Category page card titles */
[data-theme="dark"] .category-article-card .card-title,
[data-theme="dark"] .category-article-card .card-title a {
    color: #ffffff !important;
}

[data-theme="dark"] .category-article-card .card-title a:hover {
    color: #60a5fa !important;
}

/* Search result titles */
[data-theme="dark"] .result-title,
[data-theme="dark"] .result-title a {
    color: #ffffff !important;
}

[data-theme="dark"] .result-title a:hover {
    color: #60a5fa !important;
}

/* Category and hero titles */
[data-theme="dark"] .category-title,
[data-theme="dark"] .hero-title,
[data-theme="dark"] .hero-title a,
[data-theme="dark"] .tag-title {
    color: #ffffff !important;
}

[data-theme="dark"] .hero-title a:hover {
    color: #ffffff !important;
}

/* Category description text */
[data-theme="dark"] .category-description,
[data-theme="dark"] .result-excerpt {
    color: #cbd5e1 !important;
}

/* =========================
   Navigation and Header
   ========================= */

/* Tech Header - Main container */
[data-theme="dark"] .tech-header,
[data-theme="dark"] header.tech-header {
    background: #0f172a !important;
    background-color: #0f172a !important;
    background-image: none !important;
    border-bottom: 1px solid #334155 !important;
    border-bottom-color: #334155 !important;
}

/* Header Top Section */
[data-theme="dark"] .header-top,
[data-theme="dark"] .tech-header .header-top {
    background: #0f172a !important;
    background-color: #0f172a !important;
    background-image: none !important;
}

[data-theme="dark"] .header-top .container-fluid {
    background: transparent !important;
    background-color: transparent !important;
}

/* Main Navigation */
[data-theme="dark"] .main-nav,
[data-theme="dark"] nav.main-nav {
    background: #1e293b !important;
    background-color: #1e293b !important;
    background-image: none !important;
    border-bottom: 1px solid #334155 !important;
    border-bottom-color: #334155 !important;
}

[data-theme="dark"] .main-nav .container-fluid {
    background: transparent !important;
    background-color: transparent !important;
}

[data-theme="dark"] .nav-link {
    color: #cbd5e1 !important;
    background: transparent !important;
}

[data-theme="dark"] .nav-link a {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-link.active {
    color: #ffffff !important;
    background: rgba(59, 130, 246, 0.2) !important;
    border-color: #3b82f6 !important;
}

[data-theme="dark"] .nav-link:hover a,
[data-theme="dark"] .nav-link.active a {
    color: #ffffff !important;
}

[data-theme="dark"] .nav-links a {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .nav-links a:hover,
[data-theme="dark"] .nav-links a.active {
    color: #ffffff !important;
    background: rgba(59, 130, 246, 0.2) !important;
}

[data-theme="dark"] .brand-text h1 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .brand-subtitle {
    color: #94a3b8 !important;
}

/* =========================
   Search and Modals
   ========================= */

[data-theme="dark"] .search-container {
    background-color: #1e293b !important;
}

[data-theme="dark"] .search-input {
    background-color: #0f172a !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .search-input::placeholder {
    color: #64748b !important;
}

[data-theme="dark"] .search-input-group {
    background-color: #0f172a !important;
    border-color: #334155 !important;
}

/* =========================
   Footer
   ========================= */

[data-theme="dark"] .tech-footer {
    background-color: #0f172a !important;
    border-top: 1px solid #334155 !important;
}

[data-theme="dark"] .footer-section h3,
[data-theme="dark"] .footer-section h4 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .footer-section p {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .footer-links a {
    color: #94a3b8 !important;
}

[data-theme="dark"] .footer-links a:hover {
    color: #f1f5f9 !important;
}

/* =========================
   Buttons and Controls
   ========================= */

[data-theme="dark"] .search-btn,
[data-theme="dark"] .theme-btn,
[data-theme="dark"] .menu-btn {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .back-to-top {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
}

/* =========================
   Category Pills and Tags
   ========================= */

[data-theme="dark"] .category-pill {
    background-color: #1e293b !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

/* =========================
   Images and Media
   ========================= */

[data-theme="dark"] .article-image {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

/* =========================
   Special Elements
   ========================= */

[data-theme="dark"] .newsletter-widget {
    background-color: #2563eb !important;
}

[data-theme="dark"] .trending-number {
    background-color: #2563eb !important;
}

/* =========================
   Container and Layout
   ========================= */

[data-theme="dark"] .container,
[data-theme="dark"] .container-fluid {
    color: #f1f5f9 !important;
}

/* =========================
   Ensure proper contrast
   ========================= */

[data-theme="dark"] .text-primary {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .text-secondary {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}

/* =========================
   Article Detail Page Fixes
   ========================= */

/* Article Header */
[data-theme="dark"] .article-header {
    background: #0f172a !important;
    background-image: none !important;
}

[data-theme="dark"] .article-detail-page {
    background-color: #0f172a !important;
}

/* Article Title */
[data-theme="dark"] .article-title {
    color: #ffffff !important;
}

[data-theme="dark"] .article-subtitle {
    color: #cbd5e1 !important;
}

/* Category Badge */
[data-theme="dark"] .category-badge {
    color: #ffffff !important;
    filter: brightness(0.9);
}

[data-theme="dark"] .category-badge:hover {
    color: #ffffff !important;
    filter: brightness(1.1);
}

/* Author Section */
[data-theme="dark"] .author-name {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .publish-info,
[data-theme="dark"] .publish-info time,
[data-theme="dark"] .publish-info span {
    color: #94a3b8 !important;
}

[data-theme="dark"] .share-label {
    color: #cbd5e1 !important;
}

/* Image Caption */
[data-theme="dark"] .image-caption {
    color: #94a3b8 !important;
}

[data-theme="dark"] .image-caption span {
    color: #94a3b8 !important;
}

/* Article Content Section */
[data-theme="dark"] .article-content-section {
    background-color: #0f172a !important;
}

[data-theme="dark"] .article-content {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .article-content p {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .article-content h1,
[data-theme="dark"] .article-content h2,
[data-theme="dark"] .article-content h3,
[data-theme="dark"] .article-content h4,
[data-theme="dark"] .article-content h5,
[data-theme="dark"] .article-content h6 {
    color: #ffffff !important;
}

[data-theme="dark"] .article-content ul,
[data-theme="dark"] .article-content ol,
[data-theme="dark"] .article-content li {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .article-content blockquote {
    background-color: #0f172a !important;
    color: #cbd5e1 !important;
    border-left-color: #3b82f6 !important;
}

[data-theme="dark"] .article-content a {
    color: #60a5fa !important;
}

[data-theme="dark"] .article-content a:hover {
    color: #93c5fd !important;
}

/* Article Tags */
[data-theme="dark"] .article-tags {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
}

[data-theme="dark"] .article-tags h4 {
    color: #ffffff !important;
}

[data-theme="dark"] .tag-link {
    background-color: #0f172a !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .tag-link:hover {
    background-color: #3b82f6 !important;
    color: #ffffff !important;
    border-color: #3b82f6 !important;
}

/* Article Navigation */
[data-theme="dark"] .article-navigation {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
}

[data-theme="dark"] .nav-item {
    background-color: #0f172a !important;
    border: 1px solid #334155 !important;
}

[data-theme="dark"] .nav-direction {
    color: #94a3b8 !important;
}

[data-theme="dark"] .nav-item h5 a {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .nav-item h5 a:hover {
    color: #60a5fa !important;
}

/* Sidebar Widgets */
[data-theme="dark"] .sidebar-widget.toc-widget {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
}

[data-theme="dark"] .quick-action {
    background-color: #0f172a !important;
    color: #cbd5e1 !important;
    border: 1px solid #334155 !important;
}

[data-theme="dark"] .quick-action:hover {
    background-color: #3b82f6 !important;
    color: #ffffff !important;
    border-color: #3b82f6 !important;
}

/* Sidebar Articles */
[data-theme="dark"] .sidebar-article {
    border-bottom-color: #334155 !important;
}

[data-theme="dark"] .sidebar-article-content h4 a {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .sidebar-article-content h4 a:hover {
    color: #60a5fa !important;
}

[data-theme="dark"] .sidebar-article-meta,
[data-theme="dark"] .sidebar-article-meta time,
[data-theme="dark"] .sidebar-article-meta span {
    color: #94a3b8 !important;
}

[data-theme="dark"] .no-related {
    color: #94a3b8 !important;
}

/* Newsletter Widget */
[data-theme="dark"] .newsletter-widget {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
}

[data-theme="dark"] .newsletter-widget h3 {
    color: #ffffff !important;
}

[data-theme="dark"] .newsletter-widget p {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .newsletter-widget .form-control {
    background-color: #0f172a !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .newsletter-widget .form-control::placeholder {
    color: #64748b !important;
}

[data-theme="dark"] .newsletter-widget .form-control:focus {
    background-color: #0f172a !important;
    border-color: #3b82f6 !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .newsletter-widget .btn-primary {
    background-color: #3b82f6 !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .newsletter-widget .btn-primary:hover {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
}

/* Related Articles Section */
[data-theme="dark"] .related-articles-section {
    background-color: #0f172a !important;
}

[data-theme="dark"] .section-header h2 {
    color: #ffffff !important;
}

[data-theme="dark"] .related-card {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
}

[data-theme="dark"] .related-meta .category-pill {
    background-color: #0f172a !important;
    border: 1px solid #334155 !important;
}

[data-theme="dark"] .related-content h3 a {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .related-content h3 a:hover {
    color: #60a5fa !important;
}

[data-theme="dark"] .related-content p {
    color: #94a3b8 !important;
}

[data-theme="dark"] .related-footer,
[data-theme="dark"] .related-footer time,
[data-theme="dark"] .related-footer span {
    color: #94a3b8 !important;
}

/* Fix meta separators */
[data-theme="dark"] .meta-separator {
    color: #64748b !important;
}

/* Article Image Section */
[data-theme="dark"] .article-image-section {
    background-color: #0f172a !important;
}

/* Ensure all section backgrounds are dark */
[data-theme="dark"] section {
    background-color: #0f172a !important;
}
