/*
 * RSL Modern Theme
 * A modern, sleek design system that makes RSL stand apart
 * Includes: Dark mode, glassmorphism, colored shadows, enhanced typography
 */

:root {
    /* Brand Colors - Enhanced */
    --rsl-primary: #6E7BFF;
    --rsl-primary-light: #8B96FF;
    --rsl-primary-dark: #5A67D8;
    --rsl-gradient-start: #667eea;
    --rsl-gradient-mid: #764ba2;
    --rsl-gradient-end: #a855f7;

    /* Colored Shadows - RSL Purple */
    --rsl-shadow-sm: 0 2px 8px rgba(110, 123, 255, 0.15);
    --rsl-shadow-md: 0 4px 16px rgba(110, 123, 255, 0.2);
    --rsl-shadow-lg: 0 8px 24px rgba(110, 123, 255, 0.25);
    --rsl-shadow-xl: 0 12px 32px rgba(110, 123, 255, 0.3);

    /* Light Mode Colors */
    --rsl-bg-primary: #ffffff;
    --rsl-bg-secondary: #f8f9fa;
    --rsl-bg-tertiary: #e9ecef;
    --rsl-text-primary: #212529;
    --rsl-text-secondary: #6c757d;
    --rsl-text-tertiary: #adb5bd;
    --rsl-border: #e0e0e0;

    /* Dark Mode Colors */
    --rsl-dark-bg-primary: #1a1a2e;
    --rsl-dark-bg-secondary: #16213e;
    --rsl-dark-bg-tertiary: #0f3460;
    --rsl-dark-text-primary: #ffffff;
    --rsl-dark-text-secondary: rgba(255, 255, 255, 0.8);
    --rsl-dark-text-tertiary: rgba(255, 255, 255, 0.6);
    --rsl-dark-border: rgba(255, 255, 255, 0.1);

    /* Typography Scale - Enhanced */
    --rsl-text-xs: 0.75rem;
    --rsl-text-sm: 0.875rem;
    --rsl-text-base: 1rem;
    --rsl-text-lg: 1.125rem;
    --rsl-text-xl: 1.25rem;
    --rsl-text-2xl: 1.5rem;
    --rsl-text-3xl: 1.875rem;
    --rsl-text-4xl: 2.5rem;
    --rsl-text-5xl: 3.5rem;
    --rsl-text-6xl: 4.5rem;

    /* Spacing Scale - Enhanced */
    --rsl-space-xs: 0.5rem;
    --rsl-space-sm: 0.75rem;
    --rsl-space-md: 1rem;
    --rsl-space-lg: 1.5rem;
    --rsl-space-xl: 2rem;
    --rsl-space-2xl: 3rem;
    --rsl-space-3xl: 4rem;
    --rsl-space-4xl: 6rem;

    /* Border Radius */
    --rsl-radius-sm: 6px;
    --rsl-radius-md: 12px;
    --rsl-radius-lg: 16px;
    --rsl-radius-xl: 24px;

    /* Transitions */
    --rsl-transition-fast: 150ms ease;
    --rsl-transition-base: 250ms ease;
    --rsl-transition-slow: 350ms ease;

    /* Glassmorphism */
    --rsl-glass-bg: rgba(255, 255, 255, 0.05);
    --rsl-glass-border: rgba(255, 255, 255, 0.1);
    --rsl-glass-blur: 10px;
}

/* Dark Mode */
[data-theme="dark"] {
    color-scheme: dark;
    --rsl-text-secondary: #94a3b8;
}

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

/* Dark Mode Toggle Button */
.rsl-theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rsl-gradient-start), var(--rsl-gradient-end));
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--rsl-shadow-lg);
    transition: all var(--rsl-transition-base);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rsl-theme-toggle:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: var(--rsl-shadow-xl);
}

.rsl-theme-toggle:active {
    transform: translateY(-2px) scale(1.02);
}

.rsl-theme-toggle .icon-sun,
.rsl-theme-toggle .icon-moon {
    transition: all var(--rsl-transition-base);
}

/* Fix centering for RSL icons in theme toggle */
.rsl-theme-toggle .rsl-icon {
    display: block;
    width: 28px;
    height: 28px;
    vertical-align: unset;
    margin: 0;
}

/* Light mode: show sun, hide moon */
.rsl-theme-toggle .icon-sun {
    display: block;
}

.rsl-theme-toggle .icon-moon {
    display: none;
}

/* Dark mode: show moon, hide sun */
[data-theme="dark"] .rsl-theme-toggle .icon-sun {
    display: none;
}

