/* ============== Tutorial Overlay ============== */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.tutorial-overlay.hidden {
    display: none;
}

.tutorial-overlay.fade-out {
    opacity: 0;
}

/* ============== Tutorial Container ============== */
.tutorial-container {
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* ============== Slide Area ============== */
.tutorial-slides {
    position: relative;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    min-height: 500px;
}

.tutorial-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 48px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
    overflow-y: auto;
}

.tutorial-slide.active {
    position: relative;
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.tutorial-slide.exit-left {
    transform: translateX(-30px);
    opacity: 0;
}

/* ============== Slide Content ============== */
.slide-header {
    margin-bottom: 24px;
}

.slide-step {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary);
    margin-bottom: 8px;
}

.slide-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}

.slide-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Slide 2 (Values Introduction) - tighter spacing */
.tutorial-slide[data-slide="1"] .slide-body {
    gap: 0;
}

.slide-text {
    font-size: 18px;
    line-height: 1.7;
    color: var(--text-primary);
    max-width: 700px;
}

.slide-text strong {
    color: var(--emphasis);
    font-weight: 600;
}

.slide-text.slide-instruction {
    text-decoration: underline;
    font-style: italic;
}

/* ============== Diagram Placeholders ============== */
.slide-diagram {
    flex: 1;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    position: relative;
}

.slide-diagram.no-border {
    background: transparent;
    border: none;
}

.diagram-placeholder {
    text-align: center;
    color: var(--text-secondary);
    padding: 32px;
}

.diagram-placeholder-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.diagram-placeholder-text {
    font-size: 14px;
}

/* ============== Interactive Chart Container ============== */
.tutorial-chart-container {
    width: 100%;
    height: 300px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#tutorialChart {
    width: 100%;
    height: 100%;
}

.tutorial-chart-hint {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-primary);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    z-index: 10;
}

.tutorial-chart-hint::before {
    content: "";
}

/* Tutorial value tooltip (hover) */
.tutorial-value-tooltip {
    position: fixed;
    max-width: 320px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-lg);
    z-index: 3000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.tutorial-value-tooltip.visible {
    opacity: 1;
}

.tutorial-value-tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.tutorial-value-tooltip-name {
    font-weight: 700;
    font-size: 15px;
}

.tutorial-value-tooltip-rating {
    font-weight: 600;
    font-size: 14px;
    color: var(--primary);
}

