/* ==========================
   TUTORIAL.CSS — Interactive Tutorial
   Investing Simulator
========================== */

/* ---- TUTORIAL MODAL ---- */
.tutorial-modal-inner {
    width: 100%;
    max-width: 820px;
    max-height: 90vh;
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: 18px;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(0, 212, 255, 0.08), transparent 180px),
        rgba(10, 17, 32, 0.88);
    border-color: rgba(0, 212, 255, 0.22);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45), 0 0 34px rgba(0, 212, 255, 0.14);
    animation: modal-in 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- HEADER ---- */
.tut-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-shrink: 0;
}

.tut-logo {
    font-size: 2rem;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.16), rgba(0, 255, 159, 0.08));
    border: 1px solid rgba(0, 212, 255, 0.28);
    border-radius: var(--radius-lg);
    box-shadow: inset 0 0 20px rgba(0, 212, 255, 0.08), 0 0 18px rgba(0, 212, 255, 0.12);
}

.tut-title {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.tut-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.05em;
    margin: 0;
}

/* Keep close button pushed to the right */
.tut-header .modal-close {
    margin-left: auto;
}

/* ---- PROGRESS BAR ---- */
.tut-progress-bar {
    height: 4px;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}

.tut-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-green));
    border-radius: 3px;
    transition: width 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
    width: 12.5%;
    /* 1/8 */
}

.tut-step-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: right;
    flex-shrink: 0;
    margin-top: -8px;
}

/* ---- STEPS CONTAINER ---- */
.tut-steps {
    flex: 1;
    overflow-y: auto;
    position: relative;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 212, 255, 0.45) transparent;
}

.tut-steps::-webkit-scrollbar {
    width: 6px;
}

.tut-steps::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.35);
    border-radius: var(--radius-pill);
}

.tut-step {
    display: none;
    flex-direction: column;
    gap: 18px;
    animation: fadeInUp 0.4s ease;
}

.tut-step.active {
    display: flex;
}

.tut-step-icon {
    font-size: 3rem;
    text-align: center;
    filter: drop-shadow(0 0 14px rgba(0, 212, 255, 0.24));
}

.tut-step h3 {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--text-primary);
    text-align: center;
    margin-top: -6px;
}

.tut-step p {
    font-size: 0.98rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* ---- HIGHLIGHT ---- */
.tut-highlight {
    color: var(--neon-blue);
    font-weight: 700;
}

/* ---- TIP BOX ---- */
.tut-tip {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.08), rgba(0, 255, 159, 0.03));
    border: 1px solid rgba(0, 212, 255, 0.18);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.tut-tip-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ---- TABLE ---- */
.tut-table {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: rgba(6, 11, 18, 0.45);
}

.tut-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--space-sm);
    padding: 10px var(--space-md);
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.tut-row:last-child {
    border-bottom: none;
}

.tut-row.header {
    background: rgba(0, 212, 255, 0.1);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
}

.tut-bold {
    font-weight: 700;
}

/* ---- HUD DEMO ---- */
.tut-hud-demo {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
}

.tut-hud-item {
    background: rgba(6, 11, 18, 0.72);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    min-height: 112px;
}

.tut-hud-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.tut-hud-value {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.16rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.tut-hud-item p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0;
}

/* ---- CATEGORIES LIST ---- */
.tut-categories {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.tut-cat {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    background: rgba(0, 212, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast);
}

.tut-cat:hover {
    border-color: var(--border-hover);
}

.tut-cat-icon {
    font-size: 1.5rem;
    min-width: 36px;
    text-align: center;
    margin-top: 2px;
    filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.18));
}

.tut-cat strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.tut-cat p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
}

/* ---- FLOW STEPS (Comprar/Vender) ---- */
.tut-steps-flow {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
    justify-content: center;
}

.tut-flow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    min-width: 118px;
    text-align: center;
    min-height: 94px;
    justify-content: center;
}

