/**
 * Comprehensive Dark Mode Stylesheet for CyBehave
 * Ensures consistent dark mode across ALL pages and components
 */

/* ==================== iOS Style Toggle Switch ==================== */
.theme-toggle-container {
    display: flex;
    align-items: center;
    margin-left: 0.5rem;
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 51px;
    height: 31px;
    cursor: pointer;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e2e8f0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 31px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.slider:before {
    position: absolute;
    content: "";
    height: 27px;
    width: 27px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Icon positioning */
.moon-icon,
.sun-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    transition: opacity 0.4s ease;
}

.moon-icon {
    right: 9px;
    opacity: 0.6;
    color: #64748b;
}

.sun-icon {
    left: 9px;
    opacity: 0;
    color: #fff;
}

input:checked + .slider {
    background-color: #6490A3;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Show/hide icons based on state */
input:checked + .slider .moon-icon {
    opacity: 0;
}

input:checked + .slider .sun-icon {
    opacity: 1;
}

input:focus + .slider {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 3px rgba(100, 144, 163, 0.2);
}

/* ==================== Dark Theme Color Variables ==================== */
[data-theme="dark"] {
    /* Brand Colors - adjusted for dark mode */
    --color-primary: #7fb3c9;
    --color-primary-dark: #6490A3;
    --color-secondary: #7c8ef8;
    --color-accent: #9066c4;
    --color-heading: #cbd5e1;
    
    /* Gradients - adjusted for dark mode */
    --gradient-primary: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    --gradient-blue: linear-gradient(135deg, #6490A3 0%, #527a8a 100%);
    --gradient-card: linear-gradient(135deg, #7fb3c9 0%, #6490A3 100%);
    
    /* Neutral Colors - dark mode palette */
    --color-text-primary: #f1f5f9;
    --color-text-secondary: #cbd5e1;
    --color-text-tertiary: #94a3b8;
    --color-text-muted: #64748b;
    --color-bg-primary: #0f172a;
    --color-bg-secondary: #1e293b;
    --color-bg-tertiary: #334155;
    --color-bg-elevated: #1e293b;
    --color-border: #334155;
    --color-border-light: #475569;
    
    /* Shadows - adjusted for dark mode */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.6);
    --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.7);
}

/* ==================== Base Dark Mode Styles ==================== */
[data-theme="dark"] body {
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
}

/* ==================== Header & Navigation ==================== */
[data-theme="dark"] header {
    background: rgba(15, 23, 42, 0.98);
    border-bottom: 1px solid var(--color-border);
}

[data-theme="dark"] .logo-text {
    color: var(--color-primary);
}

[data-theme="dark"] nav a {
    color: var(--color-text-secondary);
}

[data-theme="dark"] nav a:hover,
[data-theme="dark"] nav a.active {
    color: var(--color-primary);
}

[data-theme="dark"] .menu-toggle span {
    background: var(--color-text-primary);
}

/* Mobile menu in dark mode */
[data-theme="dark"] nav ul {
    background: transparent;
}

[data-theme="dark"] nav li a {
    color: var(--color-text-secondary);
    border-bottom-color: var(--color-border);
}

[data-theme="dark"] nav li a:hover {
    background: var(--color-bg-tertiary);
    color: var(--color-primary);
}

/* ==================== Hero Section ==================== */
[data-theme="dark"] .hero {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

[data-theme="dark"] .hero::before {
    background: 
        radial-gradient(circle at 80% 20%, rgba(127, 179, 201, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 60% 80%, rgba(127, 179, 201, 0.08) 0%, transparent 50%);
}

[data-theme="dark"] .hero h1 {
    color: var(--color-text-primary);
}

[data-theme="dark"] .hero h1 .highlight {
    color: var(--color-primary);
}

[data-theme="dark"] .hero p {
    color: var(--color-text-secondary);
}

[data-theme="dark"] .hero-badge {
    background: rgba(127, 179, 201, 0.15);
    color: var(--color-text-primary);
}

[data-theme="dark"] .hero-image-cell img {
    opacity: 0.08;
}

/* ==================== Sections - Background Colors ==================== */
[data-theme="dark"] section {
    background: var(--color-bg-primary) !important;
}

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

[data-theme="dark"] section.lab,
[data-theme="dark"] .lab {
    background: var(--color-bg-secondary) !important;
}

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

[data-theme="dark"] section.articles,
[data-theme="dark"] .articles {
    background: var(--color-bg-secondary) !important;
}

[data-theme="dark"] section.resources,
[data-theme="dark"] .resources {
    background: var(--color-bg-secondary) !important;
}

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

[data-theme="dark"] section.about,
[data-theme="dark"] .about {
    background: var(--color-bg-secondary) !important;
}

[data-theme="dark"] section.team,
[data-theme="dark"] .team {
    background: var(--color-bg-secondary) !important;
}

[data-theme="dark"] section.cta-section,
[data-theme="dark"] .cta-section {
    background: var(--color-bg-secondary) !important;
}

/* Override inline styles for specific sections */
[data-theme="dark"] section#articles[style*="background"],
[data-theme="dark"] section#about[style*="background"] {
    background: var(--color-bg-secondary) !important;
}

[data-theme="dark"] section#insights[style*="background"] {
    background: var(--color-bg-primary) !important;
}

/* Additional catch-all for any inline background styles */
[data-theme="dark"] section[style*="background: white"],
[data-theme="dark"] section[style*="background:white"],
[data-theme="dark"] section[style*="background: #ffffff"],
[data-theme="dark"] section[style*="background:#ffffff"],
[data-theme="dark"] section[style*="background: #fff"],
[data-theme="dark"] section[style*="background:#fff"],
[data-theme="dark"] section[style*="background-color: white"],
[data-theme="dark"] section[style*="background-color:white"] {
    background: var(--color-bg-secondary) !important;
}

[data-theme="dark"] section[style*="background: #f8fafc"],
[data-theme="dark"] section[style*="background:#f8fafc"] {
    background: var(--color-bg-secondary) !important;
}

/* ==================== Section Headers & Text ==================== */
[data-theme="dark"] .section-header h2,
[data-theme="dark"] .section-title,
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: var(--color-text-primary);
}

[data-theme="dark"] .section-header p,
[data-theme="dark"] .section-subtitle {
    color: var(--color-text-secondary);
}

[data-theme="dark"] .lead-text,
[data-theme="dark"] .body-text,
[data-theme="dark"] .intro-text {
    color: var(--color-text-secondary);
}

/* ==================== Cards - All Types ==================== */
/* First override any inline styles from index.php */
[data-theme="dark"] .insights[style*="background"],
[data-theme="dark"] .insights {
    background: var(--color-bg-secondary) !important;
}

[data-theme="dark"] .card,
[data-theme="dark"] .insight-card,
[data-theme="dark"] .article-card,
[data-theme="dark"] .resource-card,
[data-theme="dark"] .education-card,
[data-theme="dark"] .content-card,
[data-theme="dark"] .team-card,
[data-theme="dark"] .feature-card {
    background: var(--color-bg-secondary);
    border-color: var(--color-border);
}

[data-theme="dark"] .card:hover,
[data-theme="dark"] .insight-card:hover,
[data-theme="dark"] .article-card:hover,
[data-theme="dark"] .resource-card:hover,
[data-theme="dark"] .education-card:hover,
[data-theme="dark"] .content-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Card Titles */
[data-theme="dark"] .card h3,
[data-theme="dark"] .insight-card h3,
[data-theme="dark"] .article-card h3,
[data-theme="dark"] .resource-card h3,
[data-theme="dark"] .education-card h3,
[data-theme="dark"] .content-card h3 {
    color: var(--color-text-primary);
}

/* Card Body Text */
[data-theme="dark"] .card p,
[data-theme="dark"] .insight-card p,
[data-theme="dark"] .article-card p,
[data-theme="dark"] .resource-card p,
[data-theme="dark"] .education-card p,
[data-theme="dark"] .content-excerpt {
    color: var(--color-text-secondary);
}

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

/* ==================== Lab Section ==================== */
[data-theme="dark"] .lab-features li {
    color: var(--color-text-secondary);
}

[data-theme="dark"] .lab-features li::before {
    color: var(--color-primary);
}

[data-theme="dark"] .lab-visual {
    background: var(--gradient-card);
}

/* ==================== Education Cards ==================== */
[data-theme="dark"] .education-intro-box {
    background: var(--color-bg-secondary);
    padding: 2rem;
    border-radius: 12px;
}

[data-theme="dark"] .education-intro-title {
    color: var(--color-text-primary);
}

[data-theme="dark"] .education-intro-text {
    color: var(--color-text-secondary);
}

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

[data-theme="dark"] .education-card h3 {
    color: var(--color-primary);
}

[data-theme="dark"] .education-card h4,
[data-theme="dark"] .education-subtitle,
[data-theme="dark"] .education-card-footer {
    color: var(--color-text-secondary);
}

[data-theme="dark"] .education-features li {
    color: var(--color-text-secondary);
}

[data-theme="dark"] .education-features li::before {
    color: var(--color-primary);
}

[data-theme="dark"] .education-icon {
    background: var(--gradient-card);
}

[data-theme="dark"] .education-target {
    color: var(--color-text-secondary);
}

/* ==================== Books Section ==================== */
[data-theme="dark"] .books-section {
    background: var(--color-bg-secondary) !important;
}

[data-theme="dark"] .books-intro h2 {
    color: var(--color-text-primary);
}

[data-theme="dark"] .books-intro p {
    color: var(--color-text-secondary);
}

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

[data-theme="dark"] .book-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

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

[data-theme="dark"] .book-title {
    color: var(--color-text-primary);
}

[data-theme="dark"] .book-subtitle {
    color: var(--color-primary);
}

[data-theme="dark"] .book-description {
    color: var(--color-text-secondary);
}

[data-theme="dark"] .book-highlights {
    background: var(--color-bg-tertiary) !important;
    border-left-color: var(--color-primary);
}

[data-theme="dark"] .book-highlights li {
    color: var(--color-text-secondary);
}

[data-theme="dark"] .book-highlights li::before {
    color: var(--color-primary);
}

[data-theme="dark"] .book-cta {
    background: rgba(127, 179, 201, 0.15);
    color: var(--color-primary);
    border-color: rgba(127, 179, 201, 0.3);
}

[data-theme="dark"] .book-cta:hover {
    background: var(--color-primary);
    color: var(--color-bg-primary);
}

[data-theme="dark"] .book-badge {
    /* Keep gradient badge as is - looks good in dark mode */
}


/* ==================== Udemy Box ==================== */
[data-theme="dark"] .udemy-box {
    background: var(--color-bg-secondary);
    border-color: var(--color-border);
}

[data-theme="dark"] .udemy-title {
    color: var(--color-text-primary);
}

[data-theme="dark"] .udemy-description {
    color: var(--color-text-secondary);
}

[data-theme="dark"] .udemy-benefit-title {
    color: var(--color-primary);
}

[data-theme="dark"] .udemy-benefit-text {
    color: var(--color-text-secondary);
}

/* ==================== Buttons ==================== */
[data-theme="dark"] .btn-primary {
    background: var(--color-primary);
    color: var(--color-bg-primary);
}

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

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

[data-theme="dark"] .btn-secondary:hover {
    background: var(--color-bg-tertiary);
}

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

[data-theme="dark"] .category-btn:hover,
[data-theme="dark"] .category-btn.active {
    background: var(--color-primary);
    color: var(--color-bg-primary);
    border-color: var(--color-primary);
}

/* ==================== Links & CTAs ==================== */
[data-theme="dark"] a {
    color: var(--color-primary);
}

[data-theme="dark"] .article-link {
    color: var(--color-primary);
    background: rgba(127, 179, 201, 0.15);
    border-color: rgba(127, 179, 201, 0.3);
}

[data-theme="dark"] .article-link:hover {
    background: var(--color-primary);
    color: var(--color-bg-primary);
}

[data-theme="dark"] .read-more,
[data-theme="dark"] .cta-link {
    color: var(--color-primary);
}

[data-theme="dark"] .cta-link:hover {
    color: var(--color-primary-dark);
}

[data-theme="dark"] .back-link {
    color: var(--color-primary);
}

[data-theme="dark"] .back-link:hover {
    color: var(--color-primary-dark);
}

/* ==================== Forms ==================== */
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-textarea,
[data-theme="dark"] .form-select {
    background: var(--color-bg-secondary);
    border-color: var(--color-border);
    color: var(--color-text-primary);
}

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

[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-textarea:focus,
[data-theme="dark"] .form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(127, 179, 201, 0.2);
}

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

[data-theme="dark"] .form-helper {
    color: var(--color-text-secondary);
}

/* ==================== Newsletter ==================== */
[data-theme="dark"] .newsletter {
    background: var(--gradient-card);
}

[data-theme="dark"] .newsletter h2 {
    color: white;
}

[data-theme="dark"] .newsletter p {
    color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .newsletter-form input {
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
    border: 2px solid var(--color-border);
}

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

[data-theme="dark"] .newsletter-form button {
    background: var(--color-bg-primary);
    color: var(--color-primary);
}

[data-theme="dark"] .newsletter-form button:hover {
    background: var(--color-bg-tertiary);
}

/* ==================== Pagination ==================== */
[data-theme="dark"] .pagination a,
[data-theme="dark"] .pagination span {
    background: var(--color-bg-secondary);
    border-color: var(--color-border);
    color: var(--color-text-primary);
}

[data-theme="dark"] .pagination a:hover,
[data-theme="dark"] .pagination .active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-bg-primary);
}

