/**
 * Artemis Superior Dark Mode Enhancement
 * Version: 1.0.0
 *
 * Enterprise-Level Dark Mode with WCAG AAA Compliance
 * - Minimum contrast ratio: 7:1 for normal text
 * - Minimum contrast ratio: 4.5:1 for large text
 * - Enhanced readability for tutorial overlays
 * - Elegant glassmorphism effects
 */

/* ============================================
   TUTORIAL OVERLAY - ENHANCED DARK MODE
   ============================================ */

/* Improved backdrop for better contrast */
.tutorial-overlay {
    background: rgba(0, 0, 0, 0) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Enhanced spotlight effect */
.tutorial-spotlight {
    border: 3px solid #A08DD6 !important;
    box-shadow:
        0 0 0 9999px rgba(0, 0, 0, 0),
        0 0 40px rgba(129, 140, 248, 0.8),
        inset 0 0 40px rgba(129, 140, 248, 0.3) !important;
    background: transparent !important;
    z-index: 9999 !important;
}

/* Tutorial card with enhanced contrast */
.tutorial-card {
    background: linear-gradient(
        135deg,
        rgba(30, 41, 59, 0.98),
        rgba(15, 23, 42, 0.98)
    ) !important;
    border: 2px solid rgba(129, 140, 248, 0.5) !important;
    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.9),
        0 0 50px rgba(129, 140, 248, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

/* Tutorial header with glassmorphism */
.tutorial-header {
    background: linear-gradient(
        90deg,
        rgba(129, 140, 248, 0.15),
        transparent
    ) !important;
    border-bottom: 2px solid rgba(129, 140, 248, 0.3) !important;
}

/* Step indicator - High contrast */
.tutorial-current-step {
    color: #CBE8F6 !important; /* Lighter primary for better contrast */
    font-weight: 800 !important;
    text-shadow: 0 0 20px rgba(165, 180, 252, 0.5);
}

.tutorial-separator {
    color: #94a3b8 !important; /* Slate-400 - High contrast */
}

.tutorial-total-steps {
    color: #cbd5e1 !important; /* Slate-300 - High contrast */
}

/* Close button - Enhanced visibility */
.tutorial-close {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #fca5a5 !important; /* Lighter red for better contrast */
    border: 2px solid rgba(239, 68, 68, 0.3) !important;
}

.tutorial-close:hover {
    background: #ef4444 !important;
    color: #ffffff !important;
    border-color: #ef4444 !important;
}

/* Tutorial body - Maximum readability */
.tutorial-icon {
    filter: drop-shadow(0 0 20px rgba(129, 140, 248, 0.5));
}

.tutorial-title {
    color: #f1f5f9 !important; /* Slate-100 - Maximum contrast */
    font-weight: 700 !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.01em;
}

.tutorial-description {
    color: #e2e8f0 !important; /* Slate-200 - High contrast for body text */
    line-height: 1.8 !important;
    font-size: 15px !important;
    font-weight: 400 !important;
}

/* Tutorial footer */
.tutorial-footer {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(129, 140, 248, 0.08)
    ) !important;
    border-top: 2px solid rgba(129, 140, 248, 0.3) !important;
}

/* Button enhancements */
.btn-tutorial-secondary {
    background: rgba(51, 65, 85, 0.5) !important;
    border: 2px solid rgba(148, 163, 184, 0.4) !important;
    color: #e2e8f0 !important; /* High contrast text */
}

.btn-tutorial-secondary:hover {
    border-color: #CBE8F6 !important;
    color: #ffffff !important;
    background: rgba(129, 140, 248, 0.2) !important;
    box-shadow: 0 0 20px rgba(129, 140, 248, 0.3);
}

.btn-tutorial-back {
    background: rgba(51, 65, 85, 0.6) !important;
    border: 2px solid rgba(148, 163, 184, 0.4) !important;
    color: #e2e8f0 !important;
}

.btn-tutorial-back:hover:not(:disabled) {
    border-color: #A08DD6 !important;
    color: #ffffff !important;
    background: rgba(129, 140, 248, 0.2) !important;
    box-shadow: 0 0 20px rgba(129, 140, 248, 0.3);
}

.btn-tutorial-back:disabled {
    opacity: 0.3 !important;
    background: rgba(51, 65, 85, 0.3) !important;
    color: #64748b !important;
}

.btn-tutorial-next {
    background: linear-gradient(135deg, #A08DD6, #8E7CC3) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow:
        0 4px 14px rgba(99, 102, 241, 0.4),
        0 0 20px rgba(129, 140, 248, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    border: none !important;
}

.btn-tutorial-next:hover {
    background: linear-gradient(135deg, #CBE8F6, #A08DD6) !important;
    box-shadow:
        0 6px 20px rgba(99, 102, 241, 0.5),
        0 0 30px rgba(129, 140, 248, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-2px);
}

.btn-tutorial-next i {
    transition: transform 0.2s ease;
}

.btn-tutorial-next:hover i {
    transform: translateX(4px);
}

/* ============================================
   GENERAL DARK MODE ENHANCEMENTS
   ============================================ */

/* Form labels - Better contrast */
[data-theme="dark"] .form-group label,
[data-theme="dark"] .geo-form-section label {
    color: #e2e8f0 !important; /* Slate-200 */
    font-weight: 600 !important;
}

/* Input help text - Enhanced readability */
[data-theme="dark"] .input-help,
[data-theme="dark"] small {
    color: #cbd5e1 !important; /* Slate-300 */
}

/* Panel headers - High contrast */
[data-theme="dark"] .geo-panel-header h2 {
    color: #f1f5f9 !important; /* Slate-100 */
}

/* Zone count and stats - Better visibility */
[data-theme="dark"] .zone-count,
[data-theme="dark"] .stat-label {
    color: #cbd5e1 !important; /* Slate-300 */
}

/* Business type cards - Enhanced contrast */
[data-theme="dark"] .business-type-card,
[data-theme="dark"] .business-type-name {
    color: #e2e8f0 !important;
}

/* Search placeholder text */
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: #94a3b8 !important; /* Slate-400 */
    opacity: 1 !important;
}

/* Tooltips and hints */
[data-theme="dark"] .tooltip,
[data-theme="dark"] .hint {
    background: rgba(30, 41, 59, 0.95) !important;
    border: 2px solid rgba(129, 140, 248, 0.4) !important;
    color: #e2e8f0 !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

/* ============================================
   ACCESSIBILITY FEATURES
   ============================================ */

/* Focus states - High visibility */
[data-theme="dark"] *:focus-visible {
    outline: 3px solid #CBE8F6 !important;
    outline-offset: 2px !important;
}

/* Selection highlighting */
[data-theme="dark"] ::selection {
    background: rgba(129, 140, 248, 0.4) !important;
    color: #ffffff !important;
}

/* Skip to content for screen readers */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: #1e293b;
    color: #f1f5f9;
    padding: 8px;
    z-index: 100;
}

.skip-to-content:focus {
    top: 0;
}

/* ============================================
   RESPONSIVE DARK MODE
   ============================================ */

@media (max-width: 768px) {
    .tutorial-card {
        width: 95vw !important;
        bottom: 20px !important;
    }

    .tutorial-title {
        font-size: var(--font-size-lg) !important;
    }

    .tutorial-description {
        font-size: 14px !important;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    [data-theme="dark"] {
        background: white !important;
        color: black !important;
    }

    .tutorial-overlay {
        display: none !important;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .tutorial-card,
    .tutorial-spotlight,
    .tutorial-icon {
        animation: none !important;
        transition: none !important;
    }
}

/* ============================================
   HIGH CONTRAST MODE
   ============================================ */

@media (prefers-contrast: high) {
    [data-theme="dark"] .tutorial-title {
        color: #ffffff !important;
    }

    [data-theme="dark"] .tutorial-description {
        color: #ffffff !important;
    }

    [data-theme="dark"] .tutorial-card {
        border-width: 3px !important;
    }
}
