/**
 * 3Syxty Studio — Onboarding Components
 *
 * Contextual coach marks, step-by-step guided tours,
 * progressive disclosure toggle, and welcome screen styles.
 */

/* -----------------------------------------------------------------------
   Coach Mark (Contextual Tooltip)
   ----------------------------------------------------------------------- */

.coach-mark {
    position: absolute;
    z-index: var(--z-overlay);
    max-width: 320px;
    animation: coach-mark-appear var(--motion-normal) forwards;
}

@keyframes coach-mark-appear {
    from { opacity: 0; transform: translateY(8px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.coach-mark-card {
    background-color: var(--surface-elevated);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-heavy), 0 0 0 4px var(--accent-primary-muted);
    overflow: hidden;
}

.coach-mark-body {
    padding: var(--space-4) var(--space-5);
}

.coach-mark-title {
    font: var(--type-body);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-1-5);
}

.coach-mark-desc {
    font: var(--type-body-sm);
    color: var(--text-secondary);
    line-height: 1.5;
}

.coach-mark-image {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-bottom: 1px solid var(--border-subtle);
}

.coach-mark-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-5);
    border-top: 1px solid var(--border-subtle);
}

.coach-mark-steps {
    display: flex;
    gap: var(--space-1);
}

.coach-mark-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--border-default);
    transition: background-color var(--motion-fast), transform var(--motion-fast);
}

.coach-mark-dot[data-active="true"] {
    background-color: var(--accent-primary);
    transform: scale(1.3);
}

.coach-mark-dot[data-complete="true"] {
    background-color: var(--accent-primary);
}

.coach-mark-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* Coach Mark Arrow */
.coach-mark-arrow {
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: var(--surface-elevated);
    border: 1px solid var(--accent-primary);
    transform: rotate(45deg);
}

.coach-mark[data-position="bottom"] .coach-mark-arrow {
    top: -7px;
    left: 24px;
    border-bottom: none;
    border-right: none;
}

.coach-mark[data-position="top"] .coach-mark-arrow {
    bottom: -7px;
    left: 24px;
    border-top: none;
    border-left: none;
}

.coach-mark[data-position="left"] .coach-mark-arrow {
    right: -7px;
    top: 16px;
    border-left: none;
    border-bottom: none;
}

.coach-mark[data-position="right"] .coach-mark-arrow {
    left: -7px;
    top: 16px;
    border-right: none;
    border-top: none;
}

/* Spotlight overlay (highlights the target element) */
.coach-mark-spotlight {
    position: fixed;
    inset: 0;
    z-index: calc(var(--z-overlay) - 1);
    pointer-events: none;
}

.coach-mark-spotlight::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    mask-image: radial-gradient(circle at var(--spotlight-x, 50%) var(--spotlight-y, 50%), transparent var(--spotlight-r, 40px), black calc(var(--spotlight-r, 40px) + 8px));
    -webkit-mask-image: radial-gradient(circle at var(--spotlight-x, 50%) var(--spotlight-y, 50%), transparent var(--spotlight-r, 40px), black calc(var(--spotlight-r, 40px) + 8px));
}

/* Dismiss link */
.coach-mark-dismiss {
    font: var(--type-caption);
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color var(--motion-instant);
}

.coach-mark-dismiss:hover {
    color: var(--text-primary);
}

/* -----------------------------------------------------------------------
   Progressive Disclosure Toggle
   ----------------------------------------------------------------------- */

.mode-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1-5) var(--space-3);
    background-color: var(--surface-tertiary);
    border-radius: var(--radius-full);
    font: var(--type-caption);
    font-weight: 500;
}

.mode-toggle-option {
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    color: var(--text-muted);
    cursor: pointer;
    transition: background-color var(--motion-fast),
                color var(--motion-fast),
                box-shadow var(--motion-fast);
    border: none;
    background: none;
}

.mode-toggle-option:hover {
    color: var(--text-secondary);
}

.mode-toggle-option[aria-pressed="true"],
.mode-toggle-option.mode-toggle-active {
    background-color: var(--surface-elevated);
    color: var(--text-primary);
    box-shadow: var(--shadow-subtle);
}

/* -----------------------------------------------------------------------
   Welcome Screen
   ----------------------------------------------------------------------- */

.welcome-screen {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Cinematic background gradient */
.welcome-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(108, 92, 231, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(232, 168, 56, 0.08) 0%, transparent 50%),
        var(--surface-primary);
}

.welcome-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-8);
}

.welcome-logo-mark {
    width: 56px;
    height: 56px;
    background: var(--accent-gradient);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
}

.welcome-logo-mark span {
    font-size: 22px;
    font-weight: 800;
    color: #FFFFFF;
}

.welcome-logo-text {
    font: var(--type-display);
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.welcome-subtitle {
    font: var(--type-h2);
    color: var(--text-secondary);
    max-width: 480px;
    margin-bottom: var(--space-10);
}

/* Three-path choice cards */
.welcome-paths {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-4);
    max-width: 820px;
    width: 100%;
    margin-bottom: var(--space-8);
}

.welcome-path-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-8) var(--space-6);
    background-color: var(--surface-secondary);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: border-color var(--motion-fast),
                background-color var(--motion-fast),
                box-shadow var(--motion-fast),
                transform 120ms ease-out;
    text-decoration: none;
}

.welcome-path-card:hover {
    border-color: var(--accent-primary);
    background-color: var(--accent-primary-subtle);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.welcome-path-card:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

.welcome-path-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--accent-primary-subtle);
    color: var(--accent-primary);
    transition: background-color var(--motion-fast);
}

.welcome-path-card:hover .welcome-path-icon {
    background-color: var(--accent-primary-muted);
}

.welcome-path-icon svg {
    width: 26px;
    height: 26px;
}

.welcome-path-title {
    font: var(--type-h3);
    color: var(--text-primary);
}

.welcome-path-desc {
    font: var(--type-body-sm);
    color: var(--text-muted);
    max-width: 200px;
}

/* Skip / explore link */
.welcome-skip {
    font: var(--type-body-sm);
    color: var(--text-muted);
    transition: color var(--motion-instant);
}

.welcome-skip:hover {
    color: var(--text-primary);
}

/* -----------------------------------------------------------------------
   Getting Started Checklist
   ----------------------------------------------------------------------- */

.checklist {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    transition: background-color var(--motion-instant);
    cursor: pointer;
}

.checklist-item:hover {
    background-color: var(--accent-primary-subtle);
}

.checklist-check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
    transition: background-color var(--motion-fast),
                border-color var(--motion-fast);
}

.checklist-item[data-complete="true"] .checklist-check {
    background-color: var(--success);
    border-color: var(--success);
}

.checklist-check svg {
    width: 12px;
    height: 12px;
    color: #FFFFFF;
    opacity: 0;
    transition: opacity var(--motion-fast);
}

.checklist-item[data-complete="true"] .checklist-check svg {
    opacity: 1;
}

.checklist-content {
    flex: 1;
}

.checklist-title {
    font: var(--type-body);
    font-weight: 500;
    color: var(--text-primary);
}

.checklist-item[data-complete="true"] .checklist-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.checklist-desc {
    font: var(--type-body-sm);
    color: var(--text-muted);
    margin-top: 2px;
}

/* Checklist progress header */
.checklist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3);
}

.checklist-header-title {
    font: var(--type-h3);
    color: var(--text-primary);
}

.checklist-header-count {
    font: var(--type-caption);
    color: var(--text-muted);
}