/* ==================== Article/Insight Single Pages ==================== */
[data-theme="dark"] .article-header h1,
[data-theme="dark"] .insight-header h1 {
    color: var(--color-text-primary);
}

[data-theme="dark"] .article-meta,
[data-theme="dark"] .insight-meta,
[data-theme="dark"] .content-meta {
    color: var(--color-text-secondary);
}

[data-theme="dark"] .featured-image {
    opacity: 0.9;
    border: 1px solid var(--color-border);
}

[data-theme="dark"] .article-body,
[data-theme="dark"] .insight-body,
[data-theme="dark"] .resource-body {
    color: var(--color-text-secondary);
}

[data-theme="dark"] .article-body h2,
[data-theme="dark"] .insight-body h2,
[data-theme="dark"] .resource-body h2,
[data-theme="dark"] .article-body h3,
[data-theme="dark"] .insight-body h3,
[data-theme="dark"] .resource-body h3 {
    color: var(--color-text-primary);
}

[data-theme="dark"] .article-body p,
[data-theme="dark"] .insight-body p,
[data-theme="dark"] .resource-body p {
    color: var(--color-text-secondary);
}

[data-theme="dark"] .article-body a,
[data-theme="dark"] .insight-body a,
[data-theme="dark"] .resource-body a {
    color: var(--color-primary);
}

