/**
 * WolfinityTrader Tutorial Styles
 * Interactive User Onboarding
 */

/* Overlay */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(1px);
    pointer-events: none; /* Erlaube Klicks durch Overlay hindurch */
}

.tutorial-overlay.active {
    opacity: 1;
}

/* Modal */
.tutorial-modal {
    position: fixed;
    background: var(--bs-body-bg, #ffffff);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: auto; /* Modal ist klickbar */
}

.tutorial-modal.active {
    opacity: 1;
    transform: scale(1);
}

/* Dark Mode Support */
[data-theme="dark"] .tutorial-modal {
    background: #1a1a1a;
    color: #e0e0e0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
}

/* Header */
.tutorial-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
}

[data-theme="dark"] .tutorial-header {
    border-bottom-color: #333;
}

.tutorial-step-counter {
    font-size: 14px;
    font-weight: 600;
    color: var(--bs-primary, #0d6efd);
    background: var(--bs-primary-bg-subtle, #e7f1ff);
    padding: 4px 12px;
    border-radius: 20px;
}

[data-theme="dark"] .tutorial-step-counter {
    background: rgba(13, 110, 253, 0.2);
    color: #6ea8fe;
}

.tutorial-close {
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: var(--bs-secondary, #6c757d);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
}

.tutorial-close:hover {
    background: var(--bs-secondary-bg, #e2e3e5);
    color: var(--bs-dark, #212529);
}

[data-theme="dark"] .tutorial-close:hover {
    background: #333;
    color: #fff;
}

/* Body */
.tutorial-body {
    padding: 24px;
}

.tutorial-body h3 {
    margin: 0 0 12px 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--bs-dark, #212529);
}

[data-theme="dark"] .tutorial-body h3 {
    color: #fff;
}

.tutorial-description {
    margin: 0 0 20px 0;
    font-size: 16px;
    color: var(--bs-secondary, #6c757d);
}

.tutorial-content {
    font-size: 15px;
    line-height: 1.6;
}

.tutorial-content ul {
    margin: 12px 0;
    padding-left: 20px;
}

.tutorial-content li {
    margin: 8px 0;
}

.tutorial-content strong {
    font-weight: 600;
    color: var(--bs-dark, #212529);
}

[data-theme="dark"] .tutorial-content strong {
    color: #fff;
}

.tutorial-content hr {
    margin: 20px 0;
    border: none;
    border-top: 1px solid var(--bs-border-color, #dee2e6);
}

[data-theme="dark"] .tutorial-content hr {
    border-top-color: #333;
}

/* Footer */
.tutorial-footer {
    padding: 0 24px 24px 24px;
}

.tutorial-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bs-secondary-bg, #e2e3e5);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 16px;
}

[data-theme="dark"] .tutorial-progress-bar {
    background: #333;
}

.tutorial-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--bs-primary, #0d6efd), var(--bs-info, #0dcaf0));
    transition: width 0.3s ease;
    border-radius: 3px;
}

.tutorial-buttons {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.tutorial-buttons button {
    flex: 1;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
}

/* Highlight Target Element */
.tutorial-highlight {
    outline: 4px solid var(--bs-primary, #0d6efd);
    outline-offset: 6px;
    border-radius: 8px;
    background: var(--bs-body-bg, #fff) !important;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.3),
                0 0 40px 10px rgba(13, 110, 253, 0.5),
                0 0 0 9999px rgba(0, 0, 0, 0.4);
    animation: tutorial-pulse 2s infinite;
    pointer-events: auto; /* Element bleibt klickbar */
}

[data-theme="dark"] .tutorial-highlight {
    background: #1a1a1a !important;
    box-shadow: 0 0 0 4px rgba(110, 168, 254, 0.3),
                0 0 40px 10px rgba(110, 168, 254, 0.5),
                0 0 0 9999px rgba(0, 0, 0, 0.4);
}

@keyframes tutorial-pulse {
    0%, 100% {
        outline-color: var(--bs-primary, #0d6efd);
        outline-width: 4px;
    }
    50% {
        outline-color: var(--bs-info, #0dcaf0);
        outline-width: 5px;
    }
}

/* Celebration */
.tutorial-celebration {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: var(--bs-body-bg, #ffffff);
    padding: 40px 60px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    text-align: center;
}

.tutorial-celebration.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

[data-theme="dark"] .tutorial-celebration {
    background: #1a1a1a;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.celebration-content h2 {
    font-size: 36px;
    margin: 0 0 16px 0;
    color: var(--bs-success, #198754);
}

.celebration-content p {
    font-size: 18px;
    margin: 8px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .tutorial-modal {
        width: 95%;
        max-height: 90vh;
    }

    .tutorial-body h3 {
        font-size: 20px;
    }

    .tutorial-content {
        font-size: 14px;
    }

    .tutorial-buttons {
        flex-direction: column;
    }

    .tutorial-buttons button {
        width: 100%;
    }

    .tutorial-celebration {
        padding: 30px 40px;
        width: 90%;
    }

    .celebration-content h2 {
        font-size: 28px;
    }

    .celebration-content p {
        font-size: 16px;
    }
}

/* Scrollbar for modal */
.tutorial-modal::-webkit-scrollbar {
    width: 8px;
}

.tutorial-modal::-webkit-scrollbar-track {
    background: var(--bs-secondary-bg, #e2e3e5);
    border-radius: 4px;
}

.tutorial-modal::-webkit-scrollbar-thumb {
    background: var(--bs-secondary, #6c757d);
    border-radius: 4px;
}

.tutorial-modal::-webkit-scrollbar-thumb:hover {
    background: var(--bs-dark, #212529);
}

[data-theme="dark"] .tutorial-modal::-webkit-scrollbar-track {
    background: #222;
}

[data-theme="dark"] .tutorial-modal::-webkit-scrollbar-thumb {
    background: #555;
}

[data-theme="dark"] .tutorial-modal::-webkit-scrollbar-thumb:hover {
    background: #777;
}