.tutorial-value-tooltip-desc {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.tutorial-value-tooltip-scale {
    font-size: 12px;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.tutorial-value-tooltip-scale-title {
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.tutorial-value-tooltip-scale-row {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}

.tutorial-value-tooltip-scale-row:last-child {
    margin-bottom: 0;
}

.tutorial-value-tooltip-scale-label {
    font-weight: 600;
    min-width: 35px;
}

.tutorial-value-tooltip-scale-text {
    color: var(--text-secondary);
}

/* ============== Sample Conversation Preview ============== */
.tutorial-conversation-preview {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 20px;
    max-height: 350px;
    overflow: hidden;
}

.tutorial-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding-right: 8px;
}

.tutorial-message {
    padding: 10px 14px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    font-size: 13px;
    line-height: 1.5;
}

.tutorial-message.target {
    background: rgba(40, 167, 69, 0.1);
    border-left: 3px solid var(--success);
}

.tutorial-message-author {
    font-weight: 600;
    font-size: 12px;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.tutorial-message.target .tutorial-message-author {
    color: var(--success);
}

.tutorial-values-preview {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 16px;
    overflow-y: auto;
}

.tutorial-values-preview h4 {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tutorial-value-item {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.tutorial-value-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.tutorial-value-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.tutorial-value-name {
    font-weight: 600;
    font-size: 12px;
}

.tutorial-value-rating {
    font-weight: 700;
    font-size: 13px;
    color: var(--primary);
}

.tutorial-value-analysis {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ============== Benevolence Highlight ============== */
.benevolence-scale {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 24px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.scale-bar-container {
    width: 100%;
    position: relative;
}

.scale-bar {
    height: 28px;
    background: linear-gradient(90deg,
        var(--bg-tertiary) 0%,
        #DB7093 100%
    );
    border-radius: 14px;
    position: relative;
    margin-bottom: 8px;
}

.scale-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    padding: 0 4px;
    margin-bottom: 0;
}

.scale-markers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 12px;
    align-items: center;
}

.scale-marker {
    width: 3px;
    height: 14px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
}

/* Dots on scale bar for each example */
.scale-dots {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.scale-dot {
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--bg-primary);
    border: 3px solid currentColor;
    border-radius: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.scale-dot.boss { color: #6366f1; }
.scale-dot.family { color: #22c55e; }
.scale-dot.friends { color: #f59e0b; }

/* Connecting lines container */
.scale-connectors {
    position: relative;
    width: 100%;
    height: 60px;
}

.scale-connector {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background: currentColor;
    opacity: 0.4;
}

.scale-connector.boss { color: #6366f1; }
.scale-connector.family { color: #22c55e; }
.scale-connector.friends { color: #f59e0b; }

.scale-examples {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
}

.scale-example {
    text-align: center;
    padding: 14px 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    position: relative;
}

.scale-example.boss { border-color: #6366f1; }
.scale-example.family { border-color: #22c55e; }
.scale-example.friends { border-color: #f59e0b; }

.scale-example-icon {
    font-size: 28px;
    margin-bottom: 6px;
}

.scale-example-label {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
}

.scale-example-value {
    font-size: 14px;
    font-weight: 700;
}

.scale-example.boss .scale-example-value { color: #6366f1; }
.scale-example.family .scale-example-value { color: #22c55e; }
.scale-example.friends .scale-example-value { color: #f59e0b; }

/* Ellipsis for more values */
.tutorial-values-ellipsis {
    text-align: center;
    padding: 8px;
    color: var(--text-secondary);
    font-size: 18px;
    letter-spacing: 4px;
}

/* Screenshot image for slide 5 */
.slide-screenshot {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

/* ============== Navigation ============== */
.tutorial-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.tutorial-nav-btn {
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.tutorial-nav-btn.prev {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.tutorial-nav-btn.prev:hover:not(:disabled) {
    background: var(--bg-tertiary);
}

.tutorial-nav-btn.prev:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.tutorial-nav-btn.next {
    background: var(--primary);
    color: white;
    border: 2px solid var(--primary);
}

.tutorial-nav-btn.next:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.tutorial-nav-btn.finish {
    background: var(--success);
    border-color: var(--success);
}

.tutorial-nav-btn.finish:hover {
    background: #218838;
    border-color: #218838;
}

/* ============== Progress Dots ============== */
.tutorial-progress {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.progress-dot:hover {
    background: var(--text-secondary);
}

.progress-dot.active {
    background: var(--primary);
    transform: scale(1.2);
}

.progress-dot.completed {
    background: var(--primary);
    opacity: 0.5;
}

/* ============== Skip Button ============== */
.tutorial-skip {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 2001;
}

.tutorial-skip:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* ============== Responsive ============== */
@media (max-width: 768px) {
    .tutorial-slide {
        padding: 24px;
    }

    .slide-title {
        font-size: 22px;
    }

    .slide-text {
        font-size: 16px;
    }

    .tutorial-conversation-preview {
        grid-template-columns: 1fr;
    }

    .tutorial-values-preview {
        max-height: 150px;
    }

    .scale-examples {
        grid-template-columns: 1fr;
    }

    .tutorial-nav-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* ============== Dark Mode ============== */
[data-theme="dark"] .tutorial-skip {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .scale-bar {
    background: linear-gradient(90deg,
        var(--bg-tertiary) 0%,
        #DB7093 100%
    );
}

[data-theme="dark"] .scale-marker {
    background: rgba(0, 0, 0, 0.3);
}
