/* ================================
   Autobiography of a Yogi - Styles
   SEO & Accessibility Optimized
   ================================ */

/* ================================
   Mobile Navigation Fixes
   ================================ */

/* Ensure nav doesn't overflow */
nav {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

nav > div {
    max-width: 100%;
}

/* Mobile menu button and toggle container */
@media (max-width: 1023px) {
    nav .hidden.lg\:flex {
        display: none !important;
    }
    
    /* Ensure mobile elements don't overflow */
    nav > div:first-child {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    /* Logo text size on mobile */
    nav a[href="#"],
    nav a[href="index.html"] {
        font-size: 1rem;
        white-space: nowrap;
    }
    
    /* Mobile controls container */
    .flex.items-center.space-x-4.md\:hidden {
        flex-shrink: 0;
    }
    
    /* Theme toggle smaller on mobile */
    .theme-toggle {
        width: 50px;
        height: 26px;
    }
    
    .theme-toggle-circle {
        width: 20px;
        height: 20px;
        font-size: 12px;
    }
    
    .theme-toggle.dark .theme-toggle-circle {
        left: 27px;
    }
}

/* Mobile menu full width */
#mobileMenu {
    width: 100%;
    max-width: 100vw;
}

#mobileMenu a {
    display: block;
    width: 100%;
}

/* ================================
   Accessibility Styles
   ================================ */

/* Skip Link for Keyboard Navigation */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #4f46e5;
    color: white;
    padding: 8px 16px;
    z-index: 100;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.sr-only.focus\:not-sr-only:focus {
    position: absolute;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Focus Styles for Accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

/* Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .chapter-card {
        border: 2px solid currentColor;
    }
    
    .theme-toggle {
        border: 2px solid currentColor;
    }
}

/* ================================
   Base Styles
   ================================ */
   
/* Smooth Scroll */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

/* Base Styles */
body {
    font-family: 'Lora', serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    max-width: 100vw;
}

/* Prevent horizontal scroll */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Container overflow fix */
.max-w-6xl, .max-w-7xl, .max-w-4xl, .max-w-3xl {
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .max-w-6xl { max-width: 72rem; }
    .max-w-7xl { max-width: 80rem; }
    .max-w-4xl { max-width: 56rem; }
    .max-w-3xl { max-width: 48rem; }
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
}

/* Gradient Background */
.gradient-bg {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

/* Chapter Card Hover Effect */
.chapter-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

/* Lotus Pattern Background */
.lotus-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M30 30c0-5.5 4.5-10 10-10s10 4.5 10 10-4.5 10-10 10-10-4.5-10-10zm-20 0c0-5.5 4.5-10 10-10s10 4.5 10 10-4.5 10-10 10-10-4.5-10-10z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Chapter Expansion */
.expanded {
    max-height: 2000px !important;
}

/* ================================
   Dark Mode Toggle Button
   ================================ */
.theme-toggle {
    position: relative;
    width: 60px;
    height: 30px;
    border-radius: 15px;
    background: linear-gradient(to right, #fbbf24, #f59e0b);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    padding: 0;
}

.theme-toggle.dark {
    background: linear-gradient(to right, #1e3a5f, #0f172a);
}

.theme-toggle-circle {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.theme-toggle.dark .theme-toggle-circle {
    left: 33px;
}

/* ================================
   Dark Mode Styles
   ================================ */
.dark-mode {
    background-color: #0f172a !important;
    color: #e2e8f0 !important;
}

/* Protect Hero Section - Never override gradient */
.gradient-bg {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%) !important;
}

.dark-mode .gradient-bg {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%) !important;
}

/* Hero text always visible */
.gradient-bg h1,
.gradient-bg p,
.gradient-bg a,
.gradient-bg span,
.gradient-bg div {
    color: inherit;
}

.gradient-bg .text-white {
    color: #ffffff !important;
}

.gradient-bg .text-amber-200 {
    color: #fde68a !important;
}

.gradient-bg .text-amber-300 {
    color: #fcd34d !important;
}

.gradient-bg .text-amber-400 {
    color: #fbbf24 !important;
}

.gradient-bg .text-amber-500 {
    color: #f59e0b !important;
}

.gradient-bg .text-gray-300 {
    color: #d1d5db !important;
}

.gradient-bg .text-gray-400 {
    color: #9ca3af !important;
}

/* Dark mode - keep hero colors intact */
.dark-mode .gradient-bg .text-white {
    color: #ffffff !important;
}

.dark-mode .gradient-bg .text-amber-200 {
    color: #fde68a !important;
}

.dark-mode .gradient-bg .text-amber-300 {
    color: #fcd34d !important;
}

.dark-mode .gradient-bg .text-amber-400 {
    color: #fbbf24 !important;
}

.dark-mode .gradient-bg .text-gray-300 {
    color: #d1d5db !important;
}

.dark-mode .gradient-bg .text-gray-400 {
    color: #9ca3af !important;
}

/* Quote Section - Always dark with light text */
section.gradient-bg.text-white {
    color: #ffffff !important;
}

section.gradient-bg.text-white blockquote {
    color: #ffffff !important;
}

section.gradient-bg.text-white .text-amber-300 {
    color: #fcd34d !important;
}

.dark-mode section.gradient-bg.text-white {
    color: #ffffff !important;
}

.dark-mode section.gradient-bg.text-white blockquote {
    color: #ffffff !important;
}

/* Navigation - Ensure visibility in both modes */
nav a {
    transition: color 0.3s ease;
}

nav .text-indigo-900 {
    color: #312e81 !important;
}

nav .text-gray-700 {
    color: #374151 !important;
}

.dark-mode nav {
    background-color: rgba(30, 41, 59, 0.95) !important;
}

.dark-mode nav .text-indigo-900 {
    color: #a5b4fc !important;
}

.dark-mode nav .text-gray-700 {
    color: #cbd5e1 !important;
}

.dark-mode nav a:hover {
    color: #818cf8 !important;
}

/* About section - Proper contrast */
#about.bg-white {
    background-color: #ffffff;
}

.dark-mode #about.bg-white {
    background-color: #1e293b !important;
}

#about .text-indigo-900 {
    color: #312e81;
}

