/**
 * Обучение по профилю — стили в духе Liquid Glass (светлая тема).
 * Подсказки с подсветкой элементов и стрелками.
 */

/* Только для светлой темы: если страница в тёмной теме, блок не показываем или оставляем светлый вид карточки */
body.dark-theme .profile-onboarding .profile-onboarding-card {
    background: rgba(255, 255, 255, 0.96);
    color: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.profile-onboarding {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.profile-onboarding--visible {
    opacity: 1;
    visibility: visible;
}

/* Оверлей не перехватывает клики — только дочерние элементы с pointer-events: auto. Тогда клик по «дырке» (подсвеченному пункту меню) доходит до страницы. */

/* Полный оверлей — только когда нет подсвечиваемого элемента (приветствие/конец) */
.profile-onboarding-backdrop {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    pointer-events: auto;
}

/* Рамка из 4 панелей: затемнение и blur только ВОКРУГ элемента, сам элемент не закрыт и не размыт */
.profile-onboarding-frame {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.profile-onboarding-frame[aria-hidden="true"] .profile-onboarding-frame-panel {
    display: none !important;
}

.profile-onboarding-frame-panel {
    display: none;
    position: absolute;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    pointer-events: auto;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

/* Завивающаяся линия от карточки к подсвечиваемому блоку */
.profile-onboarding-connector {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    display: none;
}

.profile-onboarding-connector path {
    stroke: rgba(37, 99, 235, 0.55);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 8 6;
    animation: profile-onboarding-connector-dash 0.6s linear infinite;
}

@keyframes profile-onboarding-connector-dash {
    to { stroke-dashoffset: -14; }
}

/* Подсветка элемента: только обводка. pointer-events: none — клики проходят к пункту меню под ней. */
.profile-onboarding-spot {
    position: absolute;
    box-sizing: border-box;
    border-radius: 16px;
    pointer-events: none !important;
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.35);
    transition: left 0.25s ease, top 0.25s ease, width 0.25s ease, height 0.25s ease;
}

/* Карточка подсказки — Liquid Glass; принимает клики (кнопки Далее/Пропустить). */
.profile-onboarding-card {
    position: absolute;
    z-index: 2;
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(31, 38, 135, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.15) inset;
    color: #0f172a;
    max-width: min(420px, 92vw);
    transition: left 0.25s ease, top 0.25s ease, transform 0.25s ease;
}

.profile-onboarding-body {
    padding: 20px 24px 24px;
}

.profile-onboarding-badge {
    display: inline-block;
    margin-bottom: 10px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(37, 99, 235, 0.08));
    color: var(--primary-color, #2563eb);
    border: 1px solid rgba(37, 99, 235, 0.25);
}

.profile-onboarding-progress-wrap {
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.3);
    margin-bottom: 12px;
    overflow: hidden;
}

.profile-onboarding-progress-bar {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--primary-color, #2563eb), var(--primary-light, #3b82f6));
    width: 0%;
    transition: width 0.35s ease;
}

.profile-onboarding-title {
    margin: 0 0 10px;
    font-size: 1.15rem;
    font-weight: 700;
    font-family: 'Montserrat', 'Roboto', sans-serif;
    color: #0f172a;
    line-height: 1.3;
}

.profile-onboarding-text {
    margin: 0 0 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #475569;
}

/* Прогресс: счётчик и точки */
.profile-onboarding-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.profile-onboarding-step-counter {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted, #64748b);
}

.profile-onboarding-progress-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 100%;
}

.profile-onboarding-progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: background 0.2s ease, transform 0.2s ease;
}

.profile-onboarding-progress-dot--active {
    background: var(--primary-color, #2563eb);
    transform: scale(1.2);
}

/* Кнопки */
.profile-onboarding-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.profile-onboarding-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-onboarding-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
}

.profile-onboarding-btn--skip {
    background: transparent;
    color: #64748b;
}

.profile-onboarding-btn--skip:hover {
    color: #0f172a;
}

.profile-onboarding-btn--secondary {
    background: rgba(255, 255, 255, 0.35);
    color: #334155;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.profile-onboarding-btn--secondary:hover {
    background: rgba(255, 255, 255, 0.5);
    color: #0f172a;
}

.profile-onboarding-btn--primary {
    background: var(--primary-color, #2563eb);
    color: #fff;
}

.profile-onboarding-btn--primary:hover {
    background: var(--primary-dark, #1d4ed8);
    color: #fff;
}

.profile-onboarding-btn--goto {
    background: rgba(255, 255, 255, 0.5);
    color: var(--primary-color, #2563eb);
    border: 2px solid var(--primary-color, #2563eb);
}

.profile-onboarding-btn--goto:hover {
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary-dark, #1d4ed8);
}

/* Стрелка к элементу */
.profile-onboarding-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border: 12px solid transparent;
    pointer-events: none;
}

.profile-onboarding-arrow--top {
    border-top-color: rgba(255, 255, 255, 0.95);
    border-bottom: none;
    filter: drop-shadow(0 -2px 4px rgba(31, 38, 135, 0.08));
}

.profile-onboarding-arrow--bottom {
    border-bottom-color: rgba(255, 255, 255, 0.95);
    border-top: none;
    filter: drop-shadow(0 2px 4px rgba(31, 38, 135, 0.08));
}

.profile-onboarding-arrow--left {
    border-left-color: rgba(255, 255, 255, 0.95);
    border-right: none;
    filter: drop-shadow(-2px 0 4px rgba(31, 38, 135, 0.08));
}

.profile-onboarding-arrow--right {
    border-right-color: rgba(255, 255, 255, 0.95);
    border-left: none;
    filter: drop-shadow(2px 0 4px rgba(31, 38, 135, 0.08));
}

@media (max-width: 480px) {
    .profile-onboarding-card {
        left: 50% !important;
        right: auto;
        transform: translateX(-50%) !important;
        top: 50% !important;
        bottom: auto;
        margin-top: -100px;
        max-width: 92vw;
    }

    .profile-onboarding-arrow {
        display: none !important;
    }

    .profile-onboarding-spot {
        display: none !important;
    }
}