[data-theme="dark"] .article-body blockquote,
[data-theme="dark"] .insight-body blockquote,
[data-theme="dark"] .resource-body blockquote {
    border-left-color: var(--color-primary);
    color: var(--color-text-secondary);
}

[data-theme="dark"] .article-body img,
[data-theme="dark"] .insight-body img,
[data-theme="dark"] .resource-body img {
    opacity: 0.9;
    border: 1px solid var(--color-border);
}

/* ==================== Empty States ==================== */
[data-theme="dark"] .empty-state h3 {
    color: var(--color-text-primary);
}

[data-theme="dark"] .empty-state p,
[data-theme="dark"] .no-posts {
    color: var(--color-text-secondary);
}

[data-theme="dark"] .empty-state-icon {
    opacity: 0.3;
}

/* ==================== Category Filters ==================== */
[data-theme="dark"] .content-category {
    background: var(--color-primary);
    color: var(--color-bg-primary);
}

/* ==================== Alerts & Badges ==================== */
[data-theme="dark"] .alert {
    background: var(--color-bg-secondary);
    border-color: var(--color-border);
}

[data-theme="dark"] .alert-success {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border-color: #10b981;
}

[data-theme="dark"] .alert-error {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border-color: #ef4444;
}

[data-theme="dark"] .alert-info {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border-color: #3b82f6;
}