.dark-mode #about .text-indigo-900 {
    color: #a5b4fc !important;
}

#about .text-gray-700 {
    color: #374151;
}

.dark-mode #about .text-gray-700 {
    color: #cbd5e1 !important;
}

/* Author section fix */
#author.bg-white {
    background-color: #ffffff;
}

.dark-mode #author.bg-white {
    background-color: #1e293b !important;
}

#author .text-indigo-900 {
    color: #312e81;
}

.dark-mode #author .text-indigo-900 {
    color: #a5b4fc !important;
}

#author .text-gray-700 {
    color: #374151;
}

.dark-mode #author .text-gray-700 {
    color: #cbd5e1 !important;
}

#author .text-gray-500 {
    color: #6b7280;
}

.dark-mode #author .text-gray-500 {
    color: #94a3b8 !important;
}

/* Kriya Yoga section */
#kriya-yoga.bg-white {
    background-color: #ffffff;
}

.dark-mode #kriya-yoga.bg-white {
    background-color: #1e293b !important;
}

#kriya-yoga .text-indigo-900 {
    color: #312e81;
}

.dark-mode #kriya-yoga .text-indigo-900 {
    color: #a5b4fc !important;
}

#kriya-yoga .text-gray-700 {
    color: #374151;
}

.dark-mode #kriya-yoga .text-gray-700 {
    color: #cbd5e1 !important;
}

#kriya-yoga .text-gray-600 {
    color: #4b5563;
}

.dark-mode #kriya-yoga .text-gray-600 {
    color: #94a3b8 !important;
}

#kriya-yoga .text-gray-800 {
    color: #1f2937;
}

.dark-mode #kriya-yoga .text-gray-800 {
    color: #e2e8f0 !important;
}

/* Law of Miracles section */
.dark-mode #law-of-miracles {
    background: linear-gradient(to bottom, #1e293b, #1e293b) !important;
}

#law-of-miracles .text-indigo-900 {
    color: #312e81;
}

.dark-mode #law-of-miracles .text-indigo-900 {
    color: #a5b4fc !important;
}

#law-of-miracles .text-gray-700 {
    color: #374151;
}

.dark-mode #law-of-miracles .text-gray-700 {
    color: #cbd5e1 !important;
}

#law-of-miracles .text-gray-600 {
    color: #4b5563;
}

.dark-mode #law-of-miracles .text-gray-600 {
    color: #94a3b8 !important;
}

#law-of-miracles .text-gray-800 {
    color: #1f2937;
}

.dark-mode #law-of-miracles .text-gray-800 {
    color: #e2e8f0 !important;
}

