/* ================================================================
   СТРАНИЦА ЧАТА - СОВРЕМЕННЫЙ ДИЗАЙН С АНИМАЦИЯМИ
   ================================================================ */

/* ----------------------------------------------------------------
   Основной контейнер страницы
   ---------------------------------------------------------------- */
.chat-page {
    min-height: calc(100vh - 100px);
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    padding: 60px 40px;
    position: relative;
    overflow: hidden;
}

/* Анимированный фон */
.chat-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(149, 138, 209, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(98, 91, 139, 0.1) 0%, transparent 50%);
    animation: backgroundMove 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes backgroundMove {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(-5%, -5%) scale(1.1);
    }
}

.chat-page__container {
    max-width: 1648px;
    margin: 0 auto;
    display: flex;
    gap: 80px;
    align-items: flex-start;
    position: relative;
    z-index: 1;
}

/* ----------------------------------------------------------------
   Маскот (слева)
   ---------------------------------------------------------------- */
.chat-page__mascot {
    flex: 0 0 300px;
    position: sticky;
    top: 120px;
    animation: floatIn 1s ease-out;
}

@keyframes floatIn {
    from {
        opacity: 0;
        transform: translateX(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.chat-page__mascot-placeholder {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    padding: 40px;
    box-shadow: 
        0 20px 60px rgba(149, 138, 209, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.5);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: mascotPulse 3s ease-in-out infinite;
}

@keyframes mascotPulse {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-10px) scale(1.02);
    }
}

.chat-page__mascot-placeholder:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 
        0 30px 80px rgba(149, 138, 209, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.8);
}

.chat-page__mascot-image {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 10px 30px rgba(149, 138, 209, 0.3));
    transition: filter 0.4s ease;
    transform: scaleX(-1);
}

.chat-page__mascot-placeholder:hover .chat-page__mascot-image {
    filter: drop-shadow(0 15px 40px rgba(149, 138, 209, 0.4));
}

/* ----------------------------------------------------------------
   Область чата (справа)
   ---------------------------------------------------------------- */
.chat-page__chat-area {
    flex: 1;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(30px);
    border-radius: 30px;
    box-shadow: 
        0 20px 80px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.5);
    padding: 40px;
    display: flex;
    flex-direction: column;
    min-height: 700px;
    max-height: 80vh;
    animation: slideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Декоративные элементы */
.chat-page__chat-area::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(149, 138, 209, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

/* ----------------------------------------------------------------
   Контейнер сообщений
   ---------------------------------------------------------------- */
.chat-page__messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    scrollbar-width: thin;
    scrollbar-color: rgba(149, 138, 209, 0.3) transparent;
}

.chat-page__messages::-webkit-scrollbar {
    width: 8px;
}

