/* New Hero Design - Based on Figma */

/* Градиентный фон в hero-режиме */
.chat {
    position: relative;
}

.chat::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background: var(--gradient-hero-bg);
    z-index: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* В hero-режиме скролл ВСЕГДА на уровне .chat (не внутри .messages-container) */
.chat.hero-mode {
    overflow-y: auto;
}

/* Элементы .chat должны быть поверх градиента только в hero-режиме */
.chat.hero-mode>* {
    position: relative;
    z-index: 1;
}

/* messages-container не скроллится, растягивается по контенту */
.chat.hero-mode .messages-container {
    overflow: visible;
    overflow-x: visible;
    flex: 0 1 auto;
    min-height: calc(100vh - var(--toolbar-height));
}

/* На планшетах и мобильных min-height: auto, т.к. hero-composer static */
@media (max-width: 768px) {
    .chat.hero-mode .messages-container {
        min-height: auto;
    }
}

/* ФУТЕР В HERO-РЕЖИМЕ - НЕ ФИКСИРОВАН */
.chat.hero-mode .page-footer {
    position: static !important;
    bottom: auto !important;
    margin-top: var(--space-2xl);
    background-color: transparent !important;
    background: none !important;
}

/* Управление видимостью текстов в футере */
/* По умолчанию (в режиме чата) показываем disclaimer-chat */
.footer-disclaimer-chat {
    display: block;
    flex: 1;
}

.footer-disclaimer-hero {
    display: none;
    flex: 0;
}

/* В hero-режиме меняем местами */
.chat.hero-mode .footer-disclaimer-chat {
    display: none;
    flex: 0;
}

.chat.hero-mode .footer-disclaimer-hero {
    display: block;
    flex: 1;
}

/* Скрываем иконку "Новый диалог" в hero-режиме (на главной странице она не нужна) */
.chat.hero-mode .header-compose-icon {
    display: none !important;
}

/* Показываем градиент в hero-режиме */
.chat.hero-mode::before {
    opacity: 1 !important;
    position: fixed;
    height: 100vh;
    height: 100dvh;
}

/* В demo-режиме градиент НИКОГДА не показываем */
html.demo-mode .chat::before {
    opacity: 0 !important;
}

/* В demo-режиме скрываем footer-disclaimer-hero (показываем chat disclaimer) */
html.demo-mode .footer-disclaimer-hero {
    display: none !important;
}

/* Hero composer - показывается только в hero-режиме */
.hero-composer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 760px;
    padding: var(--space-3xl) var(--space-2xl);
    display: none;
    z-index: 5;
}

.chat.hero-mode .hero-composer {
    display: block;
}

/* В demo-режиме hero-composer НИКОГДА не показывается */
html.demo-mode .hero-composer {
    display: none !important;
}

/* Логотип над заголовком */
.hero-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: var(--space-3xl);
}

.hero-logo img {
    width: 320px;
    height: auto;
    object-fit: contain;
}

/* Заголовки */
.hero-titles {
    text-align: center;
    margin-bottom: var(--space-3xl);
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 0 var(--space-lg);
}

.hero-title {
    margin: 0;
    font-size: 37px;
    line-height: 1.2;
    font-weight: 700;
    color: #344A68;
    text-align: center;
    margin-bottom: 16px;
}


/* Главное поле ввода */
.hero-input-wrapper {
    position: relative;
    margin-bottom: var(--space-2xl);
}

.hero-composer textarea {
    width: 100%;
    min-height: 120px;
    padding: var(--space-xl);
    padding-right: 70px;
    /* место для кнопки отправки */
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-family: inherit;
    line-height: 24px;
    resize: none;
    overflow-y: hidden;
    outline: none;
    background: #FAFAFA;
    box-shadow: 0px 10px 15px -3px rgba(0, 0, 0, 0.1),
        0px 4px 6px -2px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
    color: #344968;
}

.hero-composer textarea::placeholder {
    color: #757575;
    font-size: 16px;
    line-height: 24px;
}

.hero-composer textarea:focus {
    box-shadow: 0px 10px 15px -3px rgba(0, 0, 0, 0.15),
        0px 4px 6px -2px rgba(0, 0, 0, 0.08);
}

/* Кнопка отправки с градиентом */
/* ID селектор имеет высокую специфичность, !important не нужен */
#hero-send {
    position: absolute;
    right: 16px;
    bottom: 16px;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    border: none;
    border-radius: 18px;
    background: var(--gradient-primary);
    box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    color: transparent;
}

#hero-send:hover:not(:disabled) {
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