[data-theme="dark"] .alert-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
    border-color: #f59e0b;
}

[data-theme="dark"] .badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

[data-theme="dark"] .badge-error {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

[data-theme="dark"] .badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

[data-theme="dark"] .badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

/* ==================== Modal ==================== */
[data-theme="dark"] .modal {
    background-color: rgba(0, 0, 0, 0.8);
}

[data-theme="dark"] .modal-content {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
}

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

[data-theme="dark"] .modal-close:hover {
    color: var(--color-text-primary);
}

[data-theme="dark"] .modal-content h2 {
    color: var(--color-text-primary);
}

[data-theme="dark"] .modal-content p {
    color: var(--color-text-secondary);
}

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

/* ==================== Footer ==================== */
[data-theme="dark"] footer {
    background: #020617;
}

[data-theme="dark"] .footer-tagline {
    color: var(--color-primary);
}

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

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

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

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

[data-theme="dark"] .footer-bottom {
    border-top-color: var(--color-border);
    color: var(--color-text-muted);
}

[data-theme="dark"] .footer-section h3 {
    color: var(--color-text-primary);
}

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

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

/* ==================== Tables ==================== */
[data-theme="dark"] table {
    border-color: var(--color-border);
}

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

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

[data-theme="dark"] tr:hover td {
    background: var(--color-bg-tertiary);
}

/* ==================== Code Blocks ==================== */
[data-theme="dark"] code {
    background: var(--color-bg-tertiary);
    color: var(--color-primary);
}

[data-theme="dark"] pre {
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
}

[data-theme="dark"] pre code {
    color: var(--color-text-primary);
}

/* ==================== HR Dividers ==================== */
[data-theme="dark"] hr {
    border-color: var(--color-border);
}

/* ==================== Card Images & Gradients ==================== */
/* DO NOT override image container backgrounds - maintain original gradient/image display */
/* Ensure images within cards display correctly without zoom */
[data-theme="dark"] .article-card-image img,
[data-theme="dark"] .content-image img {
    opacity: 1 !important;
    object-fit: cover !important;
    width: 100% !important;
    height: 100% !important;
    transform: none !important;
    scale: 1 !important;
}

/* ==================== Smooth Transitions ==================== */
body,
header,
.hero,
section,
.card,
.insight-card,
.article-card,
.resource-card,
.education-card,
.btn,
.category-btn,
nav a,
.form-input,
.form-textarea,
.form-select,
.modal-content {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ==================== Scrollbar Styling ==================== */
[data-theme="dark"] ::-webkit-scrollbar {
    width: 12px;
    background: var(--color-bg-primary);
}

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

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 6px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--color-border-light);
}