/* White cards in dark mode */
.dark-mode .bg-white.rounded-2xl,
.dark-mode .bg-white.rounded-3xl,
.dark-mode .bg-white.rounded-xl {
    background-color: #1e293b !important;
}

.dark-mode .bg-white.rounded-2xl .text-gray-800,
.dark-mode .bg-white.rounded-3xl .text-gray-800,
.dark-mode .bg-white.rounded-xl .text-gray-800 {
    color: #e2e8f0 !important;
}

.dark-mode .bg-white.rounded-2xl .text-gray-700,
.dark-mode .bg-white.rounded-3xl .text-gray-700,
.dark-mode .bg-white.rounded-xl .text-gray-700 {
    color: #cbd5e1 !important;
}

.dark-mode .bg-white.rounded-2xl .text-gray-600,
.dark-mode .bg-white.rounded-3xl .text-gray-600,
.dark-mode .bg-white.rounded-xl .text-gray-600 {
    color: #94a3b8 !important;
}

.dark-mode .bg-white {
    background-color: #1e293b !important;
}

.dark-mode .bg-amber-50 {
    background-color: #0f172a !important;
}

.dark-mode .text-gray-800 {
    color: #e2e8f0 !important;
}

.dark-mode .text-gray-700 {
    color: #cbd5e1 !important;
}

.dark-mode .text-gray-600 {
    color: #94a3b8 !important;
}

.dark-mode .text-gray-500 {
    color: #64748b !important;
}

.dark-mode .text-indigo-900 {
    color: #a5b4fc !important;
}

.dark-mode .text-indigo-800 {
    color: #a5b4fc !important;
}

.dark-mode .text-indigo-700 {
    color: #818cf8 !important;
}

.dark-mode .text-amber-800 {
    color: #fcd34d !important;
}

.dark-mode .text-green-800 {
    color: #86efac !important;
}

.dark-mode .text-purple-800 {
    color: #c4b5fd !important;
}

