/* =============================================
   astralis-chat.css — Astralis / astralmap.ru
   ============================================= */

/* ── ЛК-тема: светлые стили ────────────── */
.asb-chat-wrap .as-chat-wrap,
.as-chat-wrap {
    --chat-bg: #fff;
    --chat-card: #F5F2EA;
    --chat-border: rgba(28,32,48,0.12);
    --chat-text: #242F40;
    --chat-muted: #9198AA;
    --chat-accent: #242F40;
    --chat-accent-light: #B8965A;
    --chat-user-bg: #242F40;
    --chat-bot-bg: #F5F2EA;
}

/* ── Обёртка чата ────────────────────────── */
.as-chat-wrap {
    display: flex;
    flex-direction: column;
    height: 600px;
    max-height: 80vh;
    background: var(--chat-bg);
    border: 1px solid var(--chat-border);
    border-radius: 14px;
    overflow: hidden;
    font-family: 'Jost', -apple-system, sans-serif;
}

/* ── Шапка ───────────────────────────────── */
.as-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--chat-bg);
    border-bottom: 1px solid var(--chat-border);
    flex-shrink: 0;
}
.as-chat-astrologer {
    display: flex;
    align-items: center;
    gap: 10px;
}
.as-chat-avatar {
    width: 36px;
    height: 36px;
    background: var(--chat-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    color: #F5F2EA;
}
.as-chat-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--chat-text);
    font-family: 'Cormorant Garamond', serif;
    font-size: 16px;
}
.as-chat-status {
    font-size: 11px;
    color: #3D6951;
}

/* Счётчик */
.as-chat-counter { text-align: right; }
.as-counter {
    font-size: 12px;
    color: var(--chat-muted);
    background: var(--chat-card);
    padding: 4px 10px;
    border-radius: 20px;
}
.as-counter-low { color: #A34545; }
.as-counter-unlimited { font-size: 12px; color: #3D6951; }

/* ── Сообщения ───────────────────────────── */
.as-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(28,32,48,0.15) transparent;
}
.as-chat-messages::-webkit-scrollbar { width: 4px; }
.as-chat-messages::-webkit-scrollbar-thumb { background: rgba(28,32,48,0.15); border-radius: 2px; }

.as-msg {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: 85%;
}
.as-msg-animate {
    animation: as-msg-in 0.25s ease;
}
@keyframes as-msg-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

.as-msg-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}
.as-msg-assistant { align-self: flex-start; }

.as-msg-avatar {
    width: 28px;
    height: 28px;
    background: var(--chat-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 2px;
    color: #F5F2EA;
}

.as-msg-text {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.65;
    color: var(--chat-text);
}
.as-msg-user .as-msg-text {
    background: var(--chat-user-bg);
    color: #F5F2EA;
    border-bottom-right-radius: 4px;
}
.as-msg-assistant .as-msg-text {
    background: var(--chat-bot-bg);
    border: 1px solid var(--chat-border);
    border-bottom-left-radius: 4px;
}
.as-msg-text p { margin: 0 0 8px; }
.as-msg-text p:last-child { margin: 0; }
.as-msg-text strong { color: var(--chat-text); font-weight: 600; }

/* Курсор стриминга */
.as-cursor {
    display: inline-block;
    animation: as-blink 0.8s steps(1) infinite;
    color: var(--chat-accent-light);
}
@keyframes as-blink { 50% { opacity: 0; } }

/* Индикатор набора */
.as-typing-indicator .as-msg-text {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
}
.as-dot {
    width: 6px;
    height: 6px;
    background: #242F40;
    border-radius: 50%;
    animation: as-bounce 1.2s infinite;
}
.as-dot:nth-child(2) { animation-delay: 0.2s; }
.as-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes as-bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
}

/* ── Подсказки ───────────────────────────── */
.as-chat-suggestions {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    overflow-x: auto;
    flex-shrink: 0;
    scrollbar-width: none;
}
.as-chat-suggestions::-webkit-scrollbar { display: none; }
.as-suggestion {
    background: var(--chat-card);
    border: 1px solid var(--chat-border);
    color: var(--chat-muted);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}
