/**
 * БЁРЧИ 2026 | PREMIUM IMMERSIVE UI
 * Файл: assets/css/index-page.css
 * Описание: Специфичные стили главной страницы (3D-эффект глубины ленты)
 */

/* ========================================= */
/* 3D ЭФФЕКТ ГЛУБИНЫ ДЛЯ ЛЕНТЫ (PREMIUM 2026)*/
/* ========================================= */
#app-container {
    transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1),
                filter 0.5s cubic-bezier(0.32, 0.72, 0, 1),
                border-radius 0.5s ease;
    transform-origin: top center;
    background: var(--bg-main) !important;
    will-change: transform, filter;
}

#app-container.ai-depth-active {
    transform: scale(0.92) translateY(15px);
    filter: blur(12px) brightness(0.4) saturate(80%);
    border-radius: 32px;
    overflow: hidden;
    pointer-events: none;
}

/* ========================================= */
/* BOT CLOUDS CAROUSEL (УМНЫЕ УВЕДОМЛЕНИЯ)   */
/* ========================================= */

:root { --p-accent: var(--yz-accent, #d97757); }

.bot-notifications-carousel {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 12px 18px 18px;
    scroll-padding-left: 12px;
    margin-bottom: 5px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.bot-notifications-carousel::-webkit-scrollbar {
    display: none; 
}

.bot-cloud-story {
    --bot-color: var(--p-accent); 
    flex: 0 0 auto;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px; 
    width: 72px; 
    cursor: pointer;
    padding-top: 6px; 
}

/* При нажатии — плоский отклик */
.bot-cloud-story:active .bot-cloud-avatar-wrapper {
    transform: scale(0.95);
    opacity: 0.8;
}

.bot-cloud-story:active .bot-cloud-name {
    opacity: 0.7;
}

/* Плоский дизайн аватарки сторис */
.bot-cloud-avatar-wrapper {
    position: relative;
    width: 58px; 
    height: 58px;
    border-radius: 50%;
    
    /* Цвет строго совпадает с фоном сайта */
    background-color: var(--bg-main, var(--yz-bg-deep, #0A0908));
    
    /* Плоский дизайн: без выпуклых теней */
    box-shadow: none;
    
    transition: transform 0.2s ease;
                
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Внешнее цветное кольцо сторис (висит в воздухе вокруг кнопки) */
.bot-cloud-avatar-wrapper::before {
    content: '';
    position: absolute;
    top: -6px; left: -6px; right: -6px; bottom: -6px;
    border-radius: 50%;
    border: 2px solid var(--bot-color);
    transition: border-color 0.3s ease;
    pointer-events: none;
}

/* Плоский дизайн: без свечения */

.bot-cloud-icon {
    font-size: 26px;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Легкая тень под иконкой, чтобы она не сливалась с фоном */
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
    transition: filter 0.3s ease;
}


.bot-cloud-name {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    letter-spacing: 0.2px;
    transition: opacity 0.2s;
}

.bot-notifications-carousel.hidden {
    display: none !important;
}

/* Светлая тема: название бота — тёмный текст */
html[data-yz-theme="cloud"] .bot-cloud-name {
    color: var(--text-primary, #2a2621);
}

/* ========================================= */
/* АСТРО: живое кольцо, точка, строка-тизер   */
/* ========================================= */

/* Кольцо-градиент вместо ровной обводки (border-mask трюк) */
.bot-cloud-story.is-astro .bot-cloud-avatar-wrapper::before {
    border: 0;
    padding: 2px;
    background: conic-gradient(from 215deg, #e2b13c, #d97757, #b05730, #e88a68, #e2b13c);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
            mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    animation: astroRingSpin 8s linear infinite;
}

@keyframes astroRingSpin {
    to { transform: rotate(360deg); }
}

/* Ночное небо внутри кружка */
.bot-cloud-story.is-astro .bot-cloud-avatar-wrapper {
    background: radial-gradient(circle at 34% 26%, #39352f, #201e1c);
}

.bot-cloud-story.is-astro .bot-cloud-icon {
    font-size: 24px;
    color: #f0c98a;
    filter: drop-shadow(0 0 10px rgba(226, 177, 60, 0.55));
}

/* Всё прочитано — кольцо гаснет, градиент не крутим */
.bot-cloud-story.is-astro.is-read .bot-cloud-avatar-wrapper::before {
    background: rgba(128, 128, 128, 0.35);
    animation: none;
    transform: none;
}

.bot-cloud-story.is-astro.is-read .bot-cloud-icon {
    color: #b3aa9a;
    filter: drop-shadow(0 0 6px rgba(226, 177, 60, 0.18));
}

/* Точка непрочитанного (никаких надписей) */
.astro-dot {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e2885f, #d97757);
    border: 2.5px solid var(--bg-main, #0A0908);
    box-sizing: border-box;
    z-index: 3;
    pointer-events: none;
}

/* Строка-тизер под каруселью */
.astro-teaser {
    margin: 0 15px 12px;
    padding: 11px 14px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    background: rgba(250, 249, 245, 0.05);
    border: 1px solid rgba(217, 119, 87, 0.30);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    animation: astroTeaserIn 0.35s cubic-bezier(0.2, 0.9, 0.25, 1) both;
    transition: transform 0.15s ease, background 0.2s ease;
}

.astro-teaser:active {
    transform: scale(0.985);
    background: rgba(250, 249, 245, 0.08);
}

@keyframes astroTeaserIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: none; }
}

/* Приглашение для нового человека — это призыв, а не сводка: рамка ярче,
   внутри мягкий тёплый градиент, точка пульсирует. Строка должна звать. */
.astro-teaser.is-invite {
    background:
        linear-gradient(135deg, rgba(217, 119, 87, 0.18), rgba(143, 111, 214, 0.12)),
        rgba(250, 249, 245, 0.04);
    border-color: rgba(217, 119, 87, 0.55);
    box-shadow: 0 8px 26px -14px rgba(217, 119, 87, 0.7);
}

.astro-teaser.is-invite .at-tx { color: #faf9f5; }
.astro-teaser.is-invite .at-dot { animation: atPulse 1.9s ease-in-out infinite; }
.astro-teaser.is-invite .at-go { color: #e88a68; }

@keyframes atPulse {
    0%, 100% { transform: scale(1);   opacity: 1;   }
    50%      { transform: scale(1.5); opacity: 0.55; }
}

.at-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #d97757;
    flex: none;
    box-shadow: 0 0 10px rgba(217, 119, 87, 0.9);
}

.at-tx {
    flex: 1;
    font-size: 12.5px;
    color: #c9c2b4;
    line-height: 1.35;
    min-width: 0;
}

.at-tx b {
    color: var(--text-primary, #faf9f5);
    font-weight: 700;
}

.at-tx u {
    text-decoration: none;
    color: #f0c98a;
    font-family: var(--yz-font-display, 'Unbounded'), 'Inter', sans-serif;
    font-weight: 700;
}

.at-go {
    color: #e8a882;
    font-size: 12px;
    flex: none;
}

/* Светлая тема (по образцу .bot-cloud-name) */
html[data-yz-theme="cloud"] .astro-teaser {
    background: rgba(217, 119, 87, 0.07);
    border-color: rgba(176, 87, 48, 0.32);
}

html[data-yz-theme="cloud"] .astro-teaser:active {
    background: rgba(217, 119, 87, 0.12);
}

html[data-yz-theme="cloud"] .at-tx {
    color: var(--text-secondary, #6b6357);
}

html[data-yz-theme="cloud"] .at-tx b {
    color: var(--text-primary, #2a2621);
}

html[data-yz-theme="cloud"] .at-tx u {
    color: #a8511f;
}

html[data-yz-theme="cloud"] .at-go {
    color: #b05730;
}

html[data-yz-theme="cloud"] .astro-dot {
    border-color: var(--bg-main, #faf9f5);
}

/* [cloud-fix 2026-08-19] invite-вариант тизера: правило .astro-teaser.is-invite .at-tx
   (специфичность 0,3,0) перебивало cloud-фикс выше (0,2,1) — текст приглашения
   оставался почти белым #faf9f5 на светлой плашке. */
html[data-yz-theme="cloud"] .astro-teaser.is-invite .at-tx { color: var(--text-primary, #2a2621); }
html[data-yz-theme="cloud"] .astro-teaser.is-invite .at-go { color: #b05730; }

@media (prefers-reduced-motion: reduce) {
    .bot-cloud-story.is-astro .bot-cloud-avatar-wrapper::before { animation: none; }
    .astro-teaser { animation: none; transition: none; }
    .astro-teaser.is-invite .at-dot { animation: none; }
    .astro-teaser:active { transform: none; }
}

/* ========================================= */
/* BOT PROMO MODAL (ВИТРИНА ПОДПИСОК)        */
/* ========================================= */

.bot-promo-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--yz-overlay, rgba(0, 0, 0, 0.6));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.bot-promo-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.bot-promo-card {
    position: relative;
    width: 90%;
    max-width: 360px;
    background: var(--yz-surface, rgba(30, 30, 35, 0.7));
    border: 1px solid var(--yz-border, var(--yz-border, rgba(255,255,255,0.1)));
    border-radius: 28px;
    box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.8), inset 0 1px 0 var(--yz-border, rgba(255,255,255,0.1));
    overflow: hidden;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.bot-promo-overlay.visible .bot-promo-card {
    transform: scale(1) translateY(0);
}

.bot-promo-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 16px;
    border: none;
    background: var(--yz-border, var(--yz-border, rgba(255,255,255,0.1)));
    color: var(--yz-text, #fff);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
}

.bot-promo-close-btn:active {
    background: rgba(255, 255, 255, 0.2);
}

.bot-promo-header {
    padding: 40px 20px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.bot-promo-header::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 100%;
    background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

.bot-promo-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    margin-bottom: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    text-shadow: 0 4px 8px rgba(0,0,0,0.4);
    position: relative;
    z-index: 2;
}

.bot-promo-avatar::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, var(--yz-border-strong, rgba(255,255,255,0.2)) 0%, rgba(255,255,255,0) 100%);
    border-radius: 50%;
    pointer-events: none;
}

.bot-promo-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--yz-text, #fff);
    margin: 0;
    text-align: center;
    letter-spacing: -0.3px;
    position: relative;
    z-index: 2;
}

.bot-promo-body {
    padding: 10px 24px 30px 24px;
    text-align: center;
}

.bot-promo-desc {
    font-size: 14px;
    color: var(--yz-dim, rgba(255, 255, 255, 0.65));
    line-height: 1.5;
    margin: 0 0 28px 0;
}

.bot-promo-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bot-promo-btn {
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    color: var(--yz-text, #fff);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    outline: none;
}

.bot-promo-btn:active {
    transform: scale(0.96);
}

.bot-promo-btn.subscribe {
    color: var(--yz-text, #fff);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.bot-promo-btn.subscribed {
    color: rgba(255, 255, 255, 0.7);
}

.bot-promo-btn.chat-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--yz-border, var(--yz-border, rgba(255,255,255,0.1)));
    color: var(--yz-text, #fff);
}

.bot-promo-btn.chat-btn:hover {
    background: var(--yz-border, var(--yz-border, rgba(255,255,255,0.1)));
}


/* ═══════════════════════════════════════════════════════════════
   ВИРТУАЛЬНЫЕ ОБЛАКА ГЛАВНОЙ: «Ты», «Книга дня», «Создатель»
   ─────────────────────────────────────────────────────────────
   Собраны тем же border-mask трюком, что кольцо Астро выше: обычный
   border не умеет градиент, поэтому кольцо — это фон под маской.
   Класс задаёт api/_home_clouds.php (поле kind), гашение — is-read.
   ═══════════════════════════════════════════════════════════════ */

/* Фото в кружке: обложка книги или аватар человека. Эмодзи лежит ПОД
   картинкой — если файл не открылся, onerror убирает img и виден значок,
   а не пустой круг. */
.bot-cloud-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    z-index: 2;
    pointer-events: none;
}

.bot-cloud-story.is-week .bot-cloud-avatar-wrapper::before,
.bot-cloud-story.is-book .bot-cloud-avatar-wrapper::before,
.bot-cloud-story.is-boss .bot-cloud-avatar-wrapper::before {
    border: 0;
    padding: 2px;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
            mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
}

/* «Ты» — фиолетовый: тот же цвет, которым в проекте помечены персонажи */
.bot-cloud-story.is-week .bot-cloud-avatar-wrapper::before {
    background: conic-gradient(from 200deg, #b79bf0, #8f6fd6, #5b3fa8, #c9b6f5, #b79bf0);
}

/* «Книга дня» — зелёный, как книжный раздел */
.bot-cloud-story.is-book .bot-cloud-avatar-wrapper::before {
    background: conic-gradient(from 200deg, #9ad3a0, #3f7d55, #2f5d46, #7bc47f, #9ad3a0);
}

/* «Создатель» — фирменный акцент, кольцо крутится в другую сторону,
   чтобы не путалось с Астро */
.bot-cloud-story.is-boss .bot-cloud-avatar-wrapper::before {
    background: conic-gradient(from 140deg, #e88a68, #d97757, #8f6fd6, #e2b13c, #e88a68);
    animation: astroRingSpin 11s linear infinite reverse;
}

.bot-cloud-story.is-week .bot-cloud-avatar-wrapper,
.bot-cloud-story.is-boss .bot-cloud-avatar-wrapper {
    background: radial-gradient(circle at 34% 26%, #2b2926, #1b1917);
}

/* Просмотрено — кольцо гаснет и фото притухает: ряд не должен светиться
   весь день после первого тапа */
.bot-cloud-story.is-week.is-read .bot-cloud-avatar-wrapper::before,
.bot-cloud-story.is-book.is-read .bot-cloud-avatar-wrapper::before,
.bot-cloud-story.is-boss.is-read .bot-cloud-avatar-wrapper::before {
    background: rgba(128, 128, 128, 0.35);
    animation: none;
    transform: none;
}

.bot-cloud-story.is-read .bot-cloud-photo {
    filter: grayscale(0.5) brightness(0.85);
}

/* Мини-обложка вместо эмодзи, когда у книги нет картинки: название серифом
   на тёмном градиенте — так же выглядят обложки в самом разделе книг. */
.bot-cloud-mini {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding: 0 5px;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 8.5px;
    line-height: 1.14;
    letter-spacing: 0.01em;
    text-align: center;
    color: #f2e7d4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.bot-cloud-story.is-book .bot-cloud-avatar-wrapper {
    background: radial-gradient(circle at 30% 22%, #3a2f23, #191612 72%);
}

/* Тонкая рамка внутри кружка — чтобы мини-обложка читалась как обложка,
   а не как подпись, случайно попавшая внутрь круга */
.bot-cloud-story.is-book .bot-cloud-icon:has(.bot-cloud-mini) {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(226, 177, 60, 0.28);
    filter: none;
}