.dark-mode .bg-gradient-to-b.from-amber-50.to-orange-50 {
    background: linear-gradient(to bottom, #1e293b, #1e293b) !important;
}

.dark-mode .bg-gradient-to-b.from-indigo-50.to-purple-50 {
    background: linear-gradient(to bottom, #1e293b, #1e293b) !important;
}

.dark-mode .bg-gradient-to-br.from-indigo-50.to-purple-50 {
    background: linear-gradient(to bottom right, #312e81, #4c1d95) !important;
}

.dark-mode .bg-gradient-to-br.from-indigo-100.to-amber-100 {
    background: linear-gradient(to bottom right, #312e81, #78350f) !important;
}

.dark-mode .bg-gradient-to-r.from-indigo-100.to-purple-100 {
    background: linear-gradient(to right, #312e81, #4c1d95) !important;
}

.dark-mode .bg-gradient-to-r.from-green-50.to-emerald-50 {
    background: linear-gradient(to right, #14532d, #064e3b) !important;
}

.dark-mode .bg-gradient-to-r.from-amber-100.to-orange-100 {
    background: linear-gradient(to right, #78350f, #7c2d12) !important;
}

.dark-mode .bg-gradient-to-b.from-purple-50.to-indigo-50 {
    background: linear-gradient(to bottom, #1e1b4b, #1e293b) !important;
}

.dark-mode .bg-gradient-to-r.from-indigo-600.to-purple-600 {
    background: linear-gradient(to right, #4338ca, #7c3aed) !important;
}

.dark-mode .bg-gradient-to-r.from-green-100.to-emerald-100 {
    background: linear-gradient(to right, #14532d, #064e3b) !important;
}

.dark-mode .bg-gradient-to-r.from-yellow-100.to-amber-100 {
    background: linear-gradient(to right, #713f12, #78350f) !important;
}

.dark-mode .bg-gradient-to-r.from-purple-100.to-indigo-100 {
    background: linear-gradient(to right, #3b0764, #312e81) !important;
}

.dark-mode .bg-gradient-to-br.from-purple-600.via-indigo-600.to-blue-600 {
    background: linear-gradient(to bottom right, #7c3aed, #4338ca, #2563eb) !important;
}

.dark-mode .bg-green-50 {
    background-color: #14532d !important;
}

.dark-mode .bg-yellow-50 {
    background-color: #713f12 !important;
}

.dark-mode .bg-orange-50 {
    background-color: #7c2d12 !important;
}

.dark-mode .bg-blue-50 {
    background-color: #1e3a5f !important;
}

.dark-mode .bg-cyan-50 {
    background-color: #164e63 !important;
}

.dark-mode .bg-gray-100 {
    background-color: #374151 !important;
}

/* Fix light background colors in dark mode - make them darker */
.dark-mode .bg-blue-100 {
    background-color: #1e3a5f !important;
}

.dark-mode .bg-pink-100 {
    background-color: #831843 !important;
}

.dark-mode .bg-purple-100 {
    background-color: #4c1d95 !important;
}

.dark-mode .bg-green-100 {
    background-color: #14532d !important;
}

.dark-mode .bg-yellow-100 {
    background-color: #713f12 !important;
}

.dark-mode .bg-red-100 {
    background-color: #7f1d1d !important;
}

.dark-mode .bg-amber-100 {
    background-color: #78350f !important;
}

.dark-mode .bg-indigo-100 {
    background-color: #312e81 !important;
}

.dark-mode .bg-emerald-100 {
    background-color: #064e3b !important;
}

.dark-mode .bg-rose-100 {
    background-color: #881337 !important;
}

.dark-mode .bg-violet-100 {
    background-color: #4c1d95 !important;
}

.dark-mode .bg-teal-100 {
    background-color: #134e4a !important;
}

.dark-mode .bg-cyan-100 {
    background-color: #164e63 !important;
}

.dark-mode .bg-orange-100 {
    background-color: #7c2d12 !important;
}

.dark-mode .text-green-700 {
    color: #86efac !important;
}

.dark-mode .text-green-800 {
    color: #86efac !important;
}

.dark-mode .text-green-600 {
    color: #4ade80 !important;
}

.dark-mode .text-yellow-700 {
    color: #fde047 !important;
}

.dark-mode .text-yellow-800 {
    color: #fde047 !important;
}

.dark-mode .text-yellow-600 {
    color: #facc15 !important;
}

.dark-mode .text-purple-700 {
    color: #c4b5fd !important;
}

.dark-mode .text-purple-600 {
    color: #a78bfa !important;
}

.dark-mode .text-purple-900 {
    color: #d8b4fe !important;
}

/* Additional text color fixes for dark mode */
.dark-mode .text-blue-800 {
    color: #93c5fd !important;
}

.dark-mode .text-blue-700 {
    color: #93c5fd !important;
}

.dark-mode .text-blue-600 {
    color: #60a5fa !important;
}

.dark-mode .text-pink-700 {
    color: #f9a8d4 !important;
}

.dark-mode .text-pink-600 {
    color: #f472b6 !important;
}

.dark-mode .text-orange-800 {
    color: #fdba74 !important;
}

.dark-mode .text-orange-700 {
    color: #fb923c !important;
}

.dark-mode .text-orange-600 {
    color: #f97316 !important;
}

.dark-mode .text-emerald-800 {
    color: #6ee7b7 !important;
}

.dark-mode .text-emerald-700 {
    color: #34d399 !important;
}

.dark-mode .text-emerald-600 {
    color: #10b981 !important;
}

.dark-mode .text-teal-700 {
    color: #5eead4 !important;
}

.dark-mode .text-teal-600 {
    color: #2dd4bf !important;
}

.dark-mode .text-cyan-700 {
    color: #67e8f9 !important;
}

.dark-mode .text-cyan-600 {
    color: #22d3ee !important;
}

.dark-mode .text-violet-700 {
    color: #c4b5fd !important;
}

.dark-mode .text-violet-600 {
    color: #a78bfa !important;
}

.dark-mode .text-amber-700 {
    color: #fcd34d !important;
}

.dark-mode .text-amber-600 {
    color: #fbbf24 !important;
}

.dark-mode .text-amber-900 {
    color: #fde68a !important;
}

.dark-mode .border-green-500 {
    border-color: #22c55e !important;
}

.dark-mode .border-yellow-500 {
    border-color: #eab308 !important;
}

.dark-mode .border-purple-600 {
    border-color: #9333ea !important;
}

/* Pulse animation for heart */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* ================================
   Chapter Learning Cards
   ================================ */
.chapter-card .bg-gradient-to-br.from-indigo-50.to-purple-50 {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chapter-card .bg-gradient-to-br.from-indigo-50.to-purple-50:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

/* Learning card icon animation */
.chapter-card .bg-gradient-to-br.from-indigo-50.to-purple-50 .text-2xl {
    transition: transform 0.3s ease;
}

.chapter-card .bg-gradient-to-br.from-indigo-50.to-purple-50:hover .text-2xl {
    transform: scale(1.2);
}

/* Practical application card */
.chapter-card .bg-gradient-to-r.from-green-50.to-emerald-50 {
    position: relative;
    overflow: hidden;
}

.chapter-card .bg-gradient-to-r.from-green-50.to-emerald-50::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #10b981, #059669);
    border-radius: 4px 0 0 4px;
}

/* Quote card styling */
.chapter-card .bg-gradient-to-r.from-amber-50.to-orange-50 {
    position: relative;
}

.chapter-card .bg-gradient-to-r.from-amber-50.to-orange-50::after {
    content: '❞';
    position: absolute;
    bottom: 10px;
    right: 20px;
    font-size: 2rem;
    color: rgba(245, 158, 11, 0.3);
}

.dark-mode .bg-amber-50 {
    background-color: #78350f !important;
}

.dark-mode .bg-indigo-50 {
    background-color: #312e81 !important;
}

.dark-mode .bg-purple-50 {
    background-color: #4c1d95 !important;
}

.dark-mode .bg-indigo-100 {
    background-color: #3730a3 !important;
}

.dark-mode .chapter-card {
    background-color: #1e293b !important;
    border: 1px solid #334155;
}

/* LOA Masters Section Dark Mode */
.dark-mode .bg-gradient-to-b.from-rose-50.to-pink-50 {
    background: linear-gradient(to bottom, #1e293b, #1e293b) !important;
}

.dark-mode .teacher-btn {
    transition: all 0.3s ease;
}

.dark-mode .teacher-btn:not(.active) {
    background-color: #374151 !important;
    color: #e2e8f0 !important;
}

.dark-mode .teacher-btn:not(.active):hover {
    background-color: #4338ca !important;
    color: white !important;
}

.dark-mode .bg-gradient-to-r.from-pink-100.to-rose-100,
.dark-mode .bg-gradient-to-r.from-indigo-100.to-blue-100,
.dark-mode .bg-gradient-to-r.from-amber-100.to-yellow-100,
.dark-mode .bg-gradient-to-r.from-teal-100.to-cyan-100,
.dark-mode .bg-gradient-to-r.from-violet-100.to-purple-100 {
    background: linear-gradient(to right, #312e81, #1e1b4b) !important;
}

.dark-mode .bg-rose-50,
.dark-mode .bg-pink-50,
.dark-mode .bg-fuchsia-50,
.dark-mode .bg-violet-50,
.dark-mode .bg-teal-50,
.dark-mode .bg-cyan-50 {
    background-color: #1e293b !important;
}

.dark-mode .text-rose-800,
.dark-mode .text-pink-800,
.dark-mode .text-fuchsia-800,
.dark-mode .text-violet-800,
.dark-mode .text-teal-800,
.dark-mode .text-cyan-800 {
    color: #fda4af !important;
}

.dark-mode table thead tr {
    background-color: #312e81 !important;
}

.dark-mode table tbody tr {
    border-color: #334155 !important;
}

.dark-mode table tbody tr.bg-gray-50 {
    background-color: #1e293b !important;
}

.dark-mode .chapter-card:hover {
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

/* The Secret Section Dark Mode */
.dark-mode .bg-gradient-to-b.from-amber-50.to-yellow-50 {
    background: linear-gradient(to bottom, #1e293b, #1e293b) !important;
}

.dark-mode .bg-gradient-to-br.from-pink-100.to-rose-100 {
    background: linear-gradient(to bottom right, #831843, #9f1239) !important;
}

/* Additional gradient fixes for dark mode */
.dark-mode .bg-gradient-to-br.from-green-100.to-emerald-100 {
    background: linear-gradient(to bottom right, #14532d, #064e3b) !important;
}

.dark-mode .bg-gradient-to-br.from-blue-100.to-indigo-100 {
    background: linear-gradient(to bottom right, #1e3a5f, #312e81) !important;
}

.dark-mode .bg-gradient-to-br.from-amber-100.to-orange-100 {
    background: linear-gradient(to bottom right, #78350f, #7c2d12) !important;
}

.dark-mode .bg-gradient-to-br.from-purple-100.to-pink-100 {
    background: linear-gradient(to bottom right, #4c1d95, #831843) !important;
}

.dark-mode .bg-gradient-to-br.from-violet-100.to-purple-100 {
    background: linear-gradient(to bottom right, #4c1d95, #581c87) !important;
}

.dark-mode .bg-gradient-to-br.from-amber-50.to-orange-50 {
    background: linear-gradient(to bottom right, #78350f, #7c2d12) !important;
}

.dark-mode .bg-gradient-to-br.from-green-50.to-emerald-50 {
    background: linear-gradient(to bottom right, #14532d, #064e3b) !important;
}

.dark-mode .bg-gradient-to-br.from-blue-50.to-indigo-50 {
    background: linear-gradient(to bottom right, #1e3a5f, #312e81) !important;
}

.dark-mode .bg-gradient-to-br.from-yellow-100.to-amber-100 {
    background: linear-gradient(to bottom right, #713f12, #78350f) !important;
}

.dark-mode .bg-gradient-to-br.from-rose-50.to-pink-50 {
    background: linear-gradient(to bottom right, #881337, #831843) !important;
}

.dark-mode .bg-gradient-to-br.from-emerald-100.to-teal-100 {
    background: linear-gradient(to bottom right, #064e3b, #134e4a) !important;
}

/* Fix from-to gradients */
.dark-mode .bg-gradient-to-b.from-green-50.to-emerald-50 {
    background: linear-gradient(to bottom, #14532d, #064e3b) !important;
}

.dark-mode .bg-gradient-to-b.from-blue-50.to-indigo-50 {
    background: linear-gradient(to bottom, #1e3a5f, #312e81) !important;
}

.dark-mode .bg-gradient-to-b.from-pink-50.to-rose-50 {
    background: linear-gradient(to bottom, #831843, #881337) !important;
}

.dark-mode .bg-red-50 {
    background-color: #7f1d1d !important;
}

.dark-mode .border-red-200 {
    border-color: #b91c1c !important;
}

.dark-mode .text-red-800 {
    color: #fca5a5 !important;
}

.dark-mode .text-red-700 {
    color: #fca5a5 !important;
}

.dark-mode .text-rose-800 {
    color: #fda4af !important;
}

.dark-mode .text-rose-700 {
    color: #fda4af !important;
}

.dark-mode .border-green-500 {
    border-color: #22c55e !important;
}

.dark-mode .border-pink-500 {
    border-color: #ec4899 !important;
}

.dark-mode .border-blue-500 {
    border-color: #3b82f6 !important;
}

.dark-mode .hover\:bg-indigo-50:hover {
    background-color: #312e81 !important;
}

.dark-mode .border-gray-100 {
    border-color: #334155 !important;
}

.dark-mode .border-t {
    border-color: #334155 !important;
}

/* Dark mode for chapter learning cards */
.dark-mode .chapter-card .bg-gradient-to-br.from-indigo-50.to-purple-50 {
    background: linear-gradient(to bottom right, #312e81, #4c1d95) !important;
}

.dark-mode .chapter-card .bg-gradient-to-r.from-green-50.to-emerald-50 {
    background: linear-gradient(to right, #14532d, #064e3b) !important;
    border-color: #16a34a !important;
}

.dark-mode .chapter-card .bg-gradient-to-r.from-amber-50.to-orange-50 {
    background: linear-gradient(to right, #78350f, #7c2d12) !important;
    border-color: #d97706 !important;
}

.dark-mode .chapter-card .bg-gray-50 {
    background-color: #1e293b !important;
}

.dark-mode .chapter-card .text-indigo-900 {
    color: #a5b4fc !important;
}

.dark-mode .chapter-card .text-green-800 {
    color: #86efac !important;
}

.dark-mode .chapter-card .text-amber-700 {
    color: #fcd34d !important;
}

.dark-mode .chapter-card .border-indigo-400 {
    border-color: #818cf8 !important;
}

.dark-mode .chapter-card .border-green-200 {
    border-color: #22c55e !important;
}

.dark-mode .chapter-card .border-amber-200 {
    border-color: #f59e0b !important;
}

.dark-mode .shadow-md {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3) !important;
}

.dark-mode .shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3) !important;
}

.dark-mode .shadow-sm {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.3) !important;
}

.dark-mode nav {
    background-color: rgba(30, 41, 59, 0.95) !important;
}

/* ================================
   Mobile Responsive Fixes
   ================================ */

/* Tablet and below */
@media (max-width: 1023px) {
    /* Navigation spacing */
    nav .space-x-4 {
        gap: 0.75rem;
    }
}

/* Mobile devices */
@media (max-width: 767px) {
    /* Hero section mobile */
    .gradient-bg h1 {
        font-size: 2rem !important;
        line-height: 1.2;
    }
    
    .gradient-bg .text-xl,
    .gradient-bg .text-2xl {
        font-size: 1rem !important;
    }
    
    .gradient-bg .text-lg {
        font-size: 0.9rem !important;
    }
    
    /* Stats on mobile */
    .gradient-bg .flex.justify-center.space-x-8 {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    /* Section headings mobile */
    section h2 {
        font-size: 1.75rem !important;
        padding: 0 0.5rem;
    }
    
    /* Cards and grids on mobile */
    .grid {
        gap: 1rem !important;
    }
    
    /* Teacher buttons wrap on mobile */
    .flex.flex-wrap.justify-center.gap-4 {
        gap: 0.5rem !important;
    }
    
    .teacher-btn {
        padding: 0.5rem 1rem !important;
        font-size: 0.875rem !important;
    }
    
    /* Table scroll on mobile */
    .overflow-x-auto {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
    }
    
    /* Lineage section on mobile */
    .flex.flex-wrap.justify-center.items-center.gap-4 .text-3xl {
        display: none;
    }
    
    /* Chakra labels on mobile */
    .ml-4.text-sm.text-gray-600 {
        font-size: 0.65rem !important;
        margin-left: 0.5rem !important;
    }
    
    /* Quote sections */
    blockquote {
        font-size: 1.25rem !important;
    }
    
    /* Footer links wrap */
    footer .flex.justify-center {
        flex-wrap: wrap;
        gap: 0.75rem !important;
    }
    
    footer .flex.justify-center a {
        font-size: 0.875rem;
    }
    
    /* Cookie consent mobile */
    .cookie-consent .flex-col.md\:flex-row {
        flex-direction: column;
    }
    
    .cookie-consent .flex.space-x-3 {
        width: 100%;
        justify-content: center;
    }
    
    .cookie-consent button {
        flex: 1;
    }
    
    /* Process steps mobile */
    .grid.md\:grid-cols-4,
    .grid.md\:grid-cols-5 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* Flow arrows hide on mobile */
    .space-x-4 > .text-2xl,
    .flex > .text-3xl.text-amber-500 {
        display: none;
    }
    
    /* Padding adjustments */
    section {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .p-8 {
        padding: 1.5rem !important;
    }
    
    .p-12 {
        padding: 1.5rem !important;
    }
    
    .md\:p-12 {
        padding: 1.5rem !important;
    }
}

.dark-mode #mobileMenu {
    background-color: #1e293b !important;
}

.dark-mode .bg-white\/95 {
    background-color: rgba(30, 41, 59, 0.95) !important;
}

.dark-mode .bg-white\/10 {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* ================================
   Cookie Consent Banner
   ================================ */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to right, #1e293b, #0f172a);
    z-index: 9999;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(0);
    transition: transform 0.5s ease;
}

.cookie-consent.hidden {
    transform: translateY(100%);
}

/* ================================
   Ad Placement Styles
   ================================ */
.ad-container {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.ad-container p {
    color: #64748b;
    font-size: 14px;
}

.dark-mode .ad-container {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
}

.dark-mode .ad-container p {
    color: #94a3b8;
}

/* Ad placement between sections */
.ad-banner {
    max-width: 728px;
    margin: 0 auto;
}

.ad-sidebar {
    max-width: 300px;
}

/* ================================
   Comprehensive Dark Mode Contrast Fixes
   ================================ */

/* Fix all light colored text on light backgrounds in dark mode */
.dark-mode p,
.dark-mode span,
.dark-mode li,
.dark-mode td,
.dark-mode th,
.dark-mode label {
    color: inherit;
}

/* Ensure all section text is readable */
.dark-mode section .text-gray-700,
.dark-mode section .text-gray-600,
.dark-mode section .text-gray-500 {
    color: #cbd5e1 !important;
}

.dark-mode section .text-gray-800 {
    color: #e2e8f0 !important;
}

/* Fix specific colored text elements */
.dark-mode .text-indigo-600 {
    color: #a5b4fc !important;
}

.dark-mode .text-pink-800,
.dark-mode .text-pink-700 {
    color: #f9a8d4 !important;
}

.dark-mode .text-rose-600,
.dark-mode .text-rose-500 {
    color: #fda4af !important;
}

.dark-mode .text-blue-900 {
    color: #93c5fd !important;
}

.dark-mode .text-green-900 {
    color: #86efac !important;
}

.dark-mode .text-amber-500 {
    color: #fbbf24 !important;
}

/* Fix border colors for better visibility */
.dark-mode .border-gray-200,
.dark-mode .border-gray-300 {
    border-color: #475569 !important;
}

.dark-mode .border-amber-200,
.dark-mode .border-amber-300 {
    border-color: #b45309 !important;
}

.dark-mode .border-green-200,
.dark-mode .border-green-300 {
    border-color: #16a34a !important;
}

.dark-mode .border-blue-200,
.dark-mode .border-blue-300 {
    border-color: #2563eb !important;
}

.dark-mode .border-purple-200,
.dark-mode .border-purple-300 {
    border-color: #7c3aed !important;
}

.dark-mode .border-pink-200,
.dark-mode .border-pink-300 {
    border-color: #db2777 !important;
}

.dark-mode .border-indigo-200,
.dark-mode .border-indigo-300 {
    border-color: #4f46e5 !important;
}

/* Fix hover states in dark mode */
.dark-mode a:hover {
    color: #a5b4fc !important;
}

.dark-mode .hover\:text-indigo-600:hover {
    color: #a5b4fc !important;
}

/* Fix card contents in dark mode */
.dark-mode .bg-white p,
.dark-mode .bg-white span,
.dark-mode .bg-white li {
    color: #cbd5e1;
}

.dark-mode .bg-white h3,
.dark-mode .bg-white h4,
.dark-mode .bg-white strong {
    color: #e2e8f0;
}

/* Fix specific component colors */
.dark-mode .bg-gray-50 {
    background-color: #1e293b !important;
}

.dark-mode .bg-gray-50 .text-gray-700,
.dark-mode .bg-gray-50 .text-gray-600 {
    color: #cbd5e1 !important;
}

/* Fix LOA Masters tabs */
.dark-mode #teacher-abraham .text-gray-700,
.dark-mode #teacher-neville .text-gray-700,
.dark-mode #teacher-napoleon .text-gray-700,
.dark-mode #teacher-wayne .text-gray-700,
.dark-mode #teacher-florence .text-gray-700 {
    color: #cbd5e1 !important;
}

.dark-mode #teacher-abraham .text-gray-600,
.dark-mode #teacher-neville .text-gray-600,
.dark-mode #teacher-napoleon .text-gray-600,
.dark-mode #teacher-wayne .text-gray-600,
.dark-mode #teacher-florence .text-gray-600 {
    color: #94a3b8 !important;
}

/* Fix The Secret page specific colors */
.dark-mode .bg-gradient-to-r.from-amber-500.to-orange-500 {
    background: linear-gradient(to right, #d97706, #ea580c) !important;
}

/* Fix light colored backgrounds with dark backgrounds in dark mode */
.dark-mode [class*="bg-"][class*="-50"],
.dark-mode [class*="bg-"][class*="-100"] {
    color: #e2e8f0;
}

/* Fix all rounded card backgrounds */
.dark-mode .rounded-xl,
.dark-mode .rounded-2xl,
.dark-mode .rounded-3xl {
    color: #e2e8f0;
}

/* Fix form elements */
.dark-mode input,
.dark-mode textarea,
.dark-mode select {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
    border-color: #475569 !important;
}

.dark-mode input::placeholder,
.dark-mode textarea::placeholder {
    color: #64748b !important;
}

/* Fix italic text */
.dark-mode .italic {
    color: #cbd5e1 !important;
}

/* Fix specific meditation page colors */
.dark-mode .bg-gradient-to-b.from-green-50.to-emerald-50 .text-gray-800,
.dark-mode .bg-gradient-to-b.from-green-50.to-emerald-50 .text-gray-700 {
    color: #e2e8f0 !important;
}

.dark-mode .bg-gradient-to-b.from-blue-50.to-indigo-50 .text-gray-800,
.dark-mode .bg-gradient-to-b.from-blue-50.to-indigo-50 .text-gray-700 {
    color: #e2e8f0 !important;
}

.dark-mode .bg-gradient-to-b.from-purple-50.to-pink-50 .text-gray-800,
.dark-mode .bg-gradient-to-b.from-purple-50.to-pink-50 .text-gray-700 {
    color: #e2e8f0 !important;
}

/* Fix footer in dark mode */
.dark-mode footer {
    background-color: #0f172a !important;
}

.dark-mode footer a {
    color: #94a3b8 !important;
}

.dark-mode footer a:hover {
    color: #e2e8f0 !important;
}

/* ================================
   Smooth Transitions for All Elements
   ================================ */
*, *::before, *::after {
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
