/*
  © 2025 Milos Saric. All rights reserved.
  Dark Mode Override CSS - Apple-inspired Design
  Modern, elegant dark mode styling with manual toggle support
*/

/* ====================== */
/* Dark Mode Variables    */
/* ====================== */
.dark-mode {
  /* Background Colors */
  --primary-bg: #000000;
  --secondary-bg: #1c1c1e;
  --tertiary-bg: #2c2c2e;
  --card-bg: #1c1c1e;
  --elevated-bg: #2c2c2e;
  
  /* Text Colors */
  --text-primary: #ffffff;
  --text-secondary: #98989d;
  --text-tertiary: #636366;
  --text-accent: #0a84ff;
  
  /* Interactive Colors */
  --accent: #0a84ff;
  --accent-hover: #409cff;
  --accent-active: #0070f3;
  
  /* Border & Separator Colors */
  --border-light: #38383a;
  --border-medium: #48484a;
  --border-strong: #636366;
  --separator: rgba(84, 84, 88, 0.6);
  
  /* Shadow & Effects */
  --shadow-light: rgba(0, 0, 0, 0.3);
  --shadow-medium: rgba(0, 0, 0, 0.4);
  --shadow-strong: rgba(0, 0, 0, 0.6);
  --glow-accent: rgba(10, 132, 255, 0.3);
  --backdrop-blur: rgba(28, 28, 30, 0.8);
  
  /* Glass & Translucency */
  --glass-bg: rgba(28, 28, 30, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-hover: rgba(255, 255, 255, 0.05);
}

/* ====================== */
/* Smooth Theme Transitions */
/* ====================== */

/* Only add transitions to interactive elements */
.dark-mode a,
.dark-mode button,
.dark-mode .btn,
.dark-mode .project-card,
.dark-mode .nav-menu li a,
.dark-mode input,
.dark-mode textarea {
  transition: background-color 0.3s ease, 
              color 0.3s ease, 
              border-color 0.3s ease;
}

/* ====================== */
/* Core Elements          */
/* ====================== */
.dark-mode body {
  background-color: var(--primary-bg);
  color: var(--text-primary);
}

/* Enhanced backdrop blur for better depth */
.dark-mode body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at top, rgba(10, 132, 255, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* ====================== */
/* Header & Navigation    */
/* ====================== */
.dark-mode .site-header {
  background: var(--backdrop-blur);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 1px 0 0 var(--glass-border) inset;
}

/* Enhanced glass effect on scroll */
.dark-mode .site-header.scrolled {
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: saturate(180%) blur(30px);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
}

/* Logo styling */
.dark-mode .logo a {
  color: var(--text-primary);
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.dark-mode .logo a:hover {
  color: var(--accent);
  text-shadow: 0 0 20px var(--glow-accent);
  opacity: 1;
}

/* Navigation links */
.dark-mode .nav-menu li a {
  color: rgba(255, 255, 255, 0.85);
  background: transparent;
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.dark-mode .nav-menu li a::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--glass-hover), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 8px;
}

.dark-mode .nav-menu li a:hover {
  color: var(--text-primary);
  background: var(--glass-hover);
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.dark-mode .nav-menu li a:hover::before {
  opacity: 1;
}

.dark-mode .nav-menu li a.active {
  color: var(--accent);
  background: rgba(10, 132, 255, 0.1);
  box-shadow: 0 0 20px rgba(10, 132, 255, 0.2);
}

/* Special "Remembering Dad" link */
.dark-mode .nav-menu li:last-child a {
  color: var(--text-primary);
  font-weight: 600;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  border: 1px solid var(--glass-border);
}

.dark-mode .nav-menu li:last-child a:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.1));
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.dark-mode .nav-menu li:last-child a:after {
  background: linear-gradient(90deg, var(--accent), #5ac8fa);
  height: 3px;
  border-radius: 2px;
  box-shadow: 0 0 10px var(--glow-accent);
}

/* Dark Mode Toggle Button */
.dark-mode-toggle {
  position: relative;
  background: transparent;
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-left: 1rem;
}

.dark-mode-toggle:hover {
  background: var(--glass-hover, rgba(255, 255, 255, 0.05));
  border-color: var(--border-medium, rgba(255, 255, 255, 0.2));
  transform: translateY(-1px);
}

.dark-mode-toggle svg {
  width: 20px;
  height: 20px;
  fill: var(--text-primary, #333);
  transition: all 0.3s ease;
}

.dark-mode .dark-mode-toggle {
  background: var(--glass-bg);
  border-color: var(--glass-border);
}

.dark-mode .dark-mode-toggle:hover {
  background: var(--glass-hover);
  border-color: var(--border-medium);
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
}

.dark-mode .dark-mode-toggle svg {
  fill: var(--text-primary);
}

/* ====================== */
/* Content Areas          */
/* ====================== */
.dark-mode section:nth-child(even) {
  background: var(--secondary-bg);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

/* Cards & Containers */
.dark-mode .project-card,
.dark-mode .stack-item,
.dark-mode .timeline-content,
.dark-mode .testimonial-slide {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  box-shadow: 0 8px 32px var(--shadow-medium);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-mode .project-card:hover,
.dark-mode .stack-item:hover {
  background: var(--elevated-bg);
  border-color: var(--border-medium);
  box-shadow: 0 20px 60px var(--shadow-strong);
  transform: translateY(-8px) scale(1.02);
}

/* Enhanced project card glow effect */
.dark-mode .project-card:hover {
  box-shadow: 
    0 20px 60px var(--shadow-strong),
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 0 40px rgba(10, 132, 255, 0.1);
}

/* Project tags */
.dark-mode .project-tags span {
  background: var(--tertiary-bg);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.dark-mode .project-tags span:hover,
.dark-mode .project-tags span.highlighted {
  background: rgba(10, 132, 255, 0.2);
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(10, 132, 255, 0.3);
}

/* ====================== */
/* Buttons & Interactions */
/* ====================== */
.dark-mode .btn,
.dark-mode .button-primary,
.dark-mode .project-link {
  background: linear-gradient(135deg, var(--accent), #0070f3);
  border: 1px solid var(--accent);
  box-shadow: 0 4px 20px rgba(10, 132, 255, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-mode .btn:hover,
.dark-mode .button-primary:hover,
.dark-mode .project-link:hover {
  background: linear-gradient(135deg, var(--accent-hover), #409cff);
  box-shadow: 0 8px 40px rgba(10, 132, 255, 0.4);
  transform: translateY(-2px);
}

.dark-mode .button-secondary,
.dark-mode .button-outline {
  background: var(--glass-bg);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.dark-mode .button-secondary:hover,
.dark-mode .button-outline:hover {
  background: var(--glass-hover);
  border-color: var(--border-medium);
  box-shadow: 0 8px 32px rgba(255, 255, 255, 0.1);
}

/* Filter buttons */
.dark-mode .filter-btn {
  background: var(--tertiary-bg);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.dark-mode .filter-btn:hover {
  background: rgba(10, 132, 255, 0.1);
  color: var(--accent);
  border-color: var(--accent);
}

.dark-mode .filter-btn.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 0 20px var(--glow-accent);
}

/* ====================== */
/* Forms & Inputs         */
/* ====================== */
.dark-mode input[type="text"],
.dark-mode input[type="email"],
.dark-mode input[type="tel"],
.dark-mode textarea,
.dark-mode select {
  background: var(--tertiary-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  transition: all 0.3s ease;
}

.dark-mode input:focus,
.dark-mode textarea:focus,
.dark-mode select:focus {
  background: var(--elevated-bg);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2);
  outline: none;
}

.dark-mode input::placeholder,
.dark-mode textarea::placeholder {
  color: var(--text-tertiary);
}

/* ====================== */
/* Footer                 */
/* ====================== */
.dark-mode .site-footer {
  background: var(--secondary-bg);
  border-top: 1px solid var(--border-light);
}

.dark-mode .social-links a {
  background: var(--tertiary-bg);
  border: 1px solid var(--border-light);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-mode .social-links a:hover {
  background: var(--elevated-bg);
  border-color: var(--accent);
  box-shadow: 0 8px 32px rgba(10, 132, 255, 0.2);
  transform: translateY(-3px);
}

.dark-mode .social-links a:hover::before {
  filter: brightness(0) saturate(100%) invert(36%) sepia(63%) saturate(4937%) hue-rotate(202deg) brightness(120%) contrast(101%);
}

/* ====================== */
/* Special Effects        */
/* ====================== */
.dark-mode .section-title,
.dark-mode .hero h1,
.dark-mode h1, 
.dark-mode h2, 
.dark-mode h3 {
  color: var(--text-primary);
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

/* Subtle glow on hover for interactive elements */
.dark-mode .project-card:hover .project-content h3,
.dark-mode .stack-item:hover h4 {
  color: var(--accent);
  text-shadow: 0 0 20px var(--glow-accent);
  transition: all 0.3s ease;
}

/* Enhanced video container */
.dark-mode .video-container {
  box-shadow: 0 20px 60px var(--shadow-strong);
  border: 1px solid var(--border-light);
}

/* Ripple effect enhancement */
.dark-mode .ripple {
  background: radial-gradient(circle, rgba(10, 132, 255, 0.4) 0%, transparent 70%);
}

/* Progress bars */
.dark-mode .progress {
  background: linear-gradient(90deg, var(--accent), #5ac8fa);
  box-shadow: 0 0 20px var(--glow-accent);
}

.dark-mode .progress-bar {
  background: var(--tertiary-bg);
  border: 1px solid var(--border-light);
}

/* ====================== */
/* Animations             */
/* ====================== */
/* Floating animation for CTA buttons */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
}

/* Pulse effect for accent elements */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(10, 132, 255, 0.3); }
  50% { box-shadow: 0 0 40px rgba(10, 132, 255, 0.6); }
}

/* ====================== */
/* Responsive Enhancements */
/* ====================== */
@media (max-width: 768px) {
  .dark-mode .hero {
    background: linear-gradient(135deg, var(--primary-bg) 0%, var(--secondary-bg) 100%);
  }
  
  .dark-mode .project-card {
    border-radius: 16px;
    margin-bottom: 1.5rem;
  }
  
}

/* ====================== */
/* Performance Optimizations */
/* ====================== */
/* Hardware acceleration for smooth animations */
.dark-mode .project-card,
.dark-mode .nav-menu li a,
.dark-mode .btn,
.dark-mode .social-links a {
  will-change: transform;
  transform: translateZ(0);
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ====================== */
/* Logo Image Switching   */
/* ====================== */
.logo-image {
  /* Default light mode image */
  content: url('/sarimagesc97/AVIF/Logo/MS.avif');
  transition: opacity 0.3s ease;
}

/* Dark mode image when dark-mode class is applied to body */
.dark-mode .logo-image {
  content: url('/sarimagesc97/AVIF/Logo/MS-dark.avif');
}

/* Fallback for browsers that don't support AVIF */
@supports not (content: url('data:image/avif;base64,')) {
  .logo-image {
    content: url('/sarimagesc97/WEBP/Logo/MS.webp');
  }
  
  .dark-mode .logo-image {
    content: url('/sarimagesc97/WEBP/Logo/MS-dark.webp');
  }
}

/* Additional fallback for very old browsers */
@supports not (content: url('data:image/webp;base64,')) {
  .logo-image {
    content: url('/sarimagesc97/JPGPNG/Logo/MS.png');
  }
  
  .dark-mode .logo-image {
    content: url('/sarimagesc97/JPGPNG/Logo/MS-dark.png');
  }
}

/* ====================== */
/* Sidebar Dark Mode      */
/* ====================== */
.dark-mode .sidebar,
.dark-mode #sidebar,
.dark-mode .side-nav,
.dark-mode .sidebar-content {
  background: var(--secondary-bg) !important;
  border-right: 1px solid var(--border-light);
  box-shadow: 2px 0 20px var(--shadow-medium);
}

.dark-mode .sidebar *,
.dark-mode #sidebar *,
.dark-mode .side-nav * {
  color: var(--text-primary);
}

.dark-mode .sidebar-header,
.dark-mode .sidebar h2,
.dark-mode .sidebar h3,
.dark-mode .sidebar h4 {
  color: var(--text-primary) !important;
  border-bottom: 1px solid var(--border-light);
}

.dark-mode .sidebar-nav a,
.dark-mode .sidebar ul li a,
.dark-mode .sidebar li a,
.dark-mode .side-nav a {
  color: var(--text-secondary) !important;
  transition: all 0.3s ease;
}

.dark-mode .sidebar-nav a:hover,
.dark-mode .sidebar ul li a:hover,
.dark-mode .sidebar li a:hover,
.dark-mode .side-nav a:hover {
  color: var(--text-primary) !important;
  background: var(--glass-hover) !important;
}

.dark-mode .sidebar-nav a.active,
.dark-mode .sidebar ul li a.active,
.dark-mode .sidebar li a.active,
.dark-mode .side-nav a.active {
  color: var(--accent) !important;
  background: rgba(10, 132, 255, 0.1) !important;
  border-left: 3px solid var(--accent);
}

.dark-mode .sidebar ul,
.dark-mode .sidebar li {
  color: var(--text-primary);
}

.dark-mode .sidebar-overlay {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ====================== */
/* Hero Section           */
/* ====================== */
.dark-mode .hero-section {
  background: linear-gradient(135deg, var(--primary-bg) 0%, var(--secondary-bg) 100%);
}

.dark-mode .hero-content h1 {
  color: var(--text-primary);
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.dark-mode .hero-content p {
  color: var(--text-secondary);
}

/* ====================== */
/* Notebook Section       */
/* ====================== */
.dark-mode .notebook-section {
  background: var(--primary-bg);
}

.dark-mode .notebook-cell {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px var(--shadow-medium);
  transition: all 0.3s ease;
}

.dark-mode .notebook-cell:hover {
  border-color: var(--border-medium);
  box-shadow: 0 12px 40px var(--shadow-strong);
}

.dark-mode .markdown-cell h3 {
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-light);
}

.dark-mode .cell-content {
  color: var(--text-primary);
}

/* ====================== */
/* Table Styling          */
/* ====================== */
.dark-mode table {
  background: var(--secondary-bg) !important;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
}

.dark-mode table * {
  color: var(--text-primary) !important;
}

.dark-mode table thead {
  background: var(--tertiary-bg) !important;
}

.dark-mode table thead th {
  color: var(--text-primary) !important;
  font-weight: 600;
  padding: 1rem;
  text-align: left;
  border-bottom: 2px solid var(--border-medium);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--tertiary-bg) !important;
}

.dark-mode table tbody {
  background: var(--secondary-bg) !important;
}

.dark-mode table tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: all 0.2s ease;
  background: var(--secondary-bg) !important;
}

.dark-mode table tbody tr:hover {
  background: var(--tertiary-bg) !important;
  box-shadow: inset 0 0 0 1px var(--border-medium);
}

.dark-mode table tbody tr:last-child {
  border-bottom: none;
}

.dark-mode table tbody td {
  color: var(--text-primary) !important;
  padding: 1rem;
  vertical-align: top;
  background: transparent !important;
}

.dark-mode table tbody td strong {
  color: var(--accent) !important;
  font-weight: 600;
}

/* Code elements in table */
.dark-mode table code {
  background: var(--tertiary-bg) !important;
  color: var(--accent) !important;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.85em;
  border: 1px solid var(--border-light);
}

/* First column (function names) */
.dark-mode table tbody td:first-child {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  white-space: nowrap;
}

/* Return type column */
.dark-mode table tbody td:nth-child(4) {
  color: var(--text-secondary) !important;
  font-style: italic;
}

/* Example usage column */
.dark-mode table tbody td:last-child {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.9em;
}

/* ====================== */
/* Back to Top Button     */
/* ====================== */
.dark-mode #backToTop,
.dark-mode .floating-top-btn {
  background: var(--glass-bg);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px var(--shadow-medium);
}

.dark-mode #backToTop:hover,
.dark-mode .floating-top-btn:hover {
  background: var(--glass-hover);
  border-color: var(--accent);
  box-shadow: 0 12px 40px rgba(10, 132, 255, 0.3);
  transform: translateY(-2px);
}

/* ====================== */
/* Container              */
/* ====================== */
.dark-mode .container {
  color: var(--text-primary);
}

/* ====================== */
/* Scrollbar Styling      */
/* ====================== */
.dark-mode ::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.dark-mode ::-webkit-scrollbar-track {
  background: var(--secondary-bg);
}

.dark-mode ::-webkit-scrollbar-thumb {
  background: var(--tertiary-bg);
  border-radius: 6px;
  border: 2px solid var(--secondary-bg);
}

.dark-mode ::-webkit-scrollbar-thumb:hover {
  background: var(--border-medium);
}

/* ====================== */
/* Responsive Table       */
/* ====================== */
@media (max-width: 768px) {
  .dark-mode table {
    font-size: 0.85rem;
  }
  
  .dark-mode table thead th,
  .dark-mode table tbody td {
    padding: 0.75rem 0.5rem;
  }
  
  /* Make table scrollable on mobile */
  .dark-mode .notebook-cell {
    overflow-x: auto;
  }
}

/*
 * Dark Mode Fixes for Mega Menu and Sidebar
 * Add these styles to your dark-mode.css file
 */

/* ====================== */
/* MEGA MENU DARK MODE    */
/* ====================== */

/* Base mega menu container */
.dark-mode .python-mega-menu {
  background: rgba(28, 28, 30, 0.95);
  backdrop-filter: saturate(180%) blur(30px);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* Mega menu backdrop */
.dark-mode .mega-menu-backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Section titles */
.dark-mode .mega-menu-title {
  color: var(--text-primary);
  border-bottom: 2px solid var(--accent);
}

.dark-mode .mega-menu-title::after {
  background: linear-gradient(90deg, var(--accent), #5ac8fa);
}

/* Links */
.dark-mode .mega-menu-links a {
  color: var(--text-secondary);
}

.dark-mode .mega-menu-links a:hover {
  color: var(--accent);
  background: var(--glass-hover);
}

.dark-mode .mega-menu-links a::before {
  background: linear-gradient(90deg, transparent, rgba(10, 132, 255, 0.2), transparent);
}

.dark-mode .mega-menu-links a:focus {
  outline: 2px solid var(--accent);
}

/* Active navigation item */
.dark-mode .python-nav-item.active .python-nav-trigger {
  color: var(--accent);
  background: var(--glass-hover);
}

/* Mobile mega menu */
@media (max-width: 768px) {
  .dark-mode .python-mega-menu {
    background: rgba(0, 0, 0, 0.98);
  }
  
  .dark-mode .mega-menu-close {
    color: var(--text-primary);
  }
  
  .dark-mode .mega-menu-close:hover {
    background: var(--glass-hover);
  }
}

/* ====================== */
/* SIDEBAR DARK MODE      */
/* ====================== */

/* Sidebar container */
.dark-mode .projects-sidebar {
  background: var(--backdrop-blur);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-right: 1px solid var(--glass-border);
  box-shadow: 2px 0 20px var(--shadow-medium);
}

/* Sidebar header */
.dark-mode .sidebar-header {
  border-bottom: 1px solid var(--border-light);
}

.dark-mode .sidebar-header h3 {
  color: var(--text-primary);
}

/* Sidebar toggle button */
.dark-mode .sidebar-toggle {
  color: var(--text-secondary);
}

.dark-mode .sidebar-toggle:hover {
  background: var(--glass-hover);
  color: var(--text-primary);
}

/* Navigation sections */
.dark-mode .nav-section h4 {
  color: var(--text-tertiary);
}

.dark-mode .nav-section a {
  color: var(--text-secondary);
}

.dark-mode .nav-section a:hover {
  background: var(--glass-hover);
  color: var(--text-primary);
}

.dark-mode .nav-section a.active {
  background: rgba(10, 132, 255, 0.15);
  color: var(--accent);
}

.dark-mode .nav-section a.active::before {
  background: var(--accent);
}

.dark-mode .nav-section a.completed {
  color: var(--text-tertiary);
}

/* Sidebar footer */
.dark-mode .sidebar-footer {
  border-top: 1px solid var(--border-light);
}

.dark-mode .collapse-btn {
  color: var(--text-secondary);
}

.dark-mode .collapse-btn:hover {
  background: var(--glass-hover);
  color: var(--text-primary);
}

/* Collapsed sidebar tooltip */
.dark-mode .projects-sidebar.collapsed .nav-section a:hover::after {
  background: var(--elevated-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  box-shadow: 0 8px 32px var(--shadow-strong);
}

/* Sidebar overlay */
.dark-mode .sidebar-overlay {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Scrollbar styling */
.dark-mode .sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--border-medium);
}

.dark-mode .sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

/* Mobile sidebar */
@media (max-width: 768px) {
  .dark-mode .projects-sidebar {
    background: rgba(28, 28, 30, 0.98);
    backdrop-filter: saturate(180%) blur(30px);
    -webkit-backdrop-filter: saturate(180%) blur(30px);
  }

  .dark-mode .projects-sidebar.open {
    box-shadow: 4px 0 40px var(--shadow-strong);
  }
}

/* ====================== */
/* ADDITIONAL ENHANCEMENTS */
/* ====================== */

/* Smooth transitions for theme switching */
.dark-mode .python-mega-menu,
.dark-mode .projects-sidebar,
.dark-mode .mega-menu-links a,
.dark-mode .nav-section a {
  transition: background-color 0.3s ease, 
              color 0.3s ease, 
              border-color 0.3s ease,
              box-shadow 0.3s ease;
}

/* Glow effects on active items */
.dark-mode .nav-section a.active {
  box-shadow: inset 0 0 0 1px rgba(10, 132, 255, 0.3);
}

/* Focus states */
.dark-mode .nav-section a:focus,
.dark-mode .sidebar-toggle:focus,
.dark-mode .collapse-btn:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.dark-mode .mega-menu-links a:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ====================== */
/* Biography Section      */
/* ====================== */
.dark-mode .biography-section {
  background: var(--secondary-bg);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.dark-mode .biography-content h2 {
  color: var(--text-primary);
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.dark-mode .biography-content p {
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ====================== */
/* Quotes Section         */
/* ====================== */
.dark-mode .quotes-section {
  background: var(--primary-bg);
}

.dark-mode .quotes-section blockquote {
  color: var(--text-primary);
  border-left: 4px solid var(--accent);
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 8px 32px var(--shadow-medium);
}

.dark-mode .quotes-section blockquote::before,
.dark-mode .quotes-section blockquote::after {
  color: var(--accent);
  opacity: 0.3;
}

/* ====================== */
/* Influence Section      */
/* ====================== */
.dark-mode .influence-section {
  background: var(--secondary-bg);
  border-top: 1px solid var(--border-light);
}

.dark-mode .influence-content h2 {
  color: var(--text-primary);
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.dark-mode .influence-content p {
  color: var(--text-secondary);
}

.dark-mode .impact-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
}

.dark-mode .impact-link:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent);
  text-shadow: 0 0 20px var(--glow-accent);
}

/* ====================== */
/* Tribute Hero Section   */
/* ====================== */
.dark-mode .tribute-hero {
  background: linear-gradient(135deg, var(--primary-bg) 0%, var(--secondary-bg) 100%);
}

.dark-mode .tribute-hero h1 {
  color: var(--text-primary);
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.dark-mode .tribute-hero .father-name {
  color: var(--accent);
  text-shadow: 0 0 20px var(--glow-accent);
}

.dark-mode .tribute-hero .hero-subtitle {
  color: var(--text-secondary);
}

/* ====================== */
/* Contact Page           */
/* ====================== */

/* Contact Hero Section */
.dark-mode .contact-hero {
  background: linear-gradient(135deg, var(--primary-bg) 0%, var(--secondary-bg) 100%);
}

.dark-mode .contact-hero h1 {
  color: var(--text-primary);
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.dark-mode .contact-hero .hero-subtitle {
  color: var(--text-secondary);
}

/* Contact Section */
.dark-mode .contact-section {
  background: var(--primary-bg);
}

/* Contact Grid */
.dark-mode .contact-grid {
  display: grid;
  gap: 3rem;
}

/* Contact Information Card */
.dark-mode .contact-info {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 8px 32px var(--shadow-medium);
  transition: all 0.3s ease;
}

.dark-mode .contact-info:hover {
  border-color: var(--border-medium);
  box-shadow: 0 12px 40px var(--shadow-strong);
  transform: translateY(-4px);
}

.dark-mode .contact-info h2 {
  color: var(--text-primary);
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-light);
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

/* Info Items */
.dark-mode .info-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-light);
  transition: all 0.3s ease;
}

.dark-mode .info-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.dark-mode .info-item:hover {
  padding-left: 0.5rem;
  border-left: 3px solid var(--accent);
}

.dark-mode .info-item h3 {
  color: var(--accent);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.dark-mode .info-item p {
  color: var(--text-primary);
  font-size: 1.1rem;
  margin: 0;
}

.dark-mode .info-item a {
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  display: inline-block;
}

.dark-mode .info-item a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background: linear-gradient(90deg, var(--accent), #5ac8fa);
  transition: width 0.3s ease;
}

.dark-mode .info-item a:hover {
  color: var(--accent);
  text-shadow: 0 0 20px var(--glow-accent);
}

.dark-mode .info-item a:hover::after {
  width: 100%;
}

/* Contact Form Card */
.dark-mode .contact-form {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 8px 32px var(--shadow-medium);
  transition: all 0.3s ease;
}

.dark-mode .contact-form:hover {
  border-color: var(--border-medium);
  box-shadow: 0 12px 40px var(--shadow-strong);
}

.dark-mode .contact-form h2 {
  color: var(--text-primary);
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-light);
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

/* Form Groups */
.dark-mode .form-group {
  margin-bottom: 1.5rem;
}

.dark-mode .form-group label {
  color: var(--text-secondary);
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Form Inputs */
.dark-mode .contact-form input[type="text"],
.dark-mode .contact-form input[type="email"],
.dark-mode .contact-form textarea {
  width: 100%;
  padding: 1rem;
  background: var(--tertiary-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
}

.dark-mode .contact-form input[type="text"]:focus,
.dark-mode .contact-form input[type="email"]:focus,
.dark-mode .contact-form textarea:focus {
  background: var(--elevated-bg);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2);
  outline: none;
  transform: translateY(-1px);
}

.dark-mode .contact-form input::placeholder,
.dark-mode .contact-form textarea::placeholder {
  color: var(--text-tertiary);
}

/* Textarea specific */
.dark-mode .contact-form textarea {
  resize: vertical;
  min-height: 150px;
}

/* Submit Button */
.dark-mode .contact-form .button-primary {
  width: 100%;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--accent), #0070f3);
  color: white;
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(10, 132, 255, 0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.dark-mode .contact-form .button-primary:hover {
  background: linear-gradient(135deg, var(--accent-hover), #409cff);
  box-shadow: 0 8px 40px rgba(10, 132, 255, 0.5);
  transform: translateY(-2px);
}

.dark-mode .contact-form .button-primary:active {
  transform: translateY(0);
  box-shadow: 0 4px 20px rgba(10, 132, 255, 0.3);
}

/* Honeypot field (keep hidden) */
.dark-mode .contact-form input[name="_gotcha"] {
  display: none !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .dark-mode .contact-info,
  .dark-mode .contact-form {
    padding: 1.5rem;
  }
  
  .dark-mode .info-item {
    padding: 1rem 0;
  }
}

/* Cool purple accent for "Get in Touch" title */
.dark-mode .contact-hero h1 {
  background: linear-gradient(135deg, var(--accent), #a855f7, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  background-size: 200% 200%;
}

@keyframes gradient-shift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* Add subtle glow effect to the hero title */
.dark-mode .contact-hero h1::before {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  z-index: -1;
  background: linear-gradient(135deg, var(--accent), #a855f7, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: blur(20px);
  opacity: 0.5;
}

/* Enhanced form validation states */
.dark-mode .contact-form input:valid,
.dark-mode .contact-form textarea:valid {
  border-color: #4ade80;
}

.dark-mode .contact-form input:invalid:not(:placeholder-shown),
.dark-mode .contact-form textarea:invalid:not(:placeholder-shown) {
  border-color: #ef4444;
}

/* Loading state for form submission */
.dark-mode .contact-form .button-primary:disabled {
  background: var(--tertiary-bg);
  border-color: var(--border-light);
  cursor: not-allowed;
  opacity: 0.6;
}

/* Success/Error message styling (if you add them) */
.dark-mode .form-message {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.dark-mode .form-message.success {
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid #4ade80;
  color: #4ade80;
}

.dark-mode .form-message.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid #ef4444;
  color: #ef4444;
}

/* ====================== */
/* About Page             */
/* ====================== */

/* About Hero Section */
.dark-mode .hero {
  background: linear-gradient(135deg, var(--primary-bg) 0%, var(--secondary-bg) 100%);
}

.dark-mode .hero h1 {
  background: linear-gradient(135deg, var(--accent), #a855f7, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
}

.dark-mode .hero .hero-subtitle {
  color: var(--text-secondary);
}

/* About Intro Section */
.dark-mode .about-intro {
  background: var(--secondary-bg);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.dark-mode .intro-heading {
  color: var(--text-primary);
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.dark-mode .intro-text {
  color: var(--text-secondary);
  line-height: 1.8;
}

/* Video Showcase Section */
.dark-mode .video-showcase {
  background: var(--primary-bg);
}

.dark-mode .video-showcase .section-title {
  color: var(--text-primary);
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.dark-mode .video-container {
  border: 1px solid var(--border-light);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px var(--shadow-strong);
  transition: all 0.3s ease;
}

.dark-mode .video-container:hover {
  border-color: var(--border-medium);
  box-shadow: 0 30px 80px var(--shadow-strong), 
              0 0 40px rgba(10, 132, 255, 0.1);
  transform: translateY(-4px);
}

.dark-mode .portfolio-video {
  display: block;
  width: 100%;
}

/* Skills Grid Section */
.dark-mode .skills-grid-section {
  background: var(--secondary-bg);
  border-top: 1px solid var(--border-light);
}

.dark-mode .skills-grid-section .section-title {
  color: var(--text-primary);
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

/* Skills Filter Buttons */
.dark-mode .skills-filter {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3rem;
}

.dark-mode .filter-btn {
  background: var(--tertiary-bg);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.dark-mode .filter-btn:hover {
  background: rgba(10, 132, 255, 0.1);
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.dark-mode .filter-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--glow-accent);
}

/* Skills Grid */
.dark-mode .skills-grid {
  display: grid;
  gap: 2rem;
}

.dark-mode .skill-item {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 2rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.dark-mode .skill-item:hover {
  background: var(--elevated-bg);
  border-color: var(--border-medium);
  box-shadow: 0 12px 40px var(--shadow-strong);
  transform: translateY(-4px);
}

.dark-mode .skill-logo {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  transition: all 0.3s ease;
}

.dark-mode .skill-item:hover .skill-logo {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--glow-accent);
}

.dark-mode .skill-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dark-mode .skill-info h3 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.dark-mode .skill-info p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* Experience Section */
.dark-mode .experience-section {
  background: var(--primary-bg);
}

.dark-mode .experience-section .section-title {
  color: var(--text-primary);
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.dark-mode .experience-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.dark-mode .experience-item {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 2rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-mode .experience-item:hover {
  background: var(--elevated-bg);
  border-color: var(--accent);
  box-shadow: 0 12px 40px var(--shadow-strong);
  transform: translateX(8px);
}

.dark-mode .experience-header {
  margin-bottom: 1rem;
}

.dark-mode .experience-title {
  color: var(--text-primary);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.dark-mode .experience-company {
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.dark-mode .experience-date {
  color: var(--text-tertiary);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
}

.dark-mode .experience-description {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* Testimonials Section */
.dark-mode .testimonials {
  background: var(--secondary-bg);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.dark-mode .testimonials .section-title {
  color: var(--text-primary);
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.dark-mode .testimonial-slider {
  position: relative;
}

.dark-mode .testimonial-slide {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 3rem;
  box-shadow: 0 8px 32px var(--shadow-medium);
  transition: all 0.3s ease;
}

.dark-mode .testimonial-slide:hover {
  border-color: var(--border-medium);
  box-shadow: 0 12px 40px var(--shadow-strong);
  transform: translateY(-4px);
}

.dark-mode .testimonial-quote {
  color: var(--text-primary);
  font-size: 1.2rem;
  line-height: 1.8;
  font-style: italic;
  margin-bottom: 2rem;
  position: relative;
  padding-left: 2rem;
}

.dark-mode .testimonial-quote::before {
  content: '"';
  position: absolute;
  left: 0;
  top: -10px;
  font-size: 4rem;
  color: var(--accent);
  opacity: 0.3;
  font-family: Georgia, serif;
}

.dark-mode .testimonial-author {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.dark-mode .author-image {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  object-fit: cover;
  box-shadow: 0 4px 12px var(--shadow-medium);
}

.dark-mode .author-info h4 {
  color: var(--text-primary);
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
}

.dark-mode .author-info p {
  color: var(--text-secondary);
  margin: 0;
  font-size: 0.9rem;
}

/* Testimonial Controls */
.dark-mode .testimonial-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin-top: 2rem;
}

.dark-mode .prev-slide,
.dark-mode .next-slide {
  background: var(--tertiary-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.dark-mode .prev-slide:hover,
.dark-mode .next-slide:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 0 20px var(--glow-accent);
  transform: scale(1.1);
}

.dark-mode .slide-indicators {
  display: flex;
  gap: 0.5rem;
}

.dark-mode .indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-light);
  cursor: pointer;
  transition: all 0.3s ease;
}

.dark-mode .indicator.active,
.dark-mode .indicator:hover {
  background: var(--accent);
  box-shadow: 0 0 10px var(--glow-accent);
  transform: scale(1.2);
}

/* CTA Section */
.dark-mode .cta-section {
  background: linear-gradient(135deg, var(--primary-bg) 0%, var(--secondary-bg) 100%);
  position: relative;
  overflow: hidden;
}

.dark-mode .cta-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, rgba(10, 132, 255, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.dark-mode .cta-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.dark-mode .cta-content h2 {
  color: var(--text-primary);
  font-size: 2.5rem;
  margin-bottom: 1rem;
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.dark-mode .cta-content p {
  color: var(--text-secondary);
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

.dark-mode .cta-buttons .btn {
  background: linear-gradient(135deg, var(--accent), #0070f3);
  color: white;
  border: 1px solid var(--accent);
  padding: 1rem 3rem;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(10, 132, 255, 0.3);
}

.dark-mode .cta-buttons .btn:hover {
  background: linear-gradient(135deg, var(--accent-hover), #409cff);
  box-shadow: 0 8px 40px rgba(10, 132, 255, 0.5);
  transform: translateY(-4px) scale(1.05);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .dark-mode .skill-item {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
  
  .dark-mode .skill-logo {
    margin-bottom: 1rem;
  }
  
  .dark-mode .experience-item {
    padding: 1.5rem;
  }
  
  .dark-mode .testimonial-slide {
    padding: 2rem;
  }
  
  .dark-mode .testimonial-quote {
    font-size: 1rem;
  }
  
  .dark-mode .cta-content h2 {
    font-size: 1.8rem;
  }
}

/* ====================== */
/* Projects Page          */
/* ====================== */

/* Page Header */
.dark-mode .page-header {
  background: linear-gradient(135deg, var(--primary-bg) 0%, var(--secondary-bg) 100%);
  position: relative;
  overflow: hidden;
}

.dark-mode .page-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at top right, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
              radial-gradient(ellipse at bottom left, rgba(10, 132, 255, 0.15) 0%, transparent 50%);
  pointer-events: none;
}

@keyframes gradient-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.dark-mode .page-title {
  background: linear-gradient(135deg, #0a84ff, #a855f7, #ec4899, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 300% 300%;
  font-size: 3rem;
  font-weight: 800;
  text-shadow: none;
  position: relative;
  z-index: 2;
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.dark-mode .page-subtitle {
  color: var(--text-secondary);
  font-size: 1.3rem;
  line-height: 1.8;
  position: relative;
  z-index: 2;
}

/* Category Navigation */
.dark-mode .category-nav {
  background: var(--secondary-bg);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 70px;
  z-index: 100;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.dark-mode .category-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.5rem 0;
}

.dark-mode .category-btn {
  background: var(--tertiary-bg);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  padding: 0.75rem 2rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

.dark-mode .category-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(10, 132, 255, 0.3), transparent);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.dark-mode .category-btn:hover {
  background: rgba(10, 132, 255, 0.1);
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(10, 132, 255, 0.2);
}

.dark-mode .category-btn:hover::before {
  width: 300px;
  height: 300px;
}

.dark-mode .category-btn.active {
  background: linear-gradient(135deg, var(--accent), #a855f7);
  color: white;
  border-color: transparent;
  box-shadow: 0 0 30px rgba(10, 132, 255, 0.5);
}

/* Projects Container */
.dark-mode .projects-container {
  background: var(--primary-bg);
}

/* Project Sections */
.dark-mode .project-section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--border-light);
  transition: all 0.5s ease;
}

.dark-mode .project-section:hover {
  background: linear-gradient(135deg, 
    rgba(10, 132, 255, 0.02) 0%, 
    rgba(168, 85, 247, 0.02) 100%);
}

/* Project Container */
.dark-mode .project-container {
  display: grid;
  gap: 3rem;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.dark-mode .project-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, 
    rgba(10, 132, 255, 0.05) 0%, 
    rgba(168, 85, 247, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.dark-mode .project-container:hover {
  border-color: var(--accent);
  box-shadow: 
    0 20px 60px var(--shadow-strong),
    0 0 0 1px rgba(10, 132, 255, 0.2),
    0 0 60px rgba(10, 132, 255, 0.15);
  transform: translateY(-8px) scale(1.01);
}

.dark-mode .project-container:hover::before {
  opacity: 1;
}

/* Project Image */
.dark-mode .project-image {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--border-light);
  transition: all 0.4s ease;
}

.dark-mode .project-container:hover .project-image {
  border-color: var(--accent);
  box-shadow: 0 0 40px rgba(10, 132, 255, 0.3);
}

.dark-mode .project-image img {
  width: 100%;
  height: auto;
  display: block;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  filter: brightness(0.9);
}

.dark-mode .project-container:hover .project-image img {
  transform: scale(1.05);
  filter: brightness(1);
}

.dark-mode .project-image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, 
    rgba(10, 132, 255, 0.1) 0%, 
    rgba(168, 85, 247, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.dark-mode .project-container:hover .project-image::after {
  opacity: 1;
}

/* Project Content */
.dark-mode .project-content {
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.dark-mode .project-content h3 {
  color: var(--text-primary);
  font-size: 1.8rem;
  margin-bottom: 1rem;
  line-height: 1.3;
  transition: all 0.3s ease;
  position: relative;
  display: inline-block;
}

.dark-mode .project-container:hover .project-content h3 {
  background: linear-gradient(135deg, var(--accent), #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dark-mode .project-content p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

/* Project Tags */
.dark-mode .project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.dark-mode .project-tags span {
  background: var(--tertiary-bg);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  border: 1px solid var(--border-light);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.dark-mode .project-tags span::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(10, 132, 255, 0.3), transparent);
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
  border-radius: 50%;
}

.dark-mode .project-tags span:hover {
  background: rgba(10, 132, 255, 0.15);
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(10, 132, 255, 0.2);
}

.dark-mode .project-tags span:hover::before {
  width: 200px;
  height: 200px;
}

/* Project Buttons */
.dark-mode .practical-examples-btn {
  background: linear-gradient(135deg, var(--accent), #a855f7);
  color: white;
  padding: 1rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(10, 132, 255, 0.3);
}

.dark-mode .practical-examples-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
  border-radius: 50%;
}

.dark-mode .practical-examples-btn:hover {
  background: linear-gradient(135deg, #409cff, #b76cf7);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 40px rgba(10, 132, 255, 0.5);
}

.dark-mode .practical-examples-btn:hover::before {
  width: 300px;
  height: 300px;
}

.dark-mode .practical-examples-btn:active {
  transform: translateY(-1px) scale(1.02);
}

/* Multiple Buttons Layout */
.dark-mode .project-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.dark-mode .project-buttons .practical-examples-btn {
  flex: 1;
  min-width: 250px;
  justify-content: center;
}

/* Footer Note */
.dark-mode .diabetes-tool-footer {
  background: var(--secondary-bg);
  border-top: 1px solid var(--border-light);
  padding: 3rem 0;
}

.dark-mode .diabetes-tool-footer p {
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem;
  text-align: justify;
}

/* Responsive Design */
@media (min-width: 768px) {
  .dark-mode .project-container {
    grid-template-columns: 1fr 1fr;
  }
  
  .dark-mode .project-section:nth-child(even) .project-container {
    direction: rtl;
  }
  
  .dark-mode .project-section:nth-child(even) .project-content {
    direction: ltr;
  }
}

@media (max-width: 767px) {
  .dark-mode .page-title {
    font-size: 2rem;
  }
  
  .dark-mode .page-subtitle {
    font-size: 1rem;
  }
  
  .dark-mode .category-btn {
    padding: 0.6rem 1.5rem;
    font-size: 0.85rem;
  }
  
  .dark-mode .project-content {
    padding: 1.5rem;
  }
  
  .dark-mode .project-content h3 {
    font-size: 1.4rem;
  }
  
  .dark-mode .project-buttons .practical-examples-btn {
    min-width: 100%;
  }
}

/* Smooth Scrolling */
@media (prefers-reduced-motion: no-preference) {
  .dark-mode .project-section {
    scroll-margin-top: 150px;
  }
}

/* Special Effects */
.dark-mode .project-container:hover .project-content h3::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #a855f7, transparent);
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Loading Animation for Project Images */
.dark-mode .project-image::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(10, 132, 255, 0.1), 
    transparent);
  transition: left 0.5s ease;
}

.dark-mode .project-container:hover .project-image::before {
  left: 100%;
}

/* ====================== */
/* INDEX PAGE DARK MODE   */
/* Enhanced with purple accents and animations */
/* ====================== */

/* Hero Section - Enhanced with gradient animation */
.dark-mode .hero {
  background: linear-gradient(135deg, var(--primary-bg) 0%, var(--secondary-bg) 100%);
  position: relative;
  overflow: hidden;
}

.dark-mode .hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at top right, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
              radial-gradient(ellipse at bottom left, rgba(10, 132, 255, 0.15) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

@keyframes gradient-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.dark-mode .hero-container {
  position: relative;
  z-index: 1;
}

/* Hero Title with animated gradient */
.dark-mode .hero-main-content h1 {
  background: linear-gradient(135deg, #0a84ff, #a855f7, #ec4899, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 300% 300%;
  font-weight: 800;
  text-shadow: none;
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.dark-mode .hero-subtitle {
  color: var(--text-secondary);
  line-height: 1.8;
}

/* Hero Profile Image - Enhanced with glow */
.dark-mode .hero-image-container {
  position: relative;
}

.dark-mode .hero-profile-image {
  border: 3px solid var(--accent);
  box-shadow: 
    0 20px 60px var(--shadow-strong),
    0 0 40px rgba(10, 132, 255, 0.3),
    0 0 80px rgba(168, 85, 247, 0.2);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-mode .hero-profile-image:hover {
  transform: scale(1.05) translateY(-8px);
  box-shadow: 
    0 30px 80px var(--shadow-strong),
    0 0 60px rgba(10, 132, 255, 0.5),
    0 0 120px rgba(168, 85, 247, 0.4);
  border-color: #a855f7;
}

/* Social Section */
.dark-mode .social-section {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 8px 32px var(--shadow-medium);
  transition: all 0.3s ease;
}

.dark-mode .social-section:hover {
  border-color: var(--border-medium);
  box-shadow: 0 12px 40px var(--shadow-strong);
  transform: translateY(-4px);
}

.dark-mode .social-text {
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.dark-mode .social-text .serbian {
  color: var(--text-secondary);
  font-style: italic;
}

/* Social Buttons - Enhanced with gradients */
.dark-mode .social-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.dark-mode .social-btn {
  padding: 1rem 1.5rem;
  border-radius: 12px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.dark-mode .social-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
  border-radius: 50%;
}

.dark-mode .social-btn:hover::before {
  width: 300px;
  height: 300px;
}

/* GitHub Button */
.dark-mode .social-btn.github {
  background: linear-gradient(135deg, #24292e, #1a1e22);
  color: white;
  border-color: #333;
}

.dark-mode .social-btn.github:hover {
  background: linear-gradient(135deg, #2f363d, #24292e);
  border-color: #666;
  box-shadow: 0 8px 32px rgba(36, 41, 46, 0.5);
  transform: translateY(-4px) scale(1.02);
}

/* YouTube Button */
.dark-mode .social-btn.youtube {
  background: linear-gradient(135deg, #ff0000, #cc0000);
  color: white;
  border-color: #ff0000;
}

.dark-mode .social-btn.youtube:hover {
  background: linear-gradient(135deg, #ff3333, #ff0000);
  border-color: #ff3333;
  box-shadow: 0 8px 32px rgba(255, 0, 0, 0.5);
  transform: translateY(-4px) scale(1.02);
}

/* LinkedIn Button */
.dark-mode .social-btn.linkedin {
  background: linear-gradient(135deg, #0077b5, #005582);
  color: white;
  border-color: #0077b5;
}

.dark-mode .social-btn.linkedin:hover {
  background: linear-gradient(135deg, #0095d5, #0077b5);
  border-color: #0095d5;
  box-shadow: 0 8px 32px rgba(0, 119, 181, 0.5);
  transform: translateY(-4px) scale(1.02);
}

/* Email Button */
.dark-mode .social-btn.email {
  background: linear-gradient(135deg, var(--accent), #a855f7);
  color: white;
  border-color: var(--accent);
}

.dark-mode .social-btn.email:hover {
  background: linear-gradient(135deg, #409cff, #b76cf7);
  border-color: #a855f7;
  box-shadow: 0 8px 32px rgba(10, 132, 255, 0.5);
  transform: translateY(-4px) scale(1.02);
}

/* Featured Projects Section */
.dark-mode .featured_projects-section {
  background: var(--secondary-bg);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  position: relative;
}

.dark-mode .featured_projects-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, rgba(168, 85, 247, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.dark-mode .section-title {
  background: linear-gradient(135deg, #0a84ff, #a855f7, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 300% 300%;
  font-weight: 800;
  text-shadow: none;
}

/* Projects Grid */
.dark-mode .projects-grid {
  display: grid;
  gap: 2.5rem;
  position: relative;
  z-index: 1;
}

/* Project Cards - FIXED IMAGE VISIBILITY */
.dark-mode .project-card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 8px 32px var(--shadow-medium);
}

.dark-mode .project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, 
    rgba(10, 132, 255, 0.05) 0%, 
    rgba(168, 85, 247, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 0;
}

.dark-mode .project-card:hover {
  border-color: var(--accent);
  box-shadow: 
    0 20px 60px var(--shadow-strong),
    0 0 0 1px rgba(10, 132, 255, 0.2),
    0 0 60px rgba(10, 132, 255, 0.15);
  transform: translateY(-8px) scale(1.02);
}

.dark-mode .project-card:hover::before {
  opacity: 1;
}

/* Project Image Container - FIXED */
.dark-mode .project-image {
  position: relative;
  overflow: hidden;
  border-radius: 16px 16px 0 0;
  background: var(--tertiary-bg); /* Fallback background */
  z-index: 1;
}

/* Project Images - CRITICAL FIX */
.dark-mode .project-image img,
.dark-mode .project-image picture,
.dark-mode .project-image source {
  display: block;
  width: 100%;
  height: auto;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  filter: brightness(0.85) contrast(1.1); /* Enhance visibility */
  opacity: 1 !important; /* Force visibility */
  visibility: visible !important; /* Force visibility */
}

.dark-mode .project-card:hover .project-image img {
  transform: scale(1.08);
  filter: brightness(1) contrast(1.2);
}

/* Image overlay for better visibility */
.dark-mode .project-image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, 
    transparent 0%, 
    rgba(10, 132, 255, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.dark-mode .project-card:hover .project-image::after {
  opacity: 1;
}

/* Shimmer effect on hover */
.dark-mode .project-image::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(10, 132, 255, 0.2), 
    transparent);
  transition: left 0.7s ease;
  z-index: 2;
}

.dark-mode .project-card:hover .project-image::before {
  left: 100%;
}

/* Project Content */
.dark-mode .project-content {
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.dark-mode .project-content h3 {
  color: var(--text-primary);
  font-size: 1.5rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
  position: relative;
  display: inline-block;
}

.dark-mode .project-card:hover .project-content h3 {
  background: linear-gradient(135deg, var(--accent), #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dark-mode .project-content h3::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #a855f7, transparent);
  transition: width 0.4s ease;
}

.dark-mode .project-card:hover .project-content h3::after {
  width: 100%;
}

.dark-mode .project-content p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

/* Project Tags */
.dark-mode .project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.dark-mode .project-tags span {
  background: var(--tertiary-bg);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  border: 1px solid var(--border-light);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.dark-mode .project-tags span::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(10, 132, 255, 0.3), transparent);
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
  border-radius: 50%;
}

.dark-mode .project-tags span:hover {
  background: rgba(10, 132, 255, 0.15);
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(10, 132, 255, 0.2);
}

.dark-mode .project-tags span:hover::before {
  width: 200px;
  height: 200px;
}

/* Project Link Button */
.dark-mode .project-link {
  background: linear-gradient(135deg, var(--accent), #a855f7);
  color: white;
  padding: 0.875rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(10, 132, 255, 0.3);
}

.dark-mode .project-link::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
  border-radius: 50%;
}

.dark-mode .project-link:hover {
  background: linear-gradient(135deg, #409cff, #b76cf7);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 40px rgba(10, 132, 255, 0.5);
}

.dark-mode .project-link:hover::before {
  width: 300px;
  height: 300px;
}

.dark-mode .project-link:active {
  transform: translateY(-1px) scale(1.02);
}

/* Pulse animation for cards */
@keyframes card-pulse {
  0%, 100% { 
    box-shadow: 0 8px 32px var(--shadow-medium);
  }
  50% { 
    box-shadow: 0 12px 40px var(--shadow-strong),
                0 0 30px rgba(10, 132, 255, 0.1);
  }
}

.dark-mode .project-card:hover {
  animation: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .dark-mode .hero-main-content h1 {
    font-size: 1.75rem;
  }
  
  .dark-mode .social-section {
    padding: 1.5rem;
  }
  
  .dark-mode .social-buttons {
    gap: 0.75rem;
  }
  
  .dark-mode .social-btn {
    padding: 0.875rem 1.25rem;
    font-size: 0.95rem;
  }
  
  .dark-mode .project-content {
    padding: 1.5rem;
  }
  
  .dark-mode .project-content h3 {
    font-size: 1.25rem;
  }
}

/* Smooth scroll behavior */
@media (prefers-reduced-motion: no-preference) {
  .dark-mode .project-card {
    scroll-margin-top: 100px;
  }
}

/* Loading state for images */
.dark-mode .project-image img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dark-mode .project-image img[loading="lazy"].loaded,
.dark-mode .project-image img {
  opacity: 1;
}

/* ====================== */
/* YOUTUBE VIDEOS PAGE DARK MODE */
/* Enhanced with purple accents and animations */
/* ====================== */

/* Video Hero Section - Enhanced with gradient animation */
.dark-mode .video-hero {
  background: linear-gradient(135deg, var(--primary-bg) 0%, var(--secondary-bg) 100%);
  position: relative;
  overflow: hidden;
  padding: 6rem 0;
}

.dark-mode .video-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at top right, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
              radial-gradient(ellipse at bottom left, rgba(10, 132, 255, 0.15) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

@keyframes gradient-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.dark-mode .video-hero .container {
  position: relative;
  z-index: 1;
}

/* Video Hero Title with animated gradient */
.dark-mode .video-hero h1 {
  background: linear-gradient(135deg, #0a84ff, #a855f7, #ec4899, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 300% 300%;
  font-weight: 800;
  font-size: 3rem;
  margin-bottom: 1rem;
  text-shadow: none;
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.dark-mode .video-hero p {
  color: var(--text-secondary);
  font-size: 1.3rem;
  line-height: 1.8;
}

/* Language Switcher Section */
.dark-mode .language-switcher {
  background: var(--secondary-bg);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  padding: 1.5rem 0;
  position: sticky;
  top: 70px;
  z-index: 100;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.dark-mode .language-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.dark-mode .language-tab {
  background: var(--tertiary-bg);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  padding: 0.875rem 2rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  font-size: 1rem;
  position: relative;
  overflow: hidden;
}

.dark-mode .language-tab::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(10, 132, 255, 0.3), transparent);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.dark-mode .language-tab:hover {
  background: rgba(10, 132, 255, 0.1);
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(10, 132, 255, 0.2);
}

.dark-mode .language-tab:hover::before {
  width: 300px;
  height: 300px;
}

.dark-mode .language-tab.active {
  background: linear-gradient(135deg, var(--accent), #a855f7);
  color: white;
  border-color: transparent;
  box-shadow: 0 0 30px rgba(10, 132, 255, 0.5);
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(10, 132, 255, 0.3); }
  50% { box-shadow: 0 0 40px rgba(10, 132, 255, 0.6); }
}

/* Video Posts Section */
.dark-mode .video-posts {
  background: var(--primary-bg);
  padding: 4rem 0;
  position: relative;
}

.dark-mode .video-posts::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, rgba(168, 85, 247, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.dark-mode .video-posts .container {
  position: relative;
  z-index: 1;
}

/* Search Container */
.dark-mode .search-container {
  margin-bottom: 2rem;
}

.dark-mode .search-input-wrapper {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.dark-mode .search-icon {
  position: absolute;
  left: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
  z-index: 2;
}

.dark-mode .search-input {
  width: 100%;
  padding: 1rem 1.5rem 1rem 3.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 50px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px var(--shadow-light);
}

.dark-mode .search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2),
              0 8px 32px var(--shadow-medium);
  background: var(--elevated-bg);
}

.dark-mode .search-input::placeholder {
  color: var(--text-tertiary);
}

.dark-mode .search-clear {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
}

.dark-mode .search-input:not(:placeholder-shown) ~ .search-clear {
  opacity: 1;
  visibility: visible;
}

.dark-mode .search-clear:hover {
  background: var(--glass-hover);
  color: var(--text-primary);
  transform: translateY(-50%) scale(1.1);
}

/* Video Filters */
.dark-mode .video-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3rem;
  padding: 0 1rem;
}

.dark-mode .filter-btn {
  background: var(--tertiary-bg);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  padding: 0.75rem 2rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: capitalize;
  position: relative;
  overflow: hidden;
}

.dark-mode .filter-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(10, 132, 255, 0.3), transparent);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.dark-mode .filter-btn:hover {
  background: rgba(10, 132, 255, 0.1);
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(10, 132, 255, 0.2);
}

.dark-mode .filter-btn:hover::before {
  width: 300px;
  height: 300px;
}

.dark-mode .filter-btn.active {
  background: linear-gradient(135deg, var(--accent), #a855f7);
  color: white;
  border-color: transparent;
  box-shadow: 0 0 30px rgba(10, 132, 255, 0.5);
}

/* Videos Grid */
.dark-mode .videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2.5rem;
  padding: 0 1rem;
}

/* Video Cards - FIXED IMAGE VISIBILITY */
.dark-mode .video-card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 8px 32px var(--shadow-medium);
  cursor: pointer;
}

.dark-mode .video-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, 
    rgba(10, 132, 255, 0.05) 0%, 
    rgba(168, 85, 247, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 0;
}

.dark-mode .video-card:hover {
  border-color: var(--accent);
  box-shadow: 
    0 20px 60px var(--shadow-strong),
    0 0 0 1px rgba(10, 132, 255, 0.2),
    0 0 60px rgba(10, 132, 255, 0.15);
  transform: translateY(-8px) scale(1.02);
}

.dark-mode .video-card:hover::before {
  opacity: 1;
}

/* Video Thumbnail - CRITICAL FIX */
.dark-mode .video-thumbnail {
  position: relative;
  overflow: hidden;
  background: var(--tertiary-bg); /* Fallback background */
  aspect-ratio: 16 / 9;
  z-index: 1;
}

/* Video Thumbnail Images - FIXED */
.dark-mode .video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  filter: brightness(0.85) contrast(1.1); /* Enhance visibility */
  opacity: 1 !important; /* Force visibility */
  visibility: visible !important; /* Force visibility */
  display: block;
}

.dark-mode .video-card:hover .video-thumbnail img {
  transform: scale(1.1);
  filter: brightness(1) contrast(1.2);
}

/* Play Button Overlay */
.dark-mode .play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 32px rgba(10, 132, 255, 0.5);
  z-index: 2;
}

.dark-mode .video-card:hover .play-button {
  transform: translate(-50%, -50%) scale(1.2);
  box-shadow: 0 12px 48px rgba(10, 132, 255, 0.7);
  background: linear-gradient(135deg, #409cff, #b76cf7);
}

.dark-mode .play-button svg {
  width: 28px;
  height: 28px;
  margin-left: 4px;
}

/* Video Duration Badge */
.dark-mode .video-duration {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Thumbnail overlay for better visibility */
.dark-mode .video-thumbnail::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, 
    transparent 0%, 
    rgba(0, 0, 0, 0.3) 100%);
  opacity: 0.5;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.dark-mode .video-card:hover .video-thumbnail::after {
  opacity: 0.7;
}

/* Shimmer effect on hover */
.dark-mode .video-thumbnail::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(10, 132, 255, 0.2), 
    transparent);
  transition: left 0.7s ease;
  z-index: 3;
}

.dark-mode .video-card:hover .video-thumbnail::before {
  left: 100%;
}

/* Video Content */
.dark-mode .video-content {
  padding: 1.5rem;
  position: relative;
  z-index: 1;
}

.dark-mode .video-category {
  display: inline-block;
  background: rgba(10, 132, 255, 0.15);
  color: var(--accent);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
  border: 1px solid rgba(10, 132, 255, 0.3);
  transition: all 0.3s ease;
}

.dark-mode .video-card:hover .video-category {
  background: rgba(168, 85, 247, 0.2);
  color: #a855f7;
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}

.dark-mode .video-title {
  color: var(--text-primary);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  line-height: 1.4;
  transition: all 0.3s ease;
  position: relative;
  display: inline;
}

.dark-mode .video-card:hover .video-title {
  background: linear-gradient(135deg, var(--accent), #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dark-mode .video-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dark-mode .video-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.dark-mode .video-date {
  color: var(--text-tertiary);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Video Modal */
.dark-mode .video-modal {
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.dark-mode .video-modal-backdrop {
  background: rgba(0, 0, 0, 0.9);
}

.dark-mode .video-modal-content {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  box-shadow: 0 30px 90px var(--shadow-strong);
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
}

.dark-mode .video-modal-close {
  position: absolute;
  top: -3rem;
  right: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
}

.dark-mode .video-modal-close:hover {
  background: var(--elevated-bg);
  border-color: var(--accent);
  box-shadow: 0 0 30px rgba(10, 132, 255, 0.5);
  transform: rotate(90deg) scale(1.1);
}

.dark-mode .video-player-container {
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.dark-mode .video-player-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Pulse animation for video cards */
@keyframes card-pulse {
  0%, 100% { 
    box-shadow: 0 8px 32px var(--shadow-medium);
  }
  50% { 
    box-shadow: 0 12px 40px var(--shadow-strong),
                0 0 30px rgba(10, 132, 255, 0.1);
  }
}

.dark-mode .video-card:hover {
  animation: none;
}

/* Hidden cards (filtered) */
.dark-mode .video-card.hidden {
  display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .dark-mode .video-hero h1 {
    font-size: 2rem;
  }
  
  .dark-mode .video-hero p {
    font-size: 1rem;
  }
  
  .dark-mode .language-tab {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }
  
  .dark-mode .filter-btn {
    padding: 0.6rem 1.5rem;
    font-size: 0.85rem;
  }
  
  .dark-mode .videos-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .dark-mode .video-content {
    padding: 1.25rem;
  }
  
  .dark-mode .video-title {
    font-size: 1.1rem;
  }
  
  .dark-mode .play-button {
    width: 60px;
    height: 60px;
  }
  
  .dark-mode .play-button svg {
    width: 24px;
    height: 24px;
  }
  
  .dark-mode .video-modal-content {
    max-width: 95vw;
  }
  
  .dark-mode .video-modal-close {
    top: -2.5rem;
    width: 36px;
    height: 36px;
  }
}

/* Loading state for images */
.dark-mode .video-thumbnail img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dark-mode .video-thumbnail img[loading="lazy"].loaded,
.dark-mode .video-thumbnail img {
  opacity: 1;
}

/* Smooth scroll behavior */
@media (prefers-reduced-motion: no-preference) {
  .dark-mode .video-card {
    scroll-margin-top: 150px;
  }
}

/* Special shimmer effect for active language tab */
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.dark-mode .language-tab.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.1), 
    transparent);
  background-size: 200% 100%;
  pointer-events: none;
}

/* Glow effect for featured videos (optional) */
.dark-mode .video-card[data-featured="true"] {
  border-color: var(--accent);
  box-shadow: 0 12px 40px rgba(10, 132, 255, 0.3);
}

.dark-mode .video-card[data-featured="true"]::before {
  opacity: 0.5;
}

/* Empty state styling (when no videos match filter) */
.dark-mode .videos-grid:empty::after {
  content: 'No videos found matching your search.';
  display: block;
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.2rem;
  padding: 4rem 2rem;
  grid-column: 1 / -1;
}

/* Accessibility improvements */
.dark-mode .video-card:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.dark-mode .filter-btn:focus,
.dark-mode .language-tab:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ====================== */
/* PYTHON THEORY PAGE DARK MODE */
/* Enhanced with purple accents and animations */
/* ====================== */

/* Main Content Area */
.dark-mode .main-content {
  background: var(--primary-bg);
  color: var(--text-primary);
  min-height: 100vh;
}

/* Hero Section - Enhanced with gradient animation */
.dark-mode .hero-section {
  background: linear-gradient(135deg, var(--primary-bg) 0%, var(--secondary-bg) 100%);
  position: relative;
  overflow: hidden;
  padding: 6rem 0 4rem;
  border-bottom: 1px solid var(--border-light);
}

.dark-mode .hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at top right, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
              radial-gradient(ellipse at bottom left, rgba(10, 132, 255, 0.15) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

@keyframes gradient-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.dark-mode .hero-content {
  position: relative;
  z-index: 1;
}

/* Hero Title with animated gradient */
.dark-mode .hero-content h1,
.dark-mode .hero-section h1 {
  background: linear-gradient(135deg, #0a84ff, #a855f7, #ec4899, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 300% 300%;
  font-weight: 800;
  font-size: 3rem;
  margin-bottom: 1rem;
  text-shadow: none;
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.dark-mode .hero-content p,
.dark-mode .hero-section p {
  color: var(--text-secondary);
  font-size: 1.2rem;
  line-height: 1.8;
  max-width: 800px;
  margin: 0 auto;
}

/* Notebook Section */
.dark-mode .notebook-section {
  background: var(--secondary-bg);
  padding: 4rem 0;
  position: relative;
}

.dark-mode .notebook-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, rgba(168, 85, 247, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.dark-mode .notebook-section .container {
  position: relative;
  z-index: 1;
}

/* Notebook Cells */
.dark-mode .notebook-cell {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 2.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px var(--shadow-medium);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.dark-mode .notebook-cell::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, 
    rgba(10, 132, 255, 0.03) 0%, 
    rgba(168, 85, 247, 0.03) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.dark-mode .notebook-cell:hover {
  border-color: var(--border-medium);
  box-shadow: 0 12px 40px var(--shadow-strong);
  transform: translateY(-4px);
}

.dark-mode .notebook-cell:hover::before {
  opacity: 1;
}

/* Markdown Cell Headings */
.dark-mode .markdown-cell h3,
.dark-mode .cell-content h3 {
  color: #ffffff !important;
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-light);
  position: relative;
  font-weight: 700;
}

.dark-mode .markdown-cell h3::after,
.dark-mode .cell-content h3::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), #a855f7);
  box-shadow: 0 0 10px var(--glow-accent);
}

/* Cell Content */
.dark-mode .cell-content {
  color: var(--text-primary);
  line-height: 1.8;
}

.dark-mode .cell-content p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

/* ====================== */
/* TABLE STYLING - CRITICAL FIX */
/* ====================== */

.dark-mode table {
  background: var(--secondary-bg) !important;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
  box-shadow: 0 4px 20px var(--shadow-light);
  margin: 2rem 0;
}

/* Force visibility of all table elements */
.dark-mode table,
.dark-mode table *,
.dark-mode table tbody,
.dark-mode table thead,
.dark-mode table tr,
.dark-mode table th,
.dark-mode table td {
  opacity: 1 !important;
  visibility: visible !important;
  display: table !important;
}

.dark-mode table thead {
  display: table-header-group !important;
}

.dark-mode table tbody {
  display: table-row-group !important;
}

.dark-mode table tr {
  display: table-row !important;
}

.dark-mode table th,
.dark-mode table td {
  display: table-cell !important;
}

/* Table Header */
.dark-mode table thead {
  background: var(--tertiary-bg) !important;
  border-bottom: 2px solid var(--accent);
}

.dark-mode table thead th {
  color: #ffffff !important;
  font-weight: 700;
  padding: 1.25rem 1rem;
  text-align: left;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--tertiary-bg) !important;
  border-bottom: 2px solid var(--accent);
  position: relative;
}

.dark-mode table thead th::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), #a855f7, transparent);
  opacity: 0.5;
}

/* Table Body */
.dark-mode table tbody {
  background: var(--secondary-bg) !important;
}

.dark-mode table tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: all 0.2s ease;
  background: var(--secondary-bg) !important;
}

.dark-mode table tbody tr:hover {
  background: var(--elevated-bg) !important;
  box-shadow: inset 0 0 0 1px rgba(10, 132, 255, 0.2);
  transform: scale(1.01);
}

.dark-mode table tbody tr:last-child {
  border-bottom: none;
}

/* Table Cells */
.dark-mode table tbody td {
  color: #ffffff !important;
  padding: 1.25rem 1rem;
  vertical-align: top;
  background: transparent !important;
  font-size: 0.95rem;
  line-height: 1.6;
  font-weight: 500;
}

/* First column - Function names */
.dark-mode table tbody td:first-child,
.dark-mode table tbody td:first-child strong {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-weight: 800;
  color: #60a5fa !important;
  white-space: nowrap;
  font-size: 1rem;
}

/* Second column - Purpose */
.dark-mode table tbody td:nth-child(2) {
  color: #e5e5e5 !important;
  max-width: 250px;
  font-weight: 500;
}

/* Code elements in table */
.dark-mode table code {
  background: var(--tertiary-bg) !important;
  color: #c084fc !important;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.875rem;
  border: 1px solid var(--border-light);
  font-weight: 700;
  display: inline-block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dark-mode table tbody td:nth-child(3) code {
  color: #60a5fa !important;
  border-color: rgba(10, 132, 255, 0.3);
}

/* Return type column */
.dark-mode table tbody td:nth-child(4) {
  color: #f472b6 !important;
  font-style: italic;
  font-weight: 700;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Example usage column */
.dark-mode table tbody td:last-child {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.875rem;
  color: #e5e5e5 !important;
  font-weight: 500;
}

.dark-mode table tbody td:last-child code {
  background: rgba(10, 132, 255, 0.15) !important;
  color: #60a5fa !important;
  border-color: rgba(10, 132, 255, 0.3);
  font-weight: 700;
}

/* Strong/Bold text in tables */
.dark-mode table strong {
  color: var(--accent) !important;
  font-weight: 700;
}

/* Alternating row colors for better readability */
.dark-mode table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02) !important;
}

.dark-mode table tbody tr:nth-child(odd) {
  background: var(--secondary-bg) !important;
}

/* Table wrapper for overflow */
.dark-mode .notebook-cell {
  overflow-x: auto;
}

.dark-mode .cell-content {
  overflow-x: auto;
}

/* Scrollbar for table */
.dark-mode .notebook-cell::-webkit-scrollbar {
  height: 8px;
}

.dark-mode .notebook-cell::-webkit-scrollbar-track {
  background: var(--tertiary-bg);
  border-radius: 4px;
}

.dark-mode .notebook-cell::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 4px;
}

.dark-mode .notebook-cell::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ====================== */
/* RESPONSIVE TABLE       */
/* ====================== */

@media (max-width: 1024px) {
  .dark-mode table {
    font-size: 0.875rem;
  }
  
  .dark-mode table thead th,
  .dark-mode table tbody td {
    padding: 1rem 0.75rem;
  }
}

@media (max-width: 768px) {
  .dark-mode .hero-content h1,
  .dark-mode .hero-section h1 {
    font-size: 2rem;
  }
  
  .dark-mode .hero-content p,
  .dark-mode .hero-section p {
    font-size: 1rem;
  }
  
  .dark-mode .notebook-cell {
    padding: 1.5rem;
    border-radius: 12px;
  }
  
  .dark-mode table {
    font-size: 0.8rem;
    border-radius: 8px;
  }
  
  .dark-mode table thead th,
  .dark-mode table tbody td {
    padding: 0.875rem 0.5rem;
  }
  
  .dark-mode table code {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
  }
  
  /* Stack table on very small screens */
  .dark-mode .notebook-cell {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ====================== */
/* Additional Enhancements */
/* ====================== */

/* Shimmer effect on table hover */
.dark-mode table tbody tr::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(10, 132, 255, 0.1), 
    transparent);
  transition: left 0.5s ease;
  pointer-events: none;
}

.dark-mode table tbody tr:hover::before {
  left: 100%;
}

.dark-mode table tbody tr {
  position: relative;
}

/* Glow effect for code on hover */
.dark-mode table code:hover {
  box-shadow: 0 0 15px rgba(10, 132, 255, 0.5);
  transform: scale(1.05);
  transition: all 0.2s ease;
}

/* Pulse animation for section */
@keyframes section-pulse {
  0%, 100% { 
    box-shadow: 0 8px 32px var(--shadow-medium);
  }
  50% { 
    box-shadow: 0 12px 40px var(--shadow-strong),
                0 0 30px rgba(10, 132, 255, 0.1);
  }
}

.dark-mode .notebook-cell:hover {
  animation: none;
}

/* Loading state */
.dark-mode table {
  animation: fadeIn 0.5s ease-in;
}

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

/* Print styles for dark mode */
@media print {
  .dark-mode table {
    background: white !important;
    color: black !important;
    border: 1px solid #ddd !important;
  }
  
  .dark-mode table thead th,
  .dark-mode table tbody td {
    color: black !important;
    background: white !important;
  }
  
  .dark-mode table code {
    background: #f5f5f5 !important;
    color: #333 !important;
    border: 1px solid #ddd !important;
  }
}

/* Accessibility improvements */
.dark-mode table:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.dark-mode table tbody tr:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* Better link visibility in tables (if any) */
.dark-mode table a {
  color: var(--accent) !important;
  text-decoration: underline;
  transition: all 0.2s ease;
}

.dark-mode table a:hover {
  color: #a855f7 !important;
  text-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

/* Container adjustments */
.dark-mode .container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

@media (max-width: 768px) {
  .dark-mode .container {
    padding: 0 1rem;
  }
}

/* Fix for sidebar overlap */
.dark-mode .main-content {
  margin-left: 0;
  transition: margin-left 0.3s ease;
}

@media (min-width: 769px) {
  .dark-mode .main-content.sidebar-open {
    margin-left: 280px;
  }
}

/* Empty table fallback */
.dark-mode table:empty::after {
  content: 'Loading table data...';
  display: block;
  text-align: center;
  color: var(--text-secondary);
  padding: 2rem;
  font-style: italic;
}

/* ====================== */
/* PYTHON THEORY PAGE DARK MODE */
/* Enhanced with purple accents and animations */
/* ====================== */

/* Main Content Area */
.dark-mode .main-content {
  background: var(--primary-bg);
  color: var(--text-primary);
  min-height: 100vh;
}

/* Hero Section - Enhanced with gradient animation */
.dark-mode .hero-section {
  background: linear-gradient(135deg, var(--primary-bg) 0%, var(--secondary-bg) 100%);
  position: relative;
  overflow: hidden;
  padding: 6rem 0 4rem;
  border-bottom: 1px solid var(--border-light);
}

.dark-mode .hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at top right, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
              radial-gradient(ellipse at bottom left, rgba(10, 132, 255, 0.15) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

@keyframes gradient-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.dark-mode .hero-content {
  position: relative;
  z-index: 1;
}

/* Hero Title with animated gradient */
.dark-mode .hero-content h1,
.dark-mode .hero-section h1 {
  background: linear-gradient(135deg, #0a84ff, #a855f7, #ec4899, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 300% 300%;
  font-weight: 800;
  font-size: 3rem;
  margin-bottom: 1rem;
  text-shadow: none;
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.dark-mode .hero-content p,
.dark-mode .hero-section p {
  color: var(--text-secondary);
  font-size: 1.2rem;
  line-height: 1.8;
  max-width: 800px;
  margin: 0 auto;
}

/* Notebook Section */
.dark-mode .notebook-section {
  background: var(--secondary-bg);
  padding: 4rem 0;
  position: relative;
}

.dark-mode .notebook-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, rgba(168, 85, 247, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.dark-mode .notebook-section .container {
  position: relative;
  z-index: 1;
}

/* Notebook Cells */
.dark-mode .notebook-cell {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 2.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px var(--shadow-medium);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.dark-mode .notebook-cell::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, 
    rgba(10, 132, 255, 0.03) 0%, 
    rgba(168, 85, 247, 0.03) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.dark-mode .notebook-cell:hover {
  border-color: var(--border-medium);
  box-shadow: 0 12px 40px var(--shadow-strong);
  transform: translateY(-4px);
}

.dark-mode .notebook-cell:hover::before {
  opacity: 1;
}

/* Markdown Cell Headings */
.dark-mode .markdown-cell h3,
.dark-mode .cell-content h3 {
  color: #ffffff !important;
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-light);
  position: relative;
  font-weight: 700;
}

.dark-mode .markdown-cell h3::after,
.dark-mode .cell-content h3::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), #a855f7);
  box-shadow: 0 0 10px var(--glow-accent);
}

/* Cell Content */
.dark-mode .cell-content {
  color: var(--text-primary);
  line-height: 1.8;
}

.dark-mode .cell-content p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

/* ====================== */
/* TABLE STYLING - CRITICAL FIX */
/* ====================== */

.dark-mode table {
  background: var(--secondary-bg) !important;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
  box-shadow: 0 4px 20px var(--shadow-light);
  margin: 2rem 0;
}

/* Force visibility of all table elements */
.dark-mode table,
.dark-mode table *,
.dark-mode table tbody,
.dark-mode table thead,
.dark-mode table tr,
.dark-mode table th,
.dark-mode table td {
  opacity: 1 !important;
  visibility: visible !important;
  display: table !important;
}

.dark-mode table thead {
  display: table-header-group !important;
}

.dark-mode table tbody {
  display: table-row-group !important;
}

.dark-mode table tr {
  display: table-row !important;
}

.dark-mode table th,
.dark-mode table td {
  display: table-cell !important;
}

/* Table Header */
.dark-mode table thead {
  background: var(--tertiary-bg) !important;
  border-bottom: 2px solid var(--accent);
}

.dark-mode table thead th {
  color: #ffffff !important;
  font-weight: 700;
  padding: 1.25rem 1rem;
  text-align: left;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--tertiary-bg) !important;
  border-bottom: 2px solid var(--accent);
  position: relative;
}

.dark-mode table thead th::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), #a855f7, transparent);
  opacity: 0.5;
}

/* Table Body */
.dark-mode table tbody {
  background: var(--secondary-bg) !important;
}

.dark-mode table tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: all 0.2s ease;
  background: var(--secondary-bg) !important;
}

.dark-mode table tbody tr:hover {
  background: var(--elevated-bg) !important;
  box-shadow: inset 0 0 0 1px rgba(10, 132, 255, 0.2);
  transform: scale(1.01);
}

.dark-mode table tbody tr:last-child {
  border-bottom: none;
}

/* Table Cells */
.dark-mode table tbody td {
  color: #ffffff !important;
  padding: 1.25rem 1rem;
  vertical-align: top;
  background: transparent !important;
  font-size: 0.95rem;
  line-height: 1.6;
  font-weight: 500;
}

/* First column - Function names */
.dark-mode table tbody td:first-child,
.dark-mode table tbody td:first-child strong {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-weight: 800;
  color: #60a5fa !important;
  white-space: nowrap;
  font-size: 1rem;
}

/* Second column - Purpose */
.dark-mode table tbody td:nth-child(2) {
  color: #e5e5e5 !important;
  max-width: 250px;
  font-weight: 500;
}

/* Code elements in table */
.dark-mode table code {
  background: var(--tertiary-bg) !important;
  color: #c084fc !important;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.875rem;
  border: 1px solid var(--border-light);
  font-weight: 700;
  display: inline-block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dark-mode table tbody td:nth-child(3) code {
  color: #60a5fa !important;
  border-color: rgba(10, 132, 255, 0.3);
}

/* Return type column */
.dark-mode table tbody td:nth-child(4) {
  color: #f472b6 !important;
  font-style: italic;
  font-weight: 700;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Example usage column */
.dark-mode table tbody td:last-child {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.875rem;
  color: #e5e5e5 !important;
  font-weight: 500;
}

.dark-mode table tbody td:last-child code {
  background: rgba(10, 132, 255, 0.15) !important;
  color: #60a5fa !important;
  border-color: rgba(10, 132, 255, 0.3);
  font-weight: 700;
}

/* Strong/Bold text in tables */
.dark-mode table strong {
  color: var(--accent) !important;
  font-weight: 700;
}

/* Alternating row colors for better readability */
.dark-mode table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02) !important;
}

.dark-mode table tbody tr:nth-child(odd) {
  background: var(--secondary-bg) !important;
}

/* Table wrapper for overflow */
.dark-mode .notebook-cell {
  overflow-x: auto;
}

.dark-mode .cell-content {
  overflow-x: auto;
}

/* Scrollbar for table */
.dark-mode .notebook-cell::-webkit-scrollbar {
  height: 8px;
}

.dark-mode .notebook-cell::-webkit-scrollbar-track {
  background: var(--tertiary-bg);
  border-radius: 4px;
}

.dark-mode .notebook-cell::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 4px;
}

.dark-mode .notebook-cell::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ====================== */
/* RESPONSIVE TABLE       */
/* ====================== */

@media (max-width: 1024px) {
  .dark-mode table {
    font-size: 0.875rem;
  }
  
  .dark-mode table thead th,
  .dark-mode table tbody td {
    padding: 1rem 0.75rem;
  }
}

@media (max-width: 768px) {
  .dark-mode .hero-content h1,
  .dark-mode .hero-section h1 {
    font-size: 2rem;
  }
  
  .dark-mode .hero-content p,
  .dark-mode .hero-section p {
    font-size: 1rem;
  }
  
  .dark-mode .notebook-cell {
    padding: 1.5rem;
    border-radius: 12px;
  }
  
  .dark-mode table {
    font-size: 0.8rem;
    border-radius: 8px;
  }
  
  .dark-mode table thead th,
  .dark-mode table tbody td {
    padding: 0.875rem 0.5rem;
  }
  
  .dark-mode table code {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
  }
  
  /* Stack table on very small screens */
  .dark-mode .notebook-cell {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ====================== */
/* Additional Enhancements */
/* ====================== */

/* Shimmer effect on table hover */
.dark-mode table tbody tr::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(10, 132, 255, 0.1), 
    transparent);
  transition: left 0.5s ease;
  pointer-events: none;
}

.dark-mode table tbody tr:hover::before {
  left: 100%;
}

.dark-mode table tbody tr {
  position: relative;
}

/* Glow effect for code on hover */
.dark-mode table code:hover {
  box-shadow: 0 0 15px rgba(10, 132, 255, 0.5);
  transform: scale(1.05);
  transition: all 0.2s ease;
}

/* Pulse animation for section */
@keyframes section-pulse {
  0%, 100% { 
    box-shadow: 0 8px 32px var(--shadow-medium);
  }
  50% { 
    box-shadow: 0 12px 40px var(--shadow-strong),
                0 0 30px rgba(10, 132, 255, 0.1);
  }
}

.dark-mode .notebook-cell:hover {
  animation: none;
}

/* Loading state */
.dark-mode table {
  animation: fadeIn 0.5s ease-in;
}

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

/* Print styles for dark mode */
@media print {
  .dark-mode table {
    background: white !important;
    color: black !important;
    border: 1px solid #ddd !important;
  }
  
  .dark-mode table thead th,
  .dark-mode table tbody td {
    color: black !important;
    background: white !important;
  }
  
  .dark-mode table code {
    background: #f5f5f5 !important;
    color: #333 !important;
    border: 1px solid #ddd !important;
  }
}

/* Accessibility improvements */
.dark-mode table:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.dark-mode table tbody tr:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* Better link visibility in tables (if any) */
.dark-mode table a {
  color: var(--accent) !important;
  text-decoration: underline;
  transition: all 0.2s ease;
}

.dark-mode table a:hover {
  color: #a855f7 !important;
  text-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

/* Container adjustments */
.dark-mode .container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

@media (max-width: 768px) {
  .dark-mode .container {
    padding: 0 1rem;
  }
}

/* Fix for sidebar overlap */
.dark-mode .main-content {
  margin-left: 0;
  transition: margin-left 0.3s ease;
}

@media (min-width: 769px) {
  .dark-mode .main-content.sidebar-open {
    margin-left: 280px;
  }
}

/* Empty table fallback */
.dark-mode table:empty::after {
  content: 'Loading table data...';
  display: block;
  text-align: center;
  color: var(--text-secondary);
  padding: 2rem;
  font-style: italic;
}

/* ====================== */
/* HEADER & NAVIGATION FIX FOR MOBILE */
/* ====================== */

/* Mobile Navigation Menu */
@media (max-width: 768px) {
  .dark-mode .nav-menu {
    background: rgba(0, 0, 0, 0.98) !important;
    backdrop-filter: saturate(180%) blur(30px);
    -webkit-backdrop-filter: saturate(180%) blur(30px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  }
  
  .dark-mode .nav-menu.active {
    border-bottom: 1px solid var(--border-medium);
  }
  
  /* All navigation links - CRITICAL FIX */
  .dark-mode .nav-menu li a,
  .dark-mode .nav-menu a {
    color: #ffffff !important;
    font-size: 1.1rem;
    padding: 18px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: transparent !important;
  }
  
  .dark-mode .nav-menu li a:hover {
    color: var(--accent) !important;
    background: var(--glass-hover) !important;
  }
  
  /* Special "Remembering Dad" link on mobile */
  .dark-mode .nav-menu li:last-child a {
    background: linear-gradient(135deg, var(--accent), #5ac8fa) !important;
    color: white !important;
    margin: 10px 20px;
    border-radius: 12px;
    border-bottom: none;
  }
  
  /* Python dropdown arrow */
  .dark-mode .nav-menu .python-nav-item .python-nav-trigger,
  .dark-mode .nav-menu .dropdown-trigger {
    color: #ffffff !important;
  }
  
  .dark-mode .nav-menu .python-nav-item .python-nav-trigger::after {
    border-color: #ffffff transparent transparent transparent;
  }
}

/* Header itself */
.dark-mode .site-header {
  background: var(--backdrop-blur) !important;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--glass-border);
}

/* Logo in header */
.dark-mode .logo a {
  color: #ffffff !important;
}

/* Ensure all header links are visible */
.dark-mode header a,
.dark-mode .site-header a {
  color: #ffffff !important;
}

/* ====================== */
/* PRIVACY POLICY PAGE DARK MODE */
/* Enhanced with purple accents and animations */
/* ====================== */

/* Privacy Hero Section - Enhanced with gradient animation */
.dark-mode .privacy-hero {
  background: linear-gradient(135deg, var(--primary-bg) 0%, var(--secondary-bg) 100%);
  position: relative;
  overflow: hidden;
  padding: 6rem 0 4rem;
}

.dark-mode .privacy-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at top right, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
              radial-gradient(ellipse at bottom left, rgba(10, 132, 255, 0.15) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

@keyframes gradient-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.dark-mode .privacy-hero .container {
  position: relative;
  z-index: 1;
}

/* Privacy Hero Title with animated gradient */
.dark-mode .privacy-hero h1 {
  background: linear-gradient(135deg, #0a84ff, #a855f7, #ec4899, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 300% 300%;
  font-weight: 800;
  font-size: 3rem;
  margin-bottom: 1rem;
  text-shadow: none;
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.dark-mode .hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.3rem;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.dark-mode .last-updated {
  color: var(--text-tertiary);
  font-size: 0.95rem;
  font-style: italic;
  padding: 0.5rem 1rem;
  background: rgba(168, 85, 247, 0.1);
  border-left: 3px solid #a855f7;
  border-radius: 4px;
  display: inline-block;
}

/* Privacy Content Section - SUPER FORCEFUL */
.dark-mode .privacy-section {
  background: var(--primary-bg) !important;
  padding: 4rem 0 !important;
  position: relative;
}

.dark-mode .privacy-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, rgba(168, 85, 247, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.dark-mode .privacy-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  background: transparent !important;
}

/* Privacy Blocks - FORCEFUL OVERRIDE */
.dark-mode .privacy-block,
.dark-mode .privacy-section .privacy-block,
.dark-mode .privacy-content .privacy-block {
  background: var(--card-bg) !important;
  border: 1px solid var(--border-light) !important;
  border-radius: 16px !important;
  padding: 2.5rem !important;
  margin-bottom: 2rem !important;
  box-shadow: 0 8px 32px var(--shadow-medium) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: relative;
  overflow: hidden;
}

.dark-mode .privacy-block::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, 
    rgba(10, 132, 255, 0.03) 0%, 
    rgba(168, 85, 247, 0.03) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 0;
}

.dark-mode .privacy-block:hover {
  border-color: var(--border-medium) !important;
  box-shadow: 0 12px 40px var(--shadow-strong) !important;
  transform: translateY(-4px);
}

.dark-mode .privacy-block:hover::before {
  opacity: 1;
}

/* Ensure all children have proper z-index */
.dark-mode .privacy-block > * {
  position: relative;
  z-index: 1;
}

/* Headings */
.dark-mode .privacy-block h2 {
  color: var(--text-primary);
  font-size: 2rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-light);
  position: relative;
  font-weight: 700;
}

.dark-mode .privacy-block h2::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), #a855f7);
  box-shadow: 0 0 10px var(--glow-accent);
}

.dark-mode .privacy-block h3 {
  color: #a855f7;
  font-size: 1.4rem;
  margin: 2rem 0 1rem;
  font-weight: 600;
}

.dark-mode .privacy-block h4 {
  color: var(--text-primary);
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.dark-mode .privacy-block p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1rem;
}

/* Info List - FORCEFUL OVERRIDE */
.dark-mode .info-list {
  margin: 1.5rem 0;
}

.dark-mode .info-item {
  background: var(--elevated-bg) !important;
  border: 1px solid var(--border-light) !important;
  border-left: 3px solid var(--accent) !important;
  border-radius: 8px !important;
  padding: 1.25rem !important;
  margin-bottom: 1rem !important;
  transition: all 0.3s ease !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.5rem !important;
  position: relative;
  overflow: hidden;
}

.dark-mode .info-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, 
    rgba(10, 132, 255, 0.03) 0%, 
    rgba(168, 85, 247, 0.03) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.dark-mode .info-item:hover {
  border-left-color: #a855f7 !important;
  background: var(--tertiary-bg) !important;
  transform: translateX(8px);
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.2);
}

.dark-mode .info-item:hover::before {
  opacity: 1;
}

.dark-mode .info-label {
  color: var(--accent) !important;
  font-weight: 700 !important;
  font-size: 1.1rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  position: relative;
  z-index: 1;
}

.dark-mode .info-desc {
  color: var(--text-secondary) !important;
  font-size: 0.95rem !important;
  line-height: 1.6 !important;
  position: relative;
  z-index: 1;
}

/* Usage Grid */
.dark-mode .usage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.dark-mode .usage-card {
  background: var(--elevated-bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.dark-mode .usage-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #a855f7);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.dark-mode .usage-card:hover {
  background: var(--tertiary-bg);
  border-color: var(--accent);
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(10, 132, 255, 0.3);
}

.dark-mode .usage-card:hover::before {
  transform: scaleX(1);
}

.dark-mode .usage-card h4 {
  color: #a855f7;
  margin-bottom: 0.75rem;
  font-size: 1.2rem;
}

.dark-mode .usage-card p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* Cookie Types */
.dark-mode .cookie-types {
  display: grid;
  gap: 1.5rem;
  margin: 2rem 0;
}

.dark-mode .cookie-card {
  background: var(--elevated-bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 1.75rem;
  transition: all 0.3s ease;
}

.dark-mode .cookie-card:hover {
  border-color: var(--border-medium);
  box-shadow: 0 8px 32px var(--shadow-medium);
  transform: translateY(-4px);
}

.dark-mode .cookie-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.dark-mode .cookie-badge {
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dark-mode .cookie-badge.required {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.dark-mode .cookie-badge.optional {
  background: rgba(168, 85, 247, 0.2);
  color: #a855f7;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.dark-mode .cookie-card.essential {
  border-left: 4px solid #ef4444;
}

.dark-mode .cookie-card.analytics {
  border-left: 4px solid #a855f7;
}

.dark-mode .cookie-card h4 {
  color: var(--text-primary);
  margin: 0;
}

.dark-mode .cookie-card p {
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.dark-mode .cookie-duration,
.dark-mode .cookie-provider {
  color: var(--text-tertiary);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

/* Cookie Control */
.dark-mode .cookie-control {
  background: var(--elevated-bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 1.75rem;
  margin-top: 2rem;
  text-align: center;
}

.dark-mode .cookie-control p {
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.dark-mode #manage-cookies-btn {
  background: linear-gradient(135deg, var(--accent), #a855f7);
  color: white;
  padding: 1rem 2.5rem;
  border-radius: 50px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(10, 132, 255, 0.3);
  position: relative;
  overflow: hidden;
}

.dark-mode #manage-cookies-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
  border-radius: 50%;
}

.dark-mode #manage-cookies-btn:hover {
  background: linear-gradient(135deg, #409cff, #b76cf7);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 40px rgba(10, 132, 255, 0.5);
}

.dark-mode #manage-cookies-btn:hover::before {
  width: 300px;
  height: 300px;
}

/* Service Cards */
.dark-mode .service-card {
  background: var(--elevated-bg);
  border: 1px solid var(--border-light);
  border-left: 4px solid #a855f7;
  border-radius: 12px;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
}

.dark-mode .service-card:hover {
  background: var(--tertiary-bg);
  border-left-color: var(--accent);
  transform: translateX(8px);
  box-shadow: 0 8px 32px rgba(168, 85, 247, 0.2);
}

.dark-mode .service-card h4 {
  color: #a855f7;
  margin-bottom: 1rem;
}

.dark-mode .service-card p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.dark-mode .service-link a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  display: inline-block;
}

.dark-mode .service-link a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background: linear-gradient(90deg, var(--accent), #a855f7);
  transition: width 0.3s ease;
}

.dark-mode .service-link a:hover {
  color: #a855f7;
  text-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
}

.dark-mode .service-link a:hover::after {
  width: 100%;
}

/* Security Features */
.dark-mode .security-features {
  display: grid;
  gap: 1.5rem;
  margin: 2rem 0;
}

.dark-mode .security-item {
  background: var(--elevated-bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  transition: all 0.3s ease;
}

.dark-mode .security-item:hover {
  background: var(--tertiary-bg);
  border-color: var(--accent);
  transform: translateX(8px);
  box-shadow: 0 8px 32px rgba(10, 132, 255, 0.2);
}

.dark-mode .security-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(10, 132, 255, 0.5));
}

.dark-mode .security-item p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.8;
}

.dark-mode .security-item strong {
  color: var(--text-primary);
  display: block;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

/* Rights List */
.dark-mode .rights-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.dark-mode .right-item {
  background: var(--elevated-bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.dark-mode .right-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #a855f7, var(--accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.dark-mode .right-item:hover {
  background: var(--tertiary-bg);
  border-color: #a855f7;
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(168, 85, 247, 0.3);
}

.dark-mode .right-item:hover::before {
  transform: scaleX(1);
}

.dark-mode .right-item h4 {
  color: #a855f7;
  margin-bottom: 0.75rem;
  font-size: 1.2rem;
}

.dark-mode .right-item p {
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
  font-size: 0.95rem;
}

.dark-mode .rights-note {
  margin-top: 1.5rem;
  padding: 1rem;
  background: rgba(168, 85, 247, 0.1);
  border-left: 3px solid #a855f7;
  border-radius: 4px;
  color: var(--text-primary);
}

.dark-mode .rights-note a {
  color: #a855f7;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.dark-mode .rights-note a:hover {
  color: var(--accent);
  text-shadow: 0 0 20px rgba(10, 132, 255, 0.5);
}

/* Retention Info */
.dark-mode .retention-info {
  background: var(--elevated-bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.dark-mode .retention-info p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.8;
}

.dark-mode .retention-info p:last-child {
  margin-bottom: 0;
}

.dark-mode .retention-info strong {
  color: #a855f7;
  display: inline-block;
  margin-right: 0.5rem;
}

/* Contact Block */
.dark-mode .contact-block {
  border: 2px solid var(--accent);
  background: linear-gradient(135deg, 
    rgba(10, 132, 255, 0.05) 0%, 
    rgba(168, 85, 247, 0.05) 100%);
  box-shadow: 0 12px 40px rgba(10, 132, 255, 0.2);
}

.dark-mode .contact-info-privacy {
  background: var(--elevated-bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.dark-mode .contact-info-privacy p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.8;
}

.dark-mode .contact-info-privacy p:last-child {
  margin-bottom: 0;
}

.dark-mode .contact-info-privacy strong {
  color: var(--text-primary);
  display: inline-block;
  min-width: 100px;
}

.dark-mode .contact-info-privacy a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.dark-mode .contact-info-privacy a:hover {
  color: #a855f7;
  text-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
}

.dark-mode .contact-response-time {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(10, 132, 255, 0.1);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  color: var(--text-primary);
  font-style: italic;
}

/* Links */
.dark-mode .privacy-block a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  display: inline-block;
}

.dark-mode .privacy-block a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background: linear-gradient(90deg, var(--accent), #a855f7);
  transition: width 0.3s ease;
}

.dark-mode .privacy-block a:hover {
  color: #a855f7;
  text-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
}

.dark-mode .privacy-block a:hover::after {
  width: 100%;
}

/* Pulse animation for privacy blocks */
@keyframes privacy-pulse {
  0%, 100% { 
    box-shadow: 0 8px 32px var(--shadow-medium);
  }
  50% { 
    box-shadow: 0 12px 40px var(--shadow-strong),
                0 0 30px rgba(10, 132, 255, 0.1);
  }
}

.dark-mode .privacy-block:hover {
  animation: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .dark-mode .privacy-hero h1 {
    font-size: 2rem;
  }
  
  .dark-mode .hero-subtitle {
    font-size: 1rem;
  }
  
  .dark-mode .privacy-block {
    padding: 1.5rem;
    border-radius: 12px;
  }
  
  .dark-mode .privacy-block h2 {
    font-size: 1.5rem;
  }
  
  .dark-mode .privacy-block h3 {
    font-size: 1.2rem;
  }
  
  .dark-mode .usage-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .dark-mode .rights-list {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .dark-mode .security-item {
    flex-direction: column;
    text-align: center;
  }
  
  .dark-mode .cookie-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Smooth scroll behavior */
@media (prefers-reduced-motion: no-preference) {
  .dark-mode .privacy-block {
    scroll-margin-top: 100px;
  }
}

/* Loading state */
.dark-mode .privacy-content {
  animation: fadeIn 0.5s ease-in;
}

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

/* Special shimmer effect for hover */
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.dark-mode .usage-card::after,
.dark-mode .right-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(168, 85, 247, 0.1), 
    transparent);
  transition: left 0.7s ease;
  pointer-events: none;
}

.dark-mode .usage-card:hover::after,
.dark-mode .right-item:hover::after {
  left: 100%;
}

/* Accessibility improvements */
.dark-mode .privacy-block:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.dark-mode #manage-cookies-btn:focus {
  outline: 2px solid #a855f7;
  outline-offset: 4px;
}

/* Print styles for dark mode */
@media print {
  .dark-mode .privacy-block {
    background: white !important;
    color: black !important;
    border: 1px solid #ddd !important;
    page-break-inside: avoid;
  }
  
  .dark-mode .privacy-block h2,
  .dark-mode .privacy-block h3,
  .dark-mode .privacy-block h4,
  .dark-mode .privacy-block p {
    color: black !important;
  }
}