[data-theme="dark"] .rsl-theme-toggle .icon-moon {
    display: block;
}

/* Enhanced Hero Sections */
.hero-section {
    background: linear-gradient(135deg, var(--rsl-gradient-start) 0%, var(--rsl-gradient-mid) 50%, var(--rsl-gradient-end) 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: moveGrid 20s linear infinite;
    pointer-events: none;
}

@keyframes moveGrid {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.hero-section h1 {
    font-size: var(--rsl-text-5xl);
    font-weight: 700;
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

@media (min-width: 768px) {
    .hero-section h1 {
        font-size: var(--rsl-text-6xl);
    }
}

/* Glassmorphism Cards */
.feature-card,
.example-card,
.rsl-card-glass {
    background: var(--rsl-glass-bg);
    backdrop-filter: blur(var(--rsl-glass-blur));
    -webkit-backdrop-filter: blur(var(--rsl-glass-blur));
    border: 1px solid var(--rsl-glass-border);
    transition: all var(--rsl-transition-base);
}

[data-theme="light"] .feature-card,
[data-theme="light"] .example-card,
[data-theme="light"] .rsl-card-glass {
    background: var(--rsl-bg-primary);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--rsl-border);
}

.feature-card:hover,
.example-card:hover,
.rsl-card-glass:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(110, 123, 255, 0.5);
    transform: translateY(-6px);
    box-shadow: var(--rsl-shadow-xl);
}

[data-theme="light"] .feature-card:hover,
[data-theme="light"] .example-card:hover,
[data-theme="light"] .rsl-card-glass:hover {
    background: var(--rsl-bg-primary);
    box-shadow: var(--rsl-shadow-lg);
}

/* Enhanced Typography */
.section-title {
    font-size: var(--rsl-text-4xl);
    font-weight: 700;
    margin-bottom: var(--rsl-space-xl);
    background: linear-gradient(135deg, var(--rsl-gradient-start), var(--rsl-gradient-mid), var(--rsl-gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    font-size: var(--rsl-text-xl);
    margin-bottom: var(--rsl-space-3xl);
}

/* Enhanced Spacing */
.container {
    padding-top: var(--rsl-space-3xl);
    padding-bottom: var(--rsl-space-3xl);
}

/* Colored Shadows on Interactive Elements */
.hero-button,
.cta-button,
button.btn-primary,
a.btn-primary {
    box-shadow: var(--rsl-shadow-md);
    transition: all var(--rsl-transition-base);
}

.hero-button:hover,
.cta-button:hover,
button.btn-primary:hover,
a.btn-primary:hover {
    box-shadow: var(--rsl-shadow-lg);
    transform: translateY(-2px);
}

.hero-button:active,
.cta-button:active,
button.btn-primary:active,
a.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--rsl-shadow-sm);
}

/* Dark Mode Specific Adjustments */
[data-theme="dark"] .section-title {
    background: linear-gradient(135deg, #6E7BFF, #a855f7, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

[data-theme="dark"] .feature-card h3,
[data-theme="dark"] .example-card h3 {
    color: #6E7BFF;
}

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

[data-theme="dark"] .code-preview {
    background: rgba(255, 255, 255, 0.05) !important;
    border-left-color: #6E7BFF !important;
}

[data-theme="dark"] .code-preview h3,
[data-theme="dark"] .code-preview h2,
[data-theme="dark"] .code-preview h4 {
    color: var(--rsl-dark-text-primary) !important;
}

[data-theme="dark"] .code-preview p {
    color: var(--rsl-dark-text-secondary) !important;
}

[data-theme="dark"] .code-preview pre {
    background: rgba(0, 0, 0, 0.3) !important;
    border-color: var(--rsl-dark-border) !important;
}

[data-theme="dark"] .code-preview code {
    color: #e0e0e0 !important;
}

/* Enhanced Navbar in Dark Mode */
[data-theme="dark"] .rsl-navbar {
    background: var(--rsl-dark-bg-secondary);
    border-bottom: 1px solid var(--rsl-dark-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

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

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

[data-theme="dark"] .rsl-navbar-link.active {
    background-color: #6E7BFF !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(110, 123, 255, 0.4);
}

[data-theme="dark"] .rsl-navbar-dropdown {
    background: var(--rsl-dark-bg-tertiary);
    border: 1px solid var(--rsl-dark-border);
    box-shadow: var(--rsl-shadow-lg);
}

/* Enhanced Footer in Dark Mode */
[data-theme="dark"] .rsl-footer {
    background: var(--rsl-dark-bg-secondary);
    border-top: 1px solid var(--rsl-dark-border);
}

[data-theme="dark"] .rsl-footer-title,
[data-theme="dark"] .rsl-footer-copy {
    color: var(--rsl-dark-text-secondary);
}

/* Gradient Text Utilities */
.rsl-text-gradient {
    background: linear-gradient(135deg, var(--rsl-gradient-start), var(--rsl-gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Enhanced Border Radius */
.feature-card,
.example-card,
.code-preview {
    border-radius: var(--rsl-radius-lg);
}

.hero-button,
.cta-button {
    border-radius: var(--rsl-radius-md);
}

/* Smooth Transitions for Theme Switching */
body,
.hero-section,
.feature-card,
.example-card,
.rsl-navbar,
.rsl-footer,
.code-preview,
.section-title,
.section-subtitle {
    transition: background var(--rsl-transition-base),
                color var(--rsl-transition-base),
                border-color var(--rsl-transition-base);
}

/* Info Box Dark Mode */
[data-theme="dark"] .info-box {
    background: rgba(0, 102, 204, 0.1);
    border-left-color: #0066cc;
}

[data-theme="dark"] .info-box h4 {
    color: #6E7BFF;
}

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

/* Coming Soon Cards Dark Mode */
[data-theme="dark"] .coming-soon {
    background: rgba(255, 255, 255, 0.02);
    border-color: var(--rsl-dark-border);
    color: var(--rsl-dark-text-secondary);
}

[data-theme="dark"] .coming-soon h3 {
    color: var(--rsl-dark-text-tertiary);
}

/* Enhanced CTA Section */
.cta-section {
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    animation: moveGrid 15s linear infinite reverse;
    pointer-events: none;
}

/* Responsive Typography Adjustments */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: var(--rsl-text-4xl);
    }

    .section-title {
        font-size: var(--rsl-text-3xl);
    }

    .section-subtitle {
        font-size: var(--rsl-text-lg);
    }
}

/* Force Dark Mode Styles - Override Inline Styles */
[data-theme="dark"] .hero-button {
    background: white !important;
    color: #667eea !important;
}

[data-theme="dark"] .hero-button.secondary {
    background: transparent !important;
    color: white !important;
    border-color: white !important;
}

[data-theme="dark"] .feature-card,
[data-theme="dark"] .example-card,
[data-theme="dark"] .component-card {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Dark mode for intro text sections */
[data-theme="dark"] .intro-text,
[data-theme="dark"] .intro-text p,
[data-theme="dark"] .intro-text li {
    color: var(--rsl-dark-text-secondary) !important;
}

[data-theme="dark"] .intro-text h2,
[data-theme="dark"] .intro-text h3 {
    color: var(--rsl-dark-text-primary) !important;
}

[data-theme="dark"] .intro-text {
    background: transparent !important;
}

/* Dark mode for component cards */
[data-theme="dark"] .component-card h3 {
    color: #6E7BFF !important;
}

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

/* Dark mode for demo cards (example layouts) */
[data-theme="dark"] .demo-card {
    background: linear-gradient(135deg, rgba(110, 123, 255, 0.08), rgba(168, 85, 247, 0.08)) !important;
    border-color: rgba(110, 123, 255, 0.3) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

[data-theme="dark"] .demo-card h3 {
    color: #8B96FF !important;
}

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

/* Dark mode for pattern cards (use case cards) */
[data-theme="dark"] .pattern-card {
    background: linear-gradient(135deg, rgba(110, 123, 255, 0.08), rgba(168, 85, 247, 0.08)) !important;
    border-color: rgba(110, 123, 255, 0.3) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

[data-theme="dark"] .pattern-card h4,
[data-theme="dark"] .pattern-card h3 {
    color: #8B96FF !important;
}

[data-theme="dark"] .pattern-card p,
[data-theme="dark"] .pattern-card li {
    color: var(--rsl-dark-text-secondary) !important;
}

/* Dark mode for table of contents */
[data-theme="dark"] .toc {
    background: linear-gradient(135deg, rgba(110, 123, 255, 0.08), rgba(168, 85, 247, 0.08)) !important;
    border-color: rgba(110, 123, 255, 0.3) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

[data-theme="dark"] .toc h3 {
    color: #8B96FF !important;
}

[data-theme="dark"] .toc li {
    color: var(--rsl-dark-text-secondary) !important;
}

[data-theme="dark"] .toc a {
    color: var(--rsl-primary-light) !important;
}

[data-theme="dark"] .toc a:hover {
    color: #fff !important;
}

/* Dark mode for feature boxes (why-rsl.html cards) */
[data-theme="dark"] .feature-box {
    background: linear-gradient(135deg, rgba(110, 123, 255, 0.08), rgba(168, 85, 247, 0.08)) !important;
    border-left-color: #6E7BFF !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

[data-theme="dark"] .feature-box h3 {
    color: #8B96FF !important;
}

[data-theme="dark"] .feature-box p,
[data-theme="dark"] .feature-box li {
    color: var(--rsl-dark-text-secondary) !important;
}

/* Dark mode for download cards */
[data-theme="dark"] .download-card {
    background: linear-gradient(135deg, rgba(110, 123, 255, 0.08), rgba(168, 85, 247, 0.08)) !important;
    border-color: rgba(110, 123, 255, 0.3) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

[data-theme="dark"] .download-card h3 {
    color: #8B96FF !important;
}

[data-theme="dark"] .download-card p,
[data-theme="dark"] .download-card li {
    color: var(--rsl-dark-text-secondary) !important;
}

/* Dark mode for download buttons */
[data-theme="dark"] .download-btn {
    background: #6E7BFF !important;
    color: white !important;
}

[data-theme="dark"] .download-btn:hover {
    background: #5a67d8 !important;
    color: white !important;
}

[data-theme="dark"] .code-preview pre {
    background: rgba(0, 0, 0, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Fix all white backgrounds in dark mode */
[data-theme="dark"] [style*="background: white"],
[data-theme="dark"] [style*="background:white"] {
    background: rgba(255, 255, 255, 0.05) !important;
}

/* Fix specific elements with inline styles */
[data-theme="dark"] a[style*="background: #6E7BFF"] {
    background: #6E7BFF !important;
    color: white !important;
}

[data-theme="dark"] div[style*="background: white"] {
    background: rgba(255, 255, 255, 0.05) !important;
}

[data-theme="dark"] div[style*="border: 1px solid #dee2e6"] {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Dark mode text colors for all headings */
[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(--rsl-dark-text-primary);
}

/* Dark mode for cards with light text */
[data-theme="dark"] .feature-card h3,
[data-theme="dark"] .example-card h3,
[data-theme="dark"] div[style*="text-align: left"] h3 {
    color: #6E7BFF !important;
}

[data-theme="dark"] .feature-card p,
[data-theme="dark"] .example-card p,
[data-theme="dark"] div[style*="text-align: left"] p {
    color: var(--rsl-dark-text-secondary) !important;
}

/* Dark mode for centered content sections */
[data-theme="dark"] div[style*="text-align: center"] a {
    background: #6E7BFF !important;
    color: white !important;
}

/* Dark mode for example preview sections */
[data-theme="dark"] .example-preview {
    background: rgba(255, 255, 255, 0.03) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Dark mode for demo sections */
[data-theme="dark"] .demo-wrap {
    color: var(--rsl-dark-text-primary);
}

/* Dark mode for all paragraphs in containers */
[data-theme="dark"] .container p,
[data-theme="dark"] .container-full p {
    color: var(--rsl-dark-text-secondary);
}

/* Dark mode for lists */
[data-theme="dark"] ul,
[data-theme="dark"] ol,
[data-theme="dark"] li {
    color: var(--rsl-dark-text-secondary);
}

/* Dark mode for tables */
[data-theme="dark"] table {
    background: rgba(255, 255, 255, 0.03);
    color: var(--rsl-dark-text-primary);
}

[data-theme="dark"] th {
    background: rgba(110, 123, 255, 0.2);
    color: var(--rsl-dark-text-primary);
}

[data-theme="dark"] td {
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--rsl-dark-text-secondary);
}

/* Dark mode for form elements */
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--rsl-dark-text-primary);
}

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

/* Dark mode for buttons */
[data-theme="dark"] button:not(.rsl-theme-toggle):not(.hero-button):not(.cta-button):not(.btn-primary):not(.btn-success):not(.btn-danger):not(.btn-warning):not(.btn-info):not(.btn-default) {
    background: rgba(110, 123, 255, 0.2);
    border-color: rgba(110, 123, 255, 0.3);
    color: var(--rsl-dark-text-primary);
}

/* Dark mode for primary buttons */
[data-theme="dark"] .btn-primary,
[data-theme="dark"] button.btn-primary,
[data-theme="dark"] a.btn-primary {
    background-color: #6E7BFF !important;
    border-color: #5a67d8 !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(110, 123, 255, 0.3);
}

[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] button.btn-primary:hover,
[data-theme="dark"] a.btn-primary:hover {
    background-color: #5a67d8 !important;
    box-shadow: 0 4px 12px rgba(110, 123, 255, 0.4);
    color: #fff !important;
}

/* Dark mode for success buttons */
[data-theme="dark"] .btn-success,
[data-theme="dark"] button.btn-success,
[data-theme="dark"] a.btn-success {
    background-color: #2ecc71 !important;
    border-color: #27ae60 !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.3);
}

[data-theme="dark"] .btn-success:hover,
[data-theme="dark"] button.btn-success:hover,
[data-theme="dark"] a.btn-success:hover {
    background-color: #27ae60 !important;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
    color: #fff !important;
}

/* Dark mode for danger buttons */
[data-theme="dark"] .btn-danger,
[data-theme="dark"] button.btn-danger,
[data-theme="dark"] a.btn-danger {
    background-color: #e74c3c !important;
    border-color: #c0392b !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

[data-theme="dark"] .btn-danger:hover,
[data-theme="dark"] button.btn-danger:hover,
[data-theme="dark"] a.btn-danger:hover {
    background-color: #c0392b !important;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
    color: #fff !important;
}

/* Dark mode for warning buttons */
[data-theme="dark"] .btn-warning,
[data-theme="dark"] button.btn-warning,
[data-theme="dark"] a.btn-warning {
    background-color: #f39c12 !important;
    border-color: #e67e22 !important;
    color: #1a1a1a !important;
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3);
}

[data-theme="dark"] .btn-warning:hover,
[data-theme="dark"] button.btn-warning:hover,
[data-theme="dark"] a.btn-warning:hover {
    background-color: #e67e22 !important;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.4);
    color: #1a1a1a !important;
}

/* Dark mode for info buttons */
[data-theme="dark"] .btn-info,
[data-theme="dark"] button.btn-info,
[data-theme="dark"] a.btn-info {
    background-color: #3498db !important;
    border-color: #2980b9 !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

[data-theme="dark"] .btn-info:hover,
[data-theme="dark"] button.btn-info:hover,
[data-theme="dark"] a.btn-info:hover {
    background-color: #2980b9 !important;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
    color: #fff !important;
}

/* Dark mode for default buttons */
[data-theme="dark"] .btn-default,
[data-theme="dark"] button.btn-default,
[data-theme="dark"] a.btn-default {
    background-color: #95a5a6 !important;
    border-color: #7f8c8d !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(149, 165, 166, 0.3);
}

[data-theme="dark"] .btn-default:hover,
[data-theme="dark"] button.btn-default:hover,
[data-theme="dark"] a.btn-default:hover {
    background-color: #7f8c8d !important;
    box-shadow: 0 4px 12px rgba(149, 165, 166, 0.4);
    color: #fff !important;
}

/* Dark mode for links */
[data-theme="dark"] a:not(.hero-button):not(.cta-button):not(.rsl-navbar-link):not(.back-link) {
    color: var(--rsl-primary-light);
}

/* Dark mode for back links - ensure white text on purple background */
[data-theme="dark"] .back-link,
[data-theme="dark"] a.back-link {
    background: #6E7BFF !important;
    color: white !important;
}

[data-theme="dark"] .back-link:hover,
[data-theme="dark"] a.back-link:hover {
    background: #5a67d8 !important;
    color: white !important;
}

/* Dark mode for example content buttons (View Examples, etc.) */
[data-theme="dark"] .example-content a {
    background: #6E7BFF !important;
    color: white !important;
}

[data-theme="dark"] .example-content a:hover {
    background: #5a67d8 !important;
    color: white !important;
}

/* Dark mode for component links */
[data-theme="dark"] .component-content a,
[data-theme="dark"] div[style*="text-align: center"] > a[style*="background"] {
    color: white !important;
}

/* Dark mode for inline styled links with white/light backgrounds */
[data-theme="dark"] a[style*="background: white"],
[data-theme="dark"] a[style*="background:white"],
[data-theme="dark"] a[style*="background: #fff"] {
    background: white !important;
    color: #667eea !important;
}

[data-theme="dark"] a[style*="background: white"]:hover,
[data-theme="dark"] a[style*="background:white"]:hover,
[data-theme="dark"] a[style*="background: #fff"]:hover {
    background: #f0f0f0 !important;
    color: #5a67d8 !important;
}

/* Dark mode for breadcrumbs */
[data-theme="dark"] .rsl-breadcrumb {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .rsl-breadcrumb-item {
    color: var(--rsl-dark-text-secondary);
}

/* Dark mode for pagination */
[data-theme="dark"] .rsl-pagination .page-link {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--rsl-dark-text-primary);
}

/* Dark mode for tabs */
[data-theme="dark"] .rsl-tabs .tab-link {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--rsl-dark-text-secondary);
}

[data-theme="dark"] .rsl-tabs .tab-link.active {
    background: rgba(110, 123, 255, 0.2);
    border-color: #6E7BFF;
    color: var(--rsl-dark-text-primary);
}

/* Dark mode for modals */
[data-theme="dark"] .rsl-modal-content {
    background: var(--rsl-dark-bg-secondary);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--rsl-dark-text-primary);
}

[data-theme="dark"] .rsl-modal-header {
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .rsl-modal-footer {
    border-color: rgba(255, 255, 255, 0.1);
}

/* Dark mode for alerts */
[data-theme="dark"] .rsl-alert {
    background: rgba(110, 123, 255, 0.1);
    border-color: rgba(110, 123, 255, 0.3);
    color: var(--rsl-dark-text-primary);
}

/* Dark mode for toasts */
[data-theme="dark"] .rsl-toast {
    background: var(--rsl-dark-bg-secondary);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--rsl-dark-text-primary);
    box-shadow: var(--rsl-shadow-lg);
}

/* Dark mode for accordion */
[data-theme="dark"] .rsl-accordion-item,
[data-theme="dark"] .accordion-item {
    background: rgba(255, 255, 255, 0.03) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .rsl-accordion-header,
[data-theme="dark"] .accordion-title {
    background: rgba(110, 123, 255, 0.15) !important;
    color: var(--rsl-dark-text-primary) !important;
}

[data-theme="dark"] .accordion-content {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--rsl-dark-text-secondary) !important;
}

[data-theme="dark"] .accordion-content p,
[data-theme="dark"] .accordion-content li,
[data-theme="dark"] .accordion-content h1,
[data-theme="dark"] .accordion-content h2,
[data-theme="dark"] .accordion-content h3,
[data-theme="dark"] .accordion-content h4 {
    color: var(--rsl-dark-text-secondary) !important;
}

/* Dark mode for carousel */
[data-theme="dark"] .rsl-carousel {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .rsl-carousel-caption {
    background: rgba(0, 0, 0, 0.7);
    color: var(--rsl-dark-text-primary);
}

/* Dark mode for off-canvas */
[data-theme="dark"] .rsl-offcanvas {
    background: var(--rsl-dark-bg-secondary);
    color: var(--rsl-dark-text-primary);
}

/* Dark mode for popover */
[data-theme="dark"] .rsl-popover {
    background: var(--rsl-dark-bg-secondary) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: var(--rsl-dark-text-primary) !important;
    box-shadow: var(--rsl-shadow-lg) !important;
}

[data-theme="dark"] .rsl-popover-header {
    background: rgba(110, 123, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: var(--rsl-dark-text-primary) !important;
}

[data-theme="dark"] .rsl-popover-body {
    background: var(--rsl-dark-bg-secondary) !important;
    color: var(--rsl-dark-text-secondary) !important;
}

[data-theme="dark"] .rsl-popover .arrow::before,
[data-theme="dark"] .rsl-popover .arrow::after {
    border-color: var(--rsl-dark-bg-secondary) !important;
}

/* Dark mode for code blocks */
[data-theme="dark"] pre,
[data-theme="dark"] code {
    background: rgba(0, 0, 0, 0.3);
    color: #e0e0e0;
}

/* Dark mode for horizontal rules */
[data-theme="dark"] hr {
    border-color: rgba(255, 255, 255, 0.1);
}

/* Dark mode for badges */
[data-theme="dark"] .badge {
    background: rgba(110, 123, 255, 0.3);
    color: var(--rsl-dark-text-primary);
}

/* Dark mode for cards in grid layouts */
[data-theme="dark"] .slot-layout .slot-item > div[style*="background: white"] {
    background: linear-gradient(135deg, rgba(110, 123, 255, 0.08), rgba(168, 85, 247, 0.08)) !important;
    border-color: rgba(110, 123, 255, 0.3) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Apply glassmorphic effect to all white card-like divs in dark mode */
[data-theme="dark"] div[style*="background: white"][style*="border"],
[data-theme="dark"] div[style*="background:white"][style*="border"] {
    background: linear-gradient(135deg, rgba(110, 123, 255, 0.08), rgba(168, 85, 247, 0.08)) !important;
    border-color: rgba(110, 123, 255, 0.3) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Dark mode for warning boxes (yellow sticky notes) */
[data-theme="dark"] .warning-box {
    background: rgba(255, 193, 7, 0.15) !important;
    border-left-color: #ffc107 !important;
}

[data-theme="dark"] .warning-box h4,
[data-theme="dark"] .warning-box h3,
[data-theme="dark"] .warning-box h2 {
    color: #ffc107 !important;
}

[data-theme="dark"] .warning-box p,
[data-theme="dark"] .warning-box li,
[data-theme="dark"] .warning-box strong {
    color: var(--rsl-dark-text-secondary) !important;
}

/* Dark mode for tip boxes (blue) */
[data-theme="dark"] .tip-box {
    background: rgba(33, 150, 243, 0.15) !important;
    border-left-color: #2196f3 !important;
}

[data-theme="dark"] .tip-box h4,
[data-theme="dark"] .tip-box h3,
[data-theme="dark"] .tip-box h2,
[data-theme="dark"] .tip-box strong {
    color: #64b5f6 !important;
}

[data-theme="dark"] .tip-box p,
[data-theme="dark"] .tip-box li,
[data-theme="dark"] .tip-box ol,
[data-theme="dark"] .tip-box ul {
    color: var(--rsl-dark-text-secondary) !important;
}

/* Dark mode for success boxes (green) */
[data-theme="dark"] .success-box {
    background: rgba(76, 175, 80, 0.15) !important;
    border-left-color: #4caf50 !important;
}

[data-theme="dark"] .success-box h4,
[data-theme="dark"] .success-box h3,
[data-theme="dark"] .success-box h2 {
    color: #4caf50 !important;
}

[data-theme="dark"] .success-box p,
[data-theme="dark"] .success-box li,
[data-theme="dark"] .success-box strong {
    color: var(--rsl-dark-text-secondary) !important;
}

/* Dark mode for error boxes (red) */
[data-theme="dark"] .error-box {
    background: rgba(244, 67, 54, 0.15) !important;
    border-left-color: #f44336 !important;
}

[data-theme="dark"] .error-box h4,
[data-theme="dark"] .error-box h3,
[data-theme="dark"] .error-box h2 {
    color: #f44336 !important;
}

[data-theme="dark"] .error-box p,
[data-theme="dark"] .error-box li,
[data-theme="dark"] .error-box strong {
    color: var(--rsl-dark-text-secondary) !important;
}

/* Dark mode for category headers */
[data-theme="dark"] .category-header {
    color: var(--rsl-dark-text-primary) !important;
}

/* Dark mode for component links */
[data-theme="dark"] .component-links a {
    background: rgba(110, 123, 255, 0.2) !important;
    color: var(--rsl-primary-light) !important;
    border-color: rgba(110, 123, 255, 0.3) !important;
}

[data-theme="dark"] .component-links a:hover {
    background: rgba(110, 123, 255, 0.3) !important;
}

/* Dark mode for hero sections - only apply to heroes with no background set */
[data-theme="dark"] .rsl-hero[data-hero-bg="none"] {
    background: transparent;
}

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

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

/* Dark mode - override all light backgrounds globally */
[data-theme="dark"] div[style*="background: #f"],
[data-theme="dark"] div[style*="background:#f"],
[data-theme="dark"] p[style*="background: #f"],
[data-theme="dark"] p[style*="background:#f"] {
    background: rgba(255, 255, 255, 0.05) !important;
}

/* Dark mode - fix text on light backgrounds (including light blue #e3f2fd) */
[data-theme="dark"] div[style*="background: #e"],
[data-theme="dark"] div[style*="background:#e"],
[data-theme="dark"] p[style*="background: #e"],
[data-theme="dark"] p[style*="background:#e"] {
    background: rgba(33, 150, 243, 0.15) !important;
}

[data-theme="dark"] div[style*="background: #e"] *,
[data-theme="dark"] div[style*="background:#e"] *,
[data-theme="dark"] p[style*="background: #e"],
[data-theme="dark"] p[style*="background:#e"] {
    color: var(--rsl-dark-text-secondary) !important;
}

/* Dark mode for card grids */
[data-theme="dark"] .card-grid > div {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .card-grid h3,
[data-theme="dark"] .card-grid h4 {
    color: #6E7BFF !important;
}

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

/* Dark mode for well/callout sections */
[data-theme="dark"] .rsl-well {
    background: linear-gradient(135deg, rgba(110, 123, 255, 0.08), rgba(168, 85, 247, 0.08)) !important;
    border-color: rgba(110, 123, 255, 0.3) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

[data-theme="dark"] .rsl-well h4,
[data-theme="dark"] .rsl-well h3 {
    color: #8B96FF !important;
}

[data-theme="dark"] .rsl-well p,
[data-theme="dark"] .rsl-well li,
[data-theme="dark"] .rsl-well strong {
    color: var(--rsl-dark-text-secondary) !important;
}

[data-theme="dark"] .rsl-well code {
    background: rgba(0, 0, 0, 0.3) !important;
    color: #e0e0e0 !important;
}

/* Dark mode for page headers, content cards, dashboard panels, and all card variants */
[data-theme="dark"] .page-header,
[data-theme="dark"] .content-card,
[data-theme="dark"] .dashboard-panel,
[data-theme="dark"] .card,
[data-theme="dark"] .example-container,
[data-theme="dark"] .showcase-card,
[data-theme="dark"] .demo-container,
[data-theme="dark"] .section-card,
[data-theme="dark"] .example-box,
[data-theme="dark"] .showcase-box,
[data-theme="dark"] .sample-card,
[data-theme="dark"] .preview-card,
[data-theme="dark"] .display-card {
    background: linear-gradient(135deg, rgba(110, 123, 255, 0.08), rgba(168, 85, 247, 0.08)) !important;
    border-color: rgba(110, 123, 255, 0.3) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

[data-theme="dark"] .page-header h1,
[data-theme="dark"] .page-header h2,
[data-theme="dark"] .content-card h3,
[data-theme="dark"] .content-card h4,
[data-theme="dark"] .dashboard-panel h4,
[data-theme="dark"] .card h3,
[data-theme="dark"] .card h4,
[data-theme="dark"] .example-container h3,
[data-theme="dark"] .showcase-card h3,
[data-theme="dark"] .demo-container h3,
[data-theme="dark"] .section-card h3,
[data-theme="dark"] .example-box h3,
[data-theme="dark"] .showcase-box h3,
[data-theme="dark"] .sample-card h3,
[data-theme="dark"] .preview-card h3,
[data-theme="dark"] .display-card h3 {
    color: #8B96FF !important;
}

[data-theme="dark"] .page-header p,
[data-theme="dark"] .content-card p,
[data-theme="dark"] .dashboard-panel p,
[data-theme="dark"] .card p,
[data-theme="dark"] .example-container p,
[data-theme="dark"] .showcase-card p,
[data-theme="dark"] .demo-container p,
[data-theme="dark"] .section-card p,
[data-theme="dark"] .example-box p,
[data-theme="dark"] .showcase-box p,
[data-theme="dark"] .sample-card p,
[data-theme="dark"] .preview-card p,
[data-theme="dark"] .display-card p {
    color: var(--rsl-dark-text-secondary) !important;
}

[data-theme="dark"] .demo-section h3 {
    color: var(--rsl-dark-text-secondary) !important;
}

/* Breadcrumb positioning fix - override inline margin-top */
.container > nav[aria-label="breadcrumb"],
div.container[style*="margin-top"] > nav[aria-label="breadcrumb"],
div.container[style*="margin-top: 80px"] {
    margin-top: 0 !important;
}

/* Breadcrumb container spacing */
.container:has(> nav[aria-label="breadcrumb"]) {
    margin-top: 80px !important;
    padding-top: 1rem;
    padding-bottom: 0.5rem;
}

/* Breadcrumb styling */
.rsl-breadcrumb {
    font-size: 0.875rem;
    opacity: 0.85;
    flex-wrap: nowrap !important;
}

.rsl-breadcrumb li {
    margin-right: 0.25rem;
    white-space: nowrap !important;
}

/* Light mode breadcrumbs (for hero sections with gradient backgrounds) */
.rsl-hero .rsl-breadcrumb a {
    color: white !important;
}

.rsl-hero .rsl-breadcrumb a:hover {
    color: rgba(255, 255, 255, 0.8) !important;
}

.rsl-hero .rsl-breadcrumb li[aria-current="page"] {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Dark mode for breadcrumbs */
[data-theme="dark"] .rsl-breadcrumb a {
    color: #8B96FF !important;
}

[data-theme="dark"] .rsl-breadcrumb a:hover {
    color: #6E7BFF !important;
}

[data-theme="dark"] .rsl-breadcrumb li:not(:last-child):after {
    color: rgba(255, 255, 255, 0.4) !important;
}

[data-theme="dark"] .rsl-breadcrumb li[aria-current="page"] {
    color: var(--rsl-dark-text-secondary) !important;
}

/* Print Styles - Remove Dark Mode */
@media print {
    [data-theme="dark"] body {
        background: white;
        color: black;
    }

    .rsl-theme-toggle {
        display: none;
    }
}