.tut-flow-num {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tut-flow-step p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.tut-flow-arrow {
    font-size: 1.2rem;
    color: var(--text-muted);
    flex-shrink: 0;
    opacity: 0.7;
}

/* ---- STRATEGIES ---- */
.tut-strategies {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.tut-strategy {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(0, 212, 255, 0.04);
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.tut-strategy:hover {
    border-color: var(--neon-green);
    background: rgba(0, 255, 159, 0.04);
}

.tut-str-icon {
    font-size: 1.6rem;
    min-width: 36px;
    text-align: center;
    margin-top: 2px;
}

.tut-strategy strong {
    display: block;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.tut-strategy p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
}

/* ---- FINAL CTA ---- */
.tut-final-cta {
    text-align: center;
    padding: var(--space-lg);
    font-size: 1.2rem;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: 0;
    background: rgba(0, 255, 159, 0.05);
    border: 1px solid rgba(0, 255, 159, 0.18);
    border-radius: var(--radius-md);
}

/* ---- NAVIGATION ---- */
.tut-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    flex-shrink: 0;
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
}

.tut-nav .btn-primary,
.tut-nav .btn-ghost {
    flex: 0 0 auto;
}

#tut-next {
    min-width: 142px;
}

.tut-dots {
    display: flex;
    gap: 7px;
    align-items: center;
}

.tut-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.tut-dot.active {
    background: var(--neon-blue);
    transform: scale(1.5);
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.8);
}

/* ---- MENU ACTIONS ---- */
.menu-actions {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    justify-content: center;
}

/* ---- HELP BUTTON (HUD) ---- */
.btn-help {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.25);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 1rem;
    cursor: pointer;
    color: var(--neon-blue);
    flex-shrink: 0;
    transition: background var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-help:hover {
    background: rgba(0, 212, 255, 0.18);
    box-shadow: 0 0 14px rgba(0, 212, 255, 0.4);
    transform: scale(1.1);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 640px) {
    .tutorial-modal-inner {
        padding: var(--space-md);
        max-height: 95vh;
        border-radius: var(--radius-lg);
    }

    .tut-header {
        gap: var(--space-sm);
    }

    .tut-logo {
        width: 46px;
        height: 46px;
        font-size: 1.65rem;
        border-radius: var(--radius-md);
    }

    .tut-title {
        font-size: 1.2rem;
    }

    .tut-step h3 {
        font-size: 1.28rem;
    }

    .tut-step p {
        font-size: 0.9rem;
    }

    .tut-hud-demo {
        grid-template-columns: 1fr;
    }

    .tut-steps-flow {
        flex-direction: column;
    }

    .tut-flow-arrow {
        transform: rotate(90deg);
    }

    .tut-row {
        grid-template-columns: 1fr;
        font-size: 0.78rem;
        gap: 4px;
    }

    .tut-row .text-gain,
    .tut-row .text-loss {
        font-size: 0.75rem;
    }

    .tut-nav {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: var(--space-sm);
        align-items: center;
        width: 100%;
        overflow: visible;
    }

    .tut-dots {
        grid-column: 1 / -1;
        grid-row: 1;
        gap: 5px;
        justify-content: center;
        min-width: 0;
        margin-bottom: 2px;
    }

    .tut-dot {
        width: 6px;
        height: 6px;
    }

    .tut-nav .btn-primary,
    .tut-nav .btn-ghost {
        padding: 10px 14px;
        font-size: 0.86rem;
        min-height: 38px;
        width: 100%;
    }

    #tut-prev {
        grid-column: 1;
        grid-row: 2;
        min-width: 82px;
    }

    #tut-next {
        grid-column: 2;
        grid-row: 2;
        min-width: 0;
        white-space: nowrap;
    }
}

@media (max-width: 380px) {
    .tut-nav .btn-primary,
    .tut-nav .btn-ghost {
        padding: 9px 10px;
        font-size: 0.82rem;
    }
}