.chat-page__messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-page__messages::-webkit-scrollbar-thumb {
    background: rgba(149, 138, 209, 0.3);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.chat-page__messages::-webkit-scrollbar-thumb:hover {
    background: rgba(149, 138, 209, 0.5);
}

/* ----------------------------------------------------------------
   Сообщения чата
   ---------------------------------------------------------------- */
.chat-message {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 75%;
    animation: messageSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    animation-fill-mode: forwards;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Сообщение от бота */
.chat-message--bot {
    align-self: flex-start;
}

.chat-message--bot .chat-message__bubble {
    background: linear-gradient(135deg, #958ad1 0%, #7d71bd 100%);
    color: #ffffff;
    border-radius: 24px 24px 24px 6px;
    box-shadow: 
        0 4px 20px rgba(149, 138, 209, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Сообщение от пользователя */
.chat-message--user {
    align-self: flex-end;
}

.chat-message--user .chat-message__bubble {
    background: rgba(98, 91, 139, 0.5);
    color: #ffffff;
    border-radius: 24px 24px 6px 24px;
    box-shadow: 
        0 4px 20px rgba(98, 91, 139, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.chat-message__bubble {
    padding: 20px 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.chat-message__bubble:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 30px rgba(149, 138, 209, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.chat-message__text {
    margin: 0;
    font-family: 'Coolvetica', 'Yanone Kaffeesatz', sans-serif;
    font-size: 19.68px;
    line-height: 1.5;
    font-weight: 400;
}

.chat-message__text--hint {
    margin-top: 12px;
    opacity: 0.9;
    font-size: 17px;
}

.chat-message__time {
    font-size: 13px;
    opacity: 0.6;
    padding: 0 8px;
    font-family: 'Coolvetica', sans-serif;
}

.chat-message--bot .chat-message__time {
    text-align: left;
}

.chat-message--user .chat-message__time {
    text-align: right;
}

/* ----------------------------------------------------------------
   Индикатор печати
   ---------------------------------------------------------------- */
.chat-page__typing {
    padding: 0 20px 10px;
    animation: fadeIn 0.3s ease;
}

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

.typing-indicator {
    display: inline-flex;
    gap: 6px;
    padding: 16px 20px;
    background: rgba(149, 138, 209, 0.15);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #958ad1;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px) scale(1.2);
        opacity: 1;
    }
}

/* ----------------------------------------------------------------
   Область ввода
   ---------------------------------------------------------------- */
.chat-page__input-area {
    border-top: 1px solid rgba(149, 138, 209, 0.1);
    padding-top: 20px;
    animation: slideUp 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-page__form {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.chat-page__input {
    flex: 1;
    padding: 18px 24px;
    font-size: 20px;
    font-family: 'Coolvetica', 'Yanone Kaffeesatz', sans-serif;
    border: 1px solid #cecece;
    border-radius: 12px;
    background: #f6f6f6;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.chat-page__input:focus {
    background: #ffffff;
    border-color: #958ad1;
    box-shadow: 
        0 0 0 4px rgba(149, 138, 209, 0.1),
        0 4px 20px rgba(149, 138, 209, 0.15);
    transform: translateY(-1px);
}

.chat-page__input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

.chat-page__send-btn {
    padding: 18px 28px;
    background: rgba(98, 91, 139, 0.5);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 4px 15px rgba(98, 91, 139, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.chat-page__send-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.chat-page__send-btn:hover::before {
    width: 300px;
    height: 300px;
}

.chat-page__send-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 8px 25px rgba(98, 91, 139, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.chat-page__send-btn:active {
    transform: translateY(0) scale(0.98);
}

.chat-page__send-btn svg {
    position: relative;
    z-index: 1;
}

.chat-page__send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ----------------------------------------------------------------
   Подсказки (быстрые ответы)
   ---------------------------------------------------------------- */
.chat-page__suggestions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    animation: fadeInUp 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-suggestion {
    padding: 12px 24px;
    background: rgba(98, 91, 139, 0.5);
    color: #ffffff;
    border: none;
    border-radius: 0 22px 22px 22px;
    font-family: 'Coolvetica', sans-serif;
    font-size: 20px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 2px 10px rgba(98, 91, 139, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.chat-suggestion::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}

.chat-suggestion:hover::before {
    width: 200px;
    height: 200px;
}

.chat-suggestion:hover {
    background: rgba(98, 91, 139, 0.7);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 8px 20px rgba(98, 91, 139, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.chat-suggestion:active {
    transform: translateY(-1px) scale(1.02);
}

/* ----------------------------------------------------------------
   Адаптивность
   ---------------------------------------------------------------- */
@media (max-width: 1200px) {
    .chat-page__container {
        gap: 40px;
    }
    
    .chat-page__mascot {
        flex: 0 0 250px;
    }
}

@media (max-width: 992px) {
    .chat-page {
        padding: 40px 20px;
    }
    
    .chat-page__container {
        flex-direction: column;
        align-items: center;
    }
    
    .chat-page__mascot {
        position: static;
        flex: 0 0 auto;
        width: 200px;
    }
    
    .chat-page__chat-area {
        width: 100%;
        max-height: 70vh;
    }
    
    .chat-message {
        max-width: 85%;
    }
}

@media (max-width: 768px) {
    .chat-page {
        padding: 30px 15px;
    }
    
    .chat-page__chat-area {
        padding: 24px;
        border-radius: 20px;
        min-height: 600px;
    }
    
    .chat-page__input {
        font-size: 18px;
        padding: 14px 18px;
    }
    
    .chat-suggestion {
        font-size: 18px;
        padding: 10px 20px;
    }
    
    .chat-message__text {
        font-size: 17px;
    }
    
    .chat-page__mascot {
        width: 150px;
    }
    
    .chat-page__mascot-placeholder {
        padding: 30px;
        border-radius: 20px;
    }
}

@media (max-width: 480px) {
    .chat-page {
        padding: 20px 10px;
    }
    
    .chat-page__chat-area {
        padding: 20px;
        min-height: 500px;
    }
    
    .chat-message {
        max-width: 90%;
    }
    
    .chat-page__suggestions {
        gap: 8px;
    }
    
    .chat-suggestion {
        font-size: 16px;
        padding: 8px 16px;
    }
}

/* ----------------------------------------------------------------
   Специальные эффекты
   ---------------------------------------------------------------- */

/* Эффект свечения при новом сообщении */
.chat-message--new {
    animation: messageGlow 1s ease-out;
}

@keyframes messageGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(149, 138, 209, 0.7);
    }
    100% {
        box-shadow: 0 0 0 20px rgba(149, 138, 209, 0);
    }
}

/* Пульсация кнопки отправки при наборе текста */
.chat-page__send-btn--active {
    animation: buttonPulse 1.5s ease-in-out infinite;
}

@keyframes buttonPulse {
    0%, 100% {
        box-shadow: 
            0 4px 15px rgba(98, 91, 139, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    50% {
        box-shadow: 
            0 4px 25px rgba(149, 138, 209, 0.5),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}