.as-suggestion:hover {
    border-color: var(--chat-accent-light);
    color: var(--chat-text);
}

/* ── Инпут ───────────────────────────────── */
.as-chat-input-wrap {
    padding: 12px 16px;
    border-top: 1px solid var(--chat-border);
    background: var(--chat-bg);
    flex-shrink: 0;
}
.as-input-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}
.as-chat-textarea {
    flex: 1;
    background: var(--chat-card);
    border: 1.5px solid var(--chat-border);
    color: var(--chat-text);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    resize: none;
    min-height: 42px;
    max-height: 150px;
    line-height: 1.5;
    transition: border-color 0.2s;
    font-family: inherit;
}
.as-chat-textarea:focus {
    outline: none;
    border-color: var(--chat-accent-light);
}
.as-chat-textarea::placeholder { color: var(--chat-muted); }

.as-chat-send {
    width: 42px;
    height: 42px;
    background: var(--chat-accent);
    border: none;
    border-radius: 10px;
    color: #F5F2EA;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}
.as-chat-send:hover { background: #1a2330; transform: translateY(-1px); }
.as-chat-send:active { transform: none; }

.as-input-hint {
    font-size: 11px;
    color: var(--chat-muted);
    margin-top: 6px;
    text-align: right;
}

/* ── Заблокированный инпут ───────────────── */
.as-chat-blocked { padding: 4px 0; }
.as-chat-blocked p {
    font-size: 13px;
    color: var(--chat-muted);
    margin: 0 0 10px;
    text-align: center;
}
.as-blocked-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.as-btn-outline {
    background: transparent;
    border: 1px solid var(--chat-border);
    color: var(--chat-muted);
    padding: 10px;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.as-btn-outline:hover {
    border-color: var(--chat-accent-light);
    color: var(--chat-text);
}

/* ── Модальное окно авторизации ──────────── */
.as-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(28,32,48,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
    padding: 20px;
}
.as-modal {
    background: #fff;
    border: 1px solid var(--chat-border);
    border-radius: 14px;
    padding: 28px;
    max-width: 400px;
    width: 100%;
    position: relative;
}
.as-modal h3 { font-size: 18px; color: var(--chat-text); margin: 0 0 20px; font-family: 'Cormorant Garamond', serif; }
.as-modal-close {
    position: absolute;
    top: 14px; right: 14px;
    background: none;
    border: none;
    color: var(--chat-muted);
    font-size: 18px;
    cursor: pointer;
    width: 28px; height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.2s;
}
.as-modal-close:hover { color: var(--chat-text); }

/* ── Транзиты ────────────────────────────── */
.as-transits-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}
.as-transit-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--chat-card);
    border: 1px solid transparent;
}
.as-transit-green  { border-color: rgba(61,105,81,0.3); }
.as-transit-yellow { border-color: rgba(184,150,90,0.3); }
.as-transit-blue   { border-color: var(--chat-border); }

.as-transit-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.as-transit-green  .as-transit-dot { background: #3D6951; }
.as-transit-yellow .as-transit-dot { background: #B8965A; }
.as-transit-blue   .as-transit-dot { background: #242F40; }

.as-transit-info { display: flex; flex-direction: column; gap: 2px; }
.as-transit-planets {
    font-size: 14px;
    color: var(--chat-text);
    font-weight: 500;
}
.as-transit-aspect {
    font-size: 12px;
    color: var(--chat-muted);
}

/* ── Платные секции ─────────────────────── */
.as-section-paid {
    background: var(--chat-card);
    border: 1px solid var(--chat-border);
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 20px;
}
.as-section-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--chat-border);
}
.as-section-header h3 {
    font-size: 18px;
    color: var(--chat-accent-light);
    margin: 0;
    font-family: 'Cormorant Garamond', serif;
}
.as-text-muted {
    color: var(--chat-muted);
    font-size: 14px;
}

/* ── Адаптив ─────────────────────────────── */
@media (max-width: 480px) {
    .as-chat-wrap { height: 500px; border-radius: 12px; }
    .as-msg { max-width: 92%; }
    .as-modal { padding: 20px; }
    .as-blocked-options { flex-direction: column; }
}
