/* chat-tour.css — Обучающий тур по интерфейсу (первый заход).
   Подсветка кнопок (spotlight) + карточка-подсказка + навигация.
   Изолированно от chat.css: префикс .osc-tour-*, без !important на чужих классах.
*/

/* Прозрачный перехватчик кликов поверх UI. Затемнение НЕ здесь —
   его делает .osc-tour-spot через box-shadow 0 0 0 9999px, чтобы
   подсвеченная область оставалась чёткой и не размытой. */
.osc-tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 99000;
    background: transparent;
    pointer-events: auto;
}

.osc-tour-overlay.osc-tour-fadein { animation: oscTourFadeIn 0.28s ease both; }

@keyframes oscTourFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* «Дыра» вокруг подсвеченного элемента: рамка + box-shadow затемняет ВСЁ
   снаружи, внутренность спота 100% прозрачная (никакого blur). */
.osc-tour-spot {
    position: fixed;
    z-index: 99001;
    border: 2px solid #7c89f6;
    border-radius: 12px;
    background: transparent;
    box-shadow:
        0 0 0 4px rgba(124, 137, 246, 0.32),
        0 0 0 9999px rgba(8, 10, 22, 0.82),
        0 0 32px 4px rgba(124, 137, 246, 0.5);
    pointer-events: none;
    transition: top 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                left 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                height 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    animation: oscTourPulse 2.2s ease-in-out infinite;
}
.osc-tour-spot.osc-tour-spot-hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}
:root[data-theme="light"] .osc-tour-spot,
:root[data-theme="minimal"] .osc-tour-spot {
    box-shadow:
        0 0 0 4px rgba(124, 137, 246, 0.32),
        0 0 0 9999px rgba(20, 24, 38, 0.62),
        0 0 24px 2px rgba(124, 137, 246, 0.5);
}

@keyframes oscTourPulse {
    0%, 100% { border-color: #7c89f6; }
    50%      { border-color: #10c4d6; }
}

/* Карточка-подсказка */
.osc-tour-card {
    position: fixed;
    z-index: 99002;
    max-width: 360px;
    min-width: 280px;
    background: var(--bg-card, #14182a);
    border: 1px solid var(--border, rgba(124, 137, 246, 0.28));
    border-radius: 14px;
    padding: 18px 18px 14px;
    color: var(--text, #e8eaf3);
    box-shadow: 0 18px 48px -8px rgba(0, 0, 0, 0.6),
                0 0 0 1px rgba(124, 137, 246, 0.12) inset;
    font-family: inherit;
    animation: oscTourCardIn 0.32s cubic-bezier(0.4, 0, 0.2, 1) both;
}
:root[data-theme="light"] .osc-tour-card,
:root[data-theme="minimal"] .osc-tour-card {
    background: #ffffff;
    color: #1a1f33;
    border-color: rgba(124, 137, 246, 0.32);
    box-shadow: 0 14px 40px -8px rgba(20, 24, 38, 0.25);
}

@keyframes oscTourCardIn {
    from { opacity: 0; transform: translateY(8px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

.osc-tour-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.osc-tour-card-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c89f6, #10c4d6);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}
.osc-tour-card-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text, #e8eaf3);
    margin: 0;
}
:root[data-theme="light"] .osc-tour-card-title,
:root[data-theme="minimal"] .osc-tour-card-title {
    color: #1a1f33;
}

.osc-tour-card-body {
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--text-muted, #b4bbd6);
    margin: 0 0 14px;
}
:root[data-theme="light"] .osc-tour-card-body,
:root[data-theme="minimal"] .osc-tour-card-body {
    color: #4a5070;
}

.osc-tour-card-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 6px;
}
.osc-tour-card-nav-left {
    display: flex;
    gap: 8px;
}
.osc-tour-card-progress {
    font-size: 11px;
    color: var(--text-muted, #8a91ad);
    font-variant-numeric: tabular-nums;
    user-select: none;
}

.osc-tour-btn {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 12.5px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
    line-height: 1;
}
.osc-tour-btn:active { transform: scale(0.97); }

.osc-tour-btn-primary {
    background: linear-gradient(135deg, #7c89f6, #10c4d6);
    color: #fff;
    border-color: transparent;
}
.osc-tour-btn-primary:hover {
    filter: brightness(1.08);
}

.osc-tour-btn-ghost {
    background: transparent;
    color: var(--text-muted, #b4bbd6);
    border-color: var(--border, rgba(124, 137, 246, 0.24));
}
.osc-tour-btn-ghost:hover {
    background: rgba(124, 137, 246, 0.08);
    color: var(--text, #e8eaf3);
}
:root[data-theme="light"] .osc-tour-btn-ghost,
:root[data-theme="minimal"] .osc-tour-btn-ghost {
    color: #5a607a;
    border-color: rgba(124, 137, 246, 0.28);
}
:root[data-theme="light"] .osc-tour-btn-ghost:hover,
:root[data-theme="minimal"] .osc-tour-btn-ghost:hover {
    background: rgba(124, 137, 246, 0.07);
    color: #1a1f33;
}

.osc-tour-btn-skip {
    background: transparent;
    color: var(--text-muted, #8a91ad);
    border-color: transparent;
    padding: 7px 10px;
    font-size: 12px;
}
.osc-tour-btn-skip:hover {
    color: var(--text, #e8eaf3);
    background: rgba(124, 137, 246, 0.06);
}

/* Хвостик карточки — стрелка к подсвеченной кнопке. Включаем через data-arrow. */
.osc-tour-card::before {
    content: "";
    position: absolute;
    width: 12px;
    height: 12px;
    background: inherit;
    border: inherit;
    border-right: 0;
    border-bottom: 0;
    transform: rotate(45deg);
    display: none;
}
.osc-tour-card[data-arrow="top"]::before    { display: block; top: -7px;    left: 50%; margin-left: -6px; }
.osc-tour-card[data-arrow="bottom"]::before { display: block; bottom: -7px; left: 50%; margin-left: -6px;
                                              transform: rotate(225deg); }
.osc-tour-card[data-arrow="left"]::before   { display: block; left: -7px;   top: 50%;  margin-top: -6px;
                                              transform: rotate(-45deg); }
.osc-tour-card[data-arrow="right"]::before  { display: block; right: -7px;  top: 50%;  margin-top: -6px;
                                              transform: rotate(135deg); }

/* Кнопка «?» в топбаре (программно вставляемая). Чтобы выглядела как родные topbar-btn. */
.osc-tour-help-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border, rgba(124, 137, 246, 0.24));
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted, #b4bbd6);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    flex-shrink: 0;
}
.osc-tour-help-btn:hover {
    background: rgba(124, 137, 246, 0.1);
    color: var(--text, #e8eaf3);
    border-color: rgba(124, 137, 246, 0.4);
}
.osc-tour-help-btn svg { width: 16px; height: 16px; }

/* Мобилка: карточка по нижнему краю, на всю ширину. */
@media (max-width: 720px) {
    .osc-tour-card {
        left: 12px !important;
        right: 12px !important;
        max-width: none;
        min-width: 0;
        bottom: 14px !important;
        top: auto !important;
    }
    .osc-tour-card::before { display: none !important; }
}

/* Уважение reduced motion */
@media (prefers-reduced-motion: reduce) {
    .osc-tour-spot { animation: none; transition: none; }
    .osc-tour-card { animation: none; }
    .osc-tour-overlay { transition: none; }
}
