/*
  =====================================================================================
  07-DARK-THEME.CSS - Houtini WordPress Theme
  Complete dark mode styling consolidated from multiple sources
  =====================================================================================
*/

/* ===== DARK THEME ROOT STYLES ===== */
.dark-theme {
  background-color: var(--houtini-bg-primary);
  color: var(--houtini-text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.dark-theme * {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ===== DARK THEME HERO SECTION ===== */
.dark-theme .houtini-hero {
  background-color: var(--houtini-bg-primary);
  color: var(--houtini-text-primary);
}

.dark-theme .houtini-hero h1 {
  /* In dark mode, hero title should be plain white text, not gradient */
  color: #FFFFFF;
  background: none;
  background-image: none;
  background-clip: border-box;
  -webkit-background-clip: border-box;
  -webkit-text-fill-color: #FFFFFF;
}

.dark-theme .houtini-hero h2 {
  color: var(--houtini-text-secondary);
}

.dark-theme .houtini-hero p {
  color: var(--houtini-text-secondary);
}

/* ===== DARK THEME PROMPT CONTAINER ===== */
.dark-theme .houtini-prompt-container {
  background: var(--houtini-glass-bg-dark);
  border-color: #FF69B4; /* Pink border in dark mode like original */
  color: #FF69B4;
  box-shadow: 0 0 20px rgba(255, 105, 180, 0.2);
}

.dark-theme .prompt-text,
.dark-theme .houtini-typewriter-text {
  color: #FF69B4; /* Pink text in dark mode */
}

.dark-theme .houtini-typewriter::after {
  background-color: #FF69B4; /* Pink cursor in dark mode */
}

/* ===== DARK THEME HEADER SYSTEM ===== */
/* Fix glass morphism in dark mode - preserve blur effects */
.dark-theme .houtini-unified-header,
.dark-theme .houtini-header-glass-container {
  /* Force hardware acceleration for better backdrop-filter performance */
  will-change: backdrop-filter;
  
  /* Enhanced backdrop-filter with better browser compatibility */
  backdrop-filter: blur(20px) saturate(200%) brightness(0.8) !important;
  -webkit-backdrop-filter: blur(20px) saturate(200%) brightness(0.8) !important;
  
  /* Reduce background opacity to let backdrop-filter show through */
  background: rgba(26, 26, 26, 0.7) !important; /* Reduced opacity from 0.85 to 0.7 */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  
  /* Ensure proper stacking context for backdrop-filter */
  isolation: isolate;
  z-index: 1;
}

/* Dark theme scroll enhancement - REMOVED hard enhanced-glass state */
/* Progressive glass morphism now handled by JavaScript for smooth transitions */
/* Dark theme supports the same smooth progressive system */

/* Dark glass effect enhancement layer */
.dark-theme .houtini-header-glass-container::before {
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.02) 50%,
    rgba(255, 255, 255, 0.05) 100%);
}

/* Dark Theme Glass Container - Proper glass morphism for dark theme */
.dark-theme .houtini-header-glass-container {
  background: rgba(42, 42, 42, 0.9);
  backdrop-filter: blur(20px) saturate(200%);
  -webkit-backdrop-filter: blur(20px) saturate(200%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.dark-theme .social-bar-links {
  background: rgba(26, 26, 26, 0.9) !important; /* Same lovely dark grey in dark mode */
  padding: 8px 15px; /* Match the layout CSS padding */
  border-radius: 0; /* Remove rounded corners for full-width bar */
  margin: 0; /* Remove any margins */
}

.dark-theme .social-bar-links a {
  color: #ffffff !important; /* White text on black background */
  background: transparent;
  transition: all 0.3s ease;
}

.dark-theme .social-bar-links a:hover {
  color: var(--houtini-accent-cyan);
  background: rgba(0, 204, 255, 0.1);
  transform: translateY(-1px);
}

/* Platform-specific dark theme hover colors for social icons */
.dark-theme .houtini-social-section .social-bar-links a {
  color: #999;
}

.dark-theme .houtini-social-section .social-bar-links a:hover {
  color: var(--houtini-primary);
}

.dark-theme .houtini-social-section .social-bar-links .fab.fa-github:hover { 
  color: #fff; 
}

/* ===== DARK THEME NAVIGATION & MOBILE MENU ===== */
.dark-theme .navbar-nav .nav-link,
.dark-theme .navbar-brand {
  color: var(--houtini-text-primary);
}

.dark-theme .navbar-nav .nav-link:hover,
.dark-theme .navbar-brand:hover {
  color: var(--houtini-accent-cyan);
}

/* MOBILE OFFCANVAS MENU - Dark Mode Fix - ENHANCED SPECIFICITY */
.dark-theme .offcanvas,
.dark-theme .offcanvas-body,
.dark-theme #offcanvas-navbar,
.dark-theme .offcanvas.show {
  background-color: var(--houtini-bg-primary) !important;
  color: var(--houtini-text-primary) !important;
}

/* Navigation links with maximum specificity */
.dark-theme .offcanvas .nav-item .nav-link,
.dark-theme .offcanvas-body .nav-item .nav-link,
.dark-theme .offcanvas .navbar-nav .nav-link,
.dark-theme #offcanvas-navbar .nav-link,
.dark-theme .offcanvas .nav-item a {
  color: var(--houtini-text-primary) !important;
  background-color: transparent !important;
  padding: 12px 20px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  transition: all 0.3s ease !important;
}

/* Hover states with maximum specificity */
.dark-theme .offcanvas .nav-item .nav-link:hover,
.dark-theme .offcanvas-body .nav-item .nav-link:hover,
.dark-theme .offcanvas .navbar-nav .nav-link:hover,
.dark-theme #offcanvas-navbar .nav-link:hover,
.dark-theme .offcanvas .nav-item a:hover {
  color: var(--houtini-accent-cyan) !important;
  background-color: rgba(0, 204, 255, 0.1) !important;
  text-decoration: none !important;
}

/* Offcanvas header styling */
.dark-theme .offcanvas-header {
  background-color: var(--houtini-bg-primary) !important;
  border-bottom: 1px solid var(--houtini-gray-700) !important;
  padding: 20px !important;
}

.dark-theme .offcanvas-title {
  color: var(--houtini-text-primary) !important;
}

/* Close button styling */
.dark-theme .offcanvas .btn-close,
.dark-theme .offcanvas-header .btn-close {
  filter: invert(1) !important;
  opacity: 0.8 !important;
}

.dark-theme .offcanvas .btn-close:hover {
  opacity: 1 !important;
}

/* ===== DARK THEME BUTTONS ===== */
.dark-theme .btn-primary {
  background: var(--houtini-gradient-btn-primary);
  border: none;
  color: white;
}

.dark-theme .btn-primary:hover {
  background: var(--houtini-gradient-btn-primary-hover);
  color: white;
}

.dark-theme .btn-secondary {
  background: transparent;
  color: var(--houtini-accent-cyan);
  border: 2px solid var(--houtini-accent-cyan);
}

.dark-theme .btn-secondary:hover {
  background: var(--houtini-gradient-secondary);
  color: white;
}

/* Theme Toggle */
.dark-theme .houtini-theme-toggle {
  background: var(--houtini-gradient-accent);
  box-shadow: 0 4px 12px rgba(255, 105, 180, 0.25);
}

.dark-theme .houtini-theme-toggle:hover {
  box-shadow: 0 6px 20px rgba(255, 105, 180, 0.35);
}

/* ===== DARK THEME CARDS AND COMPONENTS ===== */
.dark-theme .card {
  background: var(--houtini-bg-white);
  color: var(--houtini-text-primary);
  border-color: var(--houtini-gray-700);
}

.dark-theme .card-title {
  color: var(--houtini-text-primary);
}

.dark-theme .card-text {
  color: var(--houtini-text-secondary);
}

/* ===== DARK THEME FORMS ===== */
.dark-theme input,
.dark-theme textarea,
.dark-theme select {
  background-color: var(--houtini-bg-white);
  color: var(--houtini-text-primary);
  border-color: var(--houtini-gray-600);
}

.dark-theme input:focus,
.dark-theme textarea:focus,
.dark-theme select:focus {
  border-color: var(--houtini-accent-cyan);
  background-color: var(--houtini-bg-white);
  box-shadow: 0 0 0 0.2rem rgba(0, 204, 255, 0.25);
}

/* ===== DARK THEME EMAIL SIGNUP ===== */
.dark-theme .email-signup-form {
  background: var(--houtini-bg-white);
  color: var(--houtini-text-primary);
}

.dark-theme .signup-title {
  color: var(--houtini-text-primary);
}

.dark-theme .signup-subtitle {
  color: var(--houtini-text-secondary);
}

.dark-theme .email-input {
  background: var(--houtini-bg-primary);
  color: var(--houtini-text-primary);
  border-color: var(--houtini-gray-600);
}

.dark-theme .email-input::placeholder {
  color: var(--houtini-text-tertiary);
}

/* ===== DARK THEME SECTIONS ===== */
.dark-theme .section,
.dark-theme .houtini-everything,
.dark-theme .houtini-requirements-section {
  background-color: var(--houtini-bg-primary);
}

.dark-theme .container {
  color: var(--houtini-text-primary);
}

.dark-theme .houtini-everything h2,
.dark-theme .houtini-requirements-content h3 {
  color: var(--houtini-text-primary);
  background: none;
  background-clip: border-box;
  -webkit-background-clip: border-box;
  -webkit-text-fill-color: var(--houtini-text-primary);
}

.dark-theme .houtini-everything p,
.dark-theme .houtini-requirements-content > p {
  color: var(--houtini-text-secondary);
}

/* ===== DARK THEME FEATURE CARDS ===== */
.dark-theme .houtini-feature-card,
.dark-theme .houtini-requirement-card {
  background: var(--houtini-bg-white);
  border: 1px solid var(--houtini-gray-700);
  color: var(--houtini-text-primary);
  box-shadow: 
    0 4px 6px rgba(0, 0, 0, 0.2),
    0 1px 3px rgba(0, 0, 0, 0.3);
}

.dark-theme .houtini-feature-card h3,
.dark-theme .houtini-requirement-info h4 {
  color: var(--houtini-text-primary);
}

.dark-theme .houtini-feature-card p,
.dark-theme .houtini-requirement-info p {
  color: var(--houtini-text-secondary);
}

.dark-theme .houtini-requirement-card:hover {
  border-color: var(--houtini-accent-cyan);
  box-shadow: 
    0 8px 25px rgba(0, 0, 0, 0.3),
    0 0 20px rgba(0, 204, 255, 0.2);
}

.dark-theme .houtini-requirement-card::before {
  background: linear-gradient(90deg, 
    transparent 0%,
    rgba(0, 204, 255, 0.1) 50%,
    transparent 100%
  );
}

/* ===== DARK THEME LINKS ===== */
.dark-theme a {
  color: var(--houtini-accent-cyan);
}

.dark-theme a:hover,
.dark-theme .houtini-requirement-info .requirement-link:hover {
  color: var(--houtini-accent-pink);
}

.dark-theme .houtini-requirement-info .requirement-link {
  color: var(--houtini-accent-cyan);
}

/* ===== DARK THEME FOOTER ===== */
.dark-theme footer,
.dark-theme .houtini-footer-unified {
  background-color: var(--houtini-bg-white);
  color: var(--houtini-text-primary);
  border-top: 1px solid var(--houtini-gray-700);
}

.dark-theme .houtini-footer-glass-container {
  background: rgba(26, 26, 26, 0.85);
  border-top-color: rgba(255, 255, 255, 0.1);
}

.dark-theme .houtini-footer-brand .houtini-logo {
  color: var(--houtini-cyan);
}

.dark-theme .houtini-footer-widgets .widget-title {
  color: var(--houtini-white);
}

.dark-theme .houtini-footer-widgets .widget ul li a {
  color: var(--houtini-gray-300);
}

.dark-theme .houtini-footer-copyright {
  color: var(--houtini-gray-500);
}

.dark-theme .houtini-footer-legal a {
  color: var(--houtini-gray-300);
}

.dark-theme .houtini-footer-bottom {
  border-top-color: var(--houtini-gray-700);
}

.dark-theme footer a {
  color: var(--houtini-text-secondary);
}

.dark-theme footer a:hover {
  color: var(--houtini-accent-cyan);
}

/* ===== DARK THEME TYPOGRAPHY & CONTENT ===== */

/* Nuclear Typography Override - Apply to ALL text content */
.dark-theme p,
.dark-theme .post-content p,
.dark-theme .entry-content p,
.dark-theme .content p,
.dark-theme article p,
.dark-theme main p,
.dark-theme .article-content p,
.dark-theme .single-article p {
  color: var(--houtini-text-primary) !important;
}

/* Strong/Bold text - Force white */
.dark-theme strong,
.dark-theme b,
.dark-theme .post-content strong,
.dark-theme .post-content b,
.dark-theme .entry-content strong,
.dark-theme .entry-content b,
.dark-theme article strong,
.dark-theme article b {
  color: #FFFFFF !important;
  font-weight: 600;
}

/* Lists - Proper contrast */
.dark-theme ul li,
.dark-theme ol li,
.dark-theme .post-content li,
.dark-theme .entry-content li {
  color: var(--houtini-text-primary) !important;
}

.dark-theme ul li::marker,
.dark-theme ol li::marker {
  color: var(--houtini-accent-cyan);
}

/* Article metadata */
.dark-theme .article-meta,
.dark-theme .article-meta *,
.dark-theme .post-meta,
.dark-theme .post-meta * {
  color: var(--houtini-text-secondary) !important;
}

/* Tables - Dark background with white text */
.dark-theme table,
.dark-theme .table-responsive table,
.dark-theme .post-content table,
.dark-theme .entry-content table {
  background: var(--houtini-table-bg) !important;
  border: 1px solid var(--houtini-table-border) !important;
  border-radius: 8px;
  color: #FFFFFF !important;
}

.dark-theme table th,
.dark-theme table td,
.dark-theme .post-content table th,
.dark-theme .post-content table td,
.dark-theme .entry-content table th,
.dark-theme .entry-content table td {
  background: var(--houtini-table-bg) !important;
  color: #FFFFFF !important;
  border: 1px solid var(--houtini-table-border) !important;
  font-family: var(--houtini-font-mono) !important;
  font-size: 0.9em !important;
  padding: 0.75rem !important;
}

.dark-theme table thead th,
.dark-theme .post-content table thead th,
.dark-theme .entry-content table thead th {
  background: var(--houtini-table-header-bg) !important;
  color: #FFFFFF !important;
  font-weight: 600 !important;
  border-bottom: 2px solid var(--houtini-table-border) !important;
}

/* Table container styling */
.dark-theme .table-responsive {
  border: 1px solid var(--houtini-table-border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  margin: 1.5rem 0;
}

/* Blockquotes - Enhanced dark styling */
.dark-theme blockquote,
.dark-theme .blockquote,
.dark-theme .post-content blockquote,
.dark-theme .entry-content blockquote {
  background: var(--houtini-blockquote-bg) !important;
  border-left: 4px solid var(--houtini-blockquote-border) !important;
  color: #FFFFFF !important;
  padding: 1.5rem 2rem !important;
  margin: 1.5rem 0 !important;
  border-radius: 0 12px 12px 0 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
  font-style: italic !important;
}

.dark-theme blockquote p,
.dark-theme .blockquote p,
.dark-theme .post-content blockquote p,
.dark-theme .entry-content blockquote p {
  color: #FFFFFF !important;
  margin-bottom: 0.5rem !important;
}

/* Content links */
.dark-theme .post-content a,
.dark-theme .entry-content a,
.dark-theme .content a {
  color: var(--houtini-accent-cyan);
  text-decoration: underline;
  text-decoration-color: rgba(0, 204, 255, 0.3);
}

.dark-theme .post-content a:hover,
.dark-theme .entry-content a:hover,
.dark-theme .content a:hover {
  color: var(--houtini-primary);
  text-decoration-color: var(--houtini-primary);
}

/* Code elements */
.dark-theme code:not(pre code),
.dark-theme .inline-code {
  background: var(--houtini-code-bg) !important;
  color: var(--houtini-accent-cyan) !important;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--houtini-code-border);
}

/* Pre and code blocks */
.dark-theme pre,
.dark-theme pre code {
  background: var(--houtini-code-bg) !important;
  color: #FFFFFF !important;
  border: 1px solid var(--houtini-code-border);
  border-radius: 8px;
  padding: 1.5rem;
}

/* Navigation Menu - Force white text and icons */
.dark-theme .navbar-nav .nav-link,
.dark-theme .navbar-toggler,
.dark-theme .navbar-toggler-icon,
.dark-theme .offcanvas-header,
.dark-theme .offcanvas-body,
.dark-theme .offcanvas-body .nav-link,
.dark-theme .offcanvas .nav-item .nav-link,
.dark-theme .offcanvas .navbar-nav .nav-link {
  color: white !important;
}

/* Enhanced mobile offcanvas navigation */
@media (max-width: 991.98px) {
  .dark-theme .offcanvas .nav-item .nav-link,
  .dark-theme .offcanvas-body .nav-item .nav-link,
  .dark-theme .offcanvas .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    /* Force proper text rendering on mobile */
    -webkit-text-fill-color: rgba(255, 255, 255, 0.9) !important;
    background: transparent !important;
  }
}

/* Touch device specific fixes */
@media (hover: none) and (pointer: coarse) {
  .dark-theme .offcanvas .nav-item .nav-link,
  .dark-theme .offcanvas-body .nav-item .nav-link {
    color: white !important;
    -webkit-text-fill-color: white !important;
  }
}

.dark-theme .navbar-toggler {
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.dark-theme .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2833, 37, 41, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
  /* White hamburger lines */
  filter: invert(1) !important;
}

/* ===== DARK THEME RESPONSIVE OVERRIDES ===== */
/* ===== ENHANCED DARK THEME BLOG CARDS ===== */
.dark-theme .houtini-post-card {
  background: rgba(26, 26, 26, 0.9);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}

.dark-theme .houtini-post-card:hover {
  background: rgba(30, 30, 30, 0.95);
  border-color: var(--houtini-primary);
  box-shadow: 0 20px 40px rgba(0, 102, 255, 0.25);
}

.dark-theme .houtini-post-title a {
  color: rgba(255, 255, 255, 0.95);
}

.dark-theme .houtini-post-title a:hover {
  color: #00CCFF;
}

.dark-theme .houtini-post-date {
  color: rgba(255, 255, 255, 0.6);
}

.dark-theme .houtini-post-author {
  color: rgba(255, 255, 255, 0.7);
}

.dark-theme .houtini-post-excerpt {
  color: rgba(255, 255, 255, 0.8);
}

.dark-theme .houtini-post-category {
  background: rgba(0, 102, 255, 0.2);
  color: #00CCFF;
}

.dark-theme .houtini-read-more {
  background: rgba(0, 102, 255, 0.1);
  color: #00CCFF;
  border-color: rgba(0, 102, 255, 0.3);
}

.dark-theme .houtini-read-more:hover {
  background: var(--houtini-primary);
  color: white;
  border-color: var(--houtini-primary);
}

@media (max-width: 768px) {
  .dark-theme body {
    background-color: var(--houtini-bg-primary);
  }
  
  .dark-theme .houtini-prompt-container {
    background: var(--houtini-glass-bg-dark);
    border-color: #FF69B4;
  }
}

/* ===== DARK THEME ACCESSIBILITY ===== */
@media (prefers-contrast: high) {
  .dark-theme {
    --houtini-bg-primary: #000000;
    --houtini-text-primary: #FFFFFF;
    --houtini-bg-white: #111111;
  }
  
  .dark-theme .houtini-prompt-container {
    border-width: 3px;
    background: #000000;
    border-color: #FFFFFF;
  }
  
  .dark-theme .btn-primary {
    background: #0066FF;
    border: 2px solid #0066FF;
  }
}