/* ==================== Selection Styling ==================== */
[data-theme="dark"] ::selection {
    background: rgba(127, 179, 201, 0.3);
    color: var(--color-text-primary);
}

[data-theme="dark"] ::-moz-selection {
    background: rgba(127, 179, 201, 0.3);
    color: var(--color-text-primary);
}

/* ==================== Mobile Menu Dark Mode ==================== */
@media (max-width: 968px) {
    [data-theme="dark"] nav ul {
        background: var(--color-bg-primary) !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8) !important;
        border: 1px solid var(--color-border) !important;
    }
    
    [data-theme="dark"] nav li a {
        color: var(--color-text-secondary);
        border-bottom-color: var(--color-border);
    }
    
    [data-theme="dark"] nav li a:hover {
        background: var(--color-bg-secondary);
        color: var(--color-primary);
    }
}

/* ==================== Mobile Theme Toggle Position ==================== */
@media (max-width: 768px) {
    .theme-toggle-container {
        margin-left: 0;
        padding: 0.5rem 0;
        width: 100%;
        justify-content: center;
        border-top: 1px solid #e2e8f0;
        margin-top: 0.5rem;
        padding-top: 1rem;
    }
    
    [data-theme="dark"] .theme-toggle-container {
        border-top-color: var(--color-border);
    }
}

/* ==================== Print Styles ==================== */
@media print {
    [data-theme="dark"] {
        /* Revert to light mode for printing */
        --color-text-primary: #1a1a1a;
        --color-text-secondary: #4a5568;
        --color-bg-primary: #ffffff;
        --color-bg-secondary: #f7fafc;
    }
}

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

/* ==================== Image Adjustments ==================== */
/* Reduce opacity slightly for general images, but NOT for card images */
[data-theme="dark"] img:not(.logo-image):not(.education-icon):not(.article-card-image img):not(.content-image img) {
    opacity: 0.9;
}

/* Ensure article and insight card images are not affected */
[data-theme="dark"] .article-card-image img,
[data-theme="dark"] .content-image img,
[data-theme="dark"] .article-card-image,
[data-theme="dark"] .content-image {
    opacity: 1 !important;
}

/* ==================== Video & Media ==================== */
[data-theme="dark"] video,
[data-theme="dark"] iframe {
    border: 1px solid var(--color-border);
    border-radius: 8px;
}

/* ==================== Lab Page Specific Styles ==================== */
/* All lab page styles now in /css/lab.css - these are dark mode overrides */