#hero-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#hero-send .icon {
    width: 20px;
    height: 20px;
    background-image: url('../../assets/icons/send-white.svg');
    background-size: 20px 20px;
    background-repeat: no-repeat;
    background-position: center;
}

/* Блок с примерами запросов */
.hero-hints-container {
    margin-top: 33px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.hero-hints-label {
    font-size: 16px;
    line-height: 21px;
    color: #6B7280;
    text-transform: none;
    margin-bottom: var(--space-md);
    font-weight: 400;
}

/* Примеры запросов - карточки */
.hero-example-prompt {
    display: inline-flex;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-sm);
    margin-right: var(--space-md);
    background: #FAFAFA;
    border-radius: 12px;
    box-shadow: 0px 4px 6px -2px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    max-width: fit-content;
    opacity: 0.5;
}

/* При наведении на любую подсказку - отменяем анимацию для всех */
.hero-hints-container:has(.hero-example-prompt:hover) .hero-example-prompt {
    animation: none !important;
}

/* Все подсказки, на которые НЕ наведен курсор, остаются блеклыми */
.hero-hints-container:has(.hero-example-prompt:hover) .hero-example-prompt:not(:hover) {
    opacity: 0.5 !important;
}

/* При наведении на конкретную подсказку - подсвечиваем только её (нулевая прозрачность) */
.hero-example-prompt:hover {
    box-shadow: 0px 4px 8px -2px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
    opacity: 1 !important;
}

/* Анимация мигания для подсказок - по очереди без пауз */
@keyframes hint-pulse-1 {

    0% {
        opacity: 0.5;
    }

    16.66% {
        opacity: 1;
    }

    33.33%,
    100% {
        opacity: 0.5;
    }
}

@keyframes hint-pulse-2 {

    0%,
    33.33% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    66.66%,
    100% {
        opacity: 0.5;
    }
}

@keyframes hint-pulse-3 {

    0%,
    66.66% {
        opacity: 0.5;
    }

    83.33% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

/* Первая подсказка */
.hero-hints-container .hero-example-prompt:nth-child(2) {
    animation: hint-pulse-1 4.5s ease-in-out infinite;
}

/* Вторая подсказка */
.hero-hints-container .hero-example-prompt:nth-child(3) {
    animation: hint-pulse-2 4.5s ease-in-out infinite;
}

/* Третья подсказка */
.hero-hints-container .hero-example-prompt:nth-child(4) {
    animation: hint-pulse-3 4.5s ease-in-out infinite;
}

.hero-example-text {
    font-size: 14px;
    line-height: 15px;
    color: #344968;
    text-shadow: 0px 1px 1.6px rgba(0, 0, 0, 0.12);
    font-weight: 400;
}

.hero-example-emoji {
    margin-right: var(--space-xs);
}

.hint-icon {
    flex-shrink: 0;
    margin-left: var(--space-xs);
    color: #D1D5DB;
    opacity: 0.5;
    transition: opacity 0.2s ease;
    width: 12px;
    height: 12px;
    align-self: center;
}

.hero-example-prompt:hover .hint-icon {
    opacity: 0.7;
}

/* Адаптивность */
@media (max-width: 900px) {
    .hero-title {
        font-size: 42px;
        line-height: 42px;
    }


    .hero-composer {
        padding: var(--space-2xl) var(--space-lg);
    }

    .hero-logo img {
        width: 360px;
        height: auto;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 32px;
        line-height: 36px;
    }

    /* На планшетах также убираем absolute для корректного скролла */
    .chat.hero-mode .hero-composer {
        position: static;
        transform: none;
        margin-top: 10vh;
    }

    .hero-composer textarea {
        min-height: 100px;
        padding: var(--space-lg);
        padding-right: 64px;
    }

    .hero-example-text {
        font-size: 13px;
    }

    .hero-hints-label {
        font-size: 14px;
    }

    .hero-hints-container {
        margin-bottom: 80px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 28px;
        line-height: 32px;
    }

    /* На мобильных убираем absolute позиционирование для корректного скролла */
    .chat.hero-mode .hero-composer {
        position: static;
        transform: none;
        padding: var(--space-xl) var(--space-md);
        margin-top: 8vh;
        margin-bottom: var(--space-2xl);
    }

    .hero-composer textarea {
        min-height: 130px;
    }

    .hero-composer textarea::placeholder {
        font-size: 14px;
    }

    .hero-hints-container {
        margin-top: 48px;
        margin-bottom: 100px;
    }

    .hero-logo img {
        width: 280px;
        height: auto;
        max-width: 90vw;
    }
}