/* Tutorial Variables */
:root {
    --primary-glow: rgba(124, 58, 237, 0.4);
    --shadow-glow: 0 0 20px rgba(124, 58, 237, 0.15);
}

/* Tutorial Overlay Base */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999997;
    pointer-events: none;
    /* Allow clicks to pass through initially */
    opacity: 0;
    transition: opacity 0.5s ease;
    display: none;
    /* Hidden by default */
}

.tutorial-overlay.active {
    display: block !important;
    opacity: 1 !important;
    pointer-events: auto;
    z-index: 2147483647 !important;
    /* Max Z-Index */
}

/* Dimmer for Modal Steps (Full screen) */
.tutorial-overlay.modal-step {
    background: rgba(0, 0, 0, 0.75);
    pointer-events: auto;
}

/* Highlight Ring */
.tutorial-highlight {
    position: absolute;
    border-radius: var(--radius-lg, 8px);
    /* The huge shadow creates the dimmer effect. using black with opacity for dimmer */
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.75), 0 0 30px var(--primary-glow);
    z-index: 999998;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid var(--primary);
}

/* Tooltip / Modal Card */
.tutorial-card {
    position: absolute;
    background: var(--surface);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 320px;
    max-width: 90vw;
    z-index: 999999;
    box-shadow: var(--shadow-glow), 0 10px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    font-family: var(--font-main);
    color: var(--text);
}

/* Angel Theme Specifics for Card (Glassmorphism) */
[data-theme="angel"] .tutorial-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.tutorial-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Step Content */
.tutorial-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.tutorial-step-indicator {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tutorial-title {
    font-family: var(--font-title);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary-glow);
}

[data-theme="angel"] .tutorial-title {
    text-shadow: none;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tutorial-description {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
    color: var(--text);
    /* Use main text color for better readability or var(--text-light) */
    opacity: 0.9;
}

/* Buttons */
.tutorial-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tutorial-btn {
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tutorial-btn-primary {
    background: rgba(var(--primary), 0.1);
    /* Fallback if not RGB */
    background: var(--primary-glow);
    /* Use glow var which is usually rgba */
    color: var(--primary);
    border-color: var(--primary);
}

/* Specific button styles to match app buttons exactly if needed, but variables usually suffice */
.tutorial-btn-primary:hover {
    box-shadow: 0 0 15px var(--primary-glow);
    background: var(--primary);
    color: #000;
    /* Contrast text on hover for evil? Angel might be white */
}

/* Evil hover adjustment */
[data-theme="evil"] .tutorial-btn-primary:hover {
    color: #000;
    background: var(--primary);
}

/* Angel hover adjustment */
[data-theme="angel"] .tutorial-btn-primary:hover {
    color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.tutorial-btn-secondary {
    color: var(--text-muted);
}

.tutorial-btn-secondary:hover {
    color: var(--text);
}

/* Center Modal Style for Welcome/Completion */
.tutorial-card.center-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 400px;
    text-align: center;
}

.tutorial-card.center-modal.visible {
    transform: translate(-50%, -50%) scale(1);
}

.tutorial-card.center-modal .tutorial-actions {
    justify-content: center;
    gap: 16px;
}