[data-theme="dark"] .lab-hero {
    background: linear-gradient(135deg, #6490A3 0%, #3d4256 100%);
}

[data-theme="dark"] .lab-hero::before {
    background: 
        radial-gradient(circle at 20% 50%, rgba(127, 179, 201, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(127, 179, 201, 0.1) 0%, transparent 50%);
}

[data-theme="dark"] .lab-badge {
    background: rgba(255, 255, 255, 0.15);
}

/* Purpose Section - applies to both "Measuring Culture" and "Why CyBehave360" sections */
[data-theme="dark"] .purpose-section {
    background: var(--color-bg-primary);
}

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

[data-theme="dark"] .purpose-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: var(--color-primary);
}

[data-theme="dark"] .purpose-icon {
    background: var(--gradient-card);
}

[data-theme="dark"] .purpose-card h3 {
    color: var(--color-text-primary);
}

[data-theme="dark"] .purpose-card p {
    color: var(--color-text-secondary);
}

/* Benefits Section - "Why CyBehave360 Reduces Human Risk" */
[data-theme="dark"] .benefits-section {
    background: var(--color-bg-secondary);
}

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

[data-theme="dark"] .benefits-section .purpose-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: var(--color-primary);
}

[data-theme="dark"] .benefits-section .purpose-icon {
    background: var(--gradient-card);
}

[data-theme="dark"] .benefits-section .purpose-card h3 {
    color: var(--color-text-primary);
}

[data-theme="dark"] .benefits-section .purpose-card p {
    color: var(--color-text-secondary);
}

/* Modules Section */
[data-theme="dark"] .modules-section {
    background: var(--color-bg-secondary);
}

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

[data-theme="dark"] .module-card:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    border-color: var(--color-primary);
}

[data-theme="dark"] .module-header {
    background: var(--gradient-card);
}

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

[data-theme="dark"] .module-description,
[data-theme="dark"] .module-features li {
    color: var(--color-text-secondary);
}

[data-theme="dark"] .module-features li::before {
    color: var(--color-primary);
}

[data-theme="dark"] .module-status {
    background: rgba(127, 179, 201, 0.2);
    color: var(--color-primary);
}

[data-theme="dark"] .module-status.coming-soon {
    background: rgba(127, 179, 201, 0.15);
    color: var(--color-text-secondary);
}

[data-theme="dark"] .module-status.planned {
    background: rgba(100, 116, 139, 0.2);
    color: var(--color-text-tertiary);
}

/* Journey/Steps Section */
[data-theme="dark"] .how-it-works {
    background: var(--color-bg-primary);
}

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

[data-theme="dark"] .step-card:hover {
    border-color: var(--color-primary);
}

[data-theme="dark"] .step-number {
    background: var(--gradient-card);
}

[data-theme="dark"] .step-card h3 {
    color: var(--color-text-primary);
}

[data-theme="dark"] .step-card p {
    color: var(--color-text-secondary);
}

/* Journey recommendation box */
[data-theme="dark"] .journey-recommendation {
    background: var(--color-bg-tertiary);
}

[data-theme="dark"] .journey-recommendation p {
    color: var(--color-text-secondary);
}

/* Disabled cards in dark mode */
[data-theme="dark"] .module-card.step-card-disabled,
[data-theme="dark"] .step-card.step-card-disabled {
    opacity: 0.4;
    filter: grayscale(100%);
}

[data-theme="dark"] .step-card-disabled:hover {
    border-color: var(--color-border);
}

/* Availability note in dark mode */
[data-theme="dark"] .availability-note {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.3);
}

/* Contact Page Specific Styles */
[data-theme="dark"] .contact-section {
    background: var(--color-bg-primary);
}

[data-theme="dark"] .contact-form-card {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 2.5rem;
}

[data-theme="dark"] .contact-form-card h2 {
    color: var(--color-text-primary);
}

[data-theme="dark"] .contact-info-card {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
}

[data-theme="dark"] .contact-info-card h3 {
    color: var(--color-text-primary);
}

[data-theme="dark"] .contact-method {
    color: var(--color-text-secondary);
}

[data-theme="dark"] .contact-method strong {
    color: var(--color-text-primary);
}

/* Contact Grid */
[data-theme="dark"] .contact-grid {
    display: grid;
    gap: 2rem;
}