/* ============================================================
   СТИЛИ ДЛЯ СТРАНИЦЫ ИИ-АССИСТЕНТА (ВСТРОЕННЫЕ)
   ============================================================ */

:root {
    --primary: #1a4f7a;
    --primary-dark: #0d3b5e;
    --primary-light: #3a7ca5;
    --primary-gradient: linear-gradient(135deg, #1a4f7a 0%, #0d3b5e 100%);
    --dark: #0d1b2a;
    --light: #f7fafc;
    --gray: #718096;
    --white: #ffffff;
    --border: #e2e8f0;
}

/* ===== ШРИФТЫ ===== */
.chat-page * {
    font-family: 'Inter', sans-serif;
}

.chat-page h1,
.chat-page h2,
.chat-page h3,
.chat-page h4,
.chat-page h5,
.chat-page .hero-badge {
    font-family: 'Playfair Display', 'Georgia', serif !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
}

.chat-page .lead,
.chat-page .chat-info,
.chat-page .chat-header .name,
.chat-page .chat-header .status,
.chat-page .message .timestamp,
.chat-page .model-badge {
    font-family: 'Cormorant Garamond', 'Georgia', serif !important;
    font-weight: 500 !important;
    letter-spacing: 0.02em !important;
}

/* ===== ГЕРОЙ-СЕКЦИЯ (СВЕТЛАЯ) ===== */
.chat-hero {
    background: linear-gradient(160deg, #e8edf3 0%, #d5dfea 50%, #e0e8f0 100%);
    padding: 60px 0 50px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    border-bottom: 2px solid rgba(26, 79, 122, 0.08);
}

.chat-hero::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(26, 79, 122, 0.04) 0%, transparent 70%);
    border-radius: 50%;
    animation: floatHero 20s ease-in-out infinite;
}

.chat-hero::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(26, 79, 122, 0.03) 0%, transparent 70%);
    border-radius: 50%;
    animation: floatHero 15s ease-in-out infinite reverse;
}

@keyframes floatHero {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, -20px) scale(1.05); }
}

.chat-hero .container {
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-block;
    font-family: 'Cormorant Garamond', 'Georgia', serif !important;
    font-weight: 700 !important;
    font-size: 0.8rem !important;
    letter-spacing: 0.15em !important;
    text-transform: uppercase !important;
    background: rgba(26, 79, 122, 0.1);
    color: var(--primary);
    padding: 8px 28px;
    border-radius: 4px;
    border: 1px solid rgba(26, 79, 122, 0.08);
    margin-bottom: 16px;
}

.chat-hero h1 {
    color: #0d1b2a;
    font-size: 3rem;
}

.chat-hero h1 .gold {
    font-family: 'Playfair Display', 'Georgia', serif !important;
    font-weight: 700 !important;
    font-style: italic !important;
    color: var(--primary);
    letter-spacing: 0.03em !important;
}

.chat-hero .lead {
    color: #1a2a3a;
    opacity: 0.7;
    font-size: 1.3rem;
    font-style: italic;
}

/* ===== КОНТЕЙНЕР ЧАТА ===== */
.chat-container {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    max-width: 900px;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.chat-container:hover {
    border-color: rgba(26, 79, 122, 0.1);
    box-shadow: 0 8px 32px rgba(26, 79, 122, 0.04);
}

/* ===== ШАПКА ЧАТА ===== */
.chat-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 24px;
    background: var(--primary-gradient);
    color: white;
}

.chat-header .avatar {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.chat-header .info {
    flex: 1;
}

.chat-header .name {
    font-weight: 600;
    font-size: 1rem;
}

.chat-header .status {
    font-size: 0.75rem;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-header .status .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #34d399;
    border-radius: 50%;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.btn-clear {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: white;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
}

.btn-clear:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-clear i {
    font-size: 0.9rem;
}

/* ===== СООБЩЕНИЯ ===== */
.chat-messages {
    padding: 20px 24px;
    max-height: 450px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

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

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    padding: 12px 18px;
    border-radius: 14px;
    position: relative;
    animation: fadeInUp 0.3s ease;
}

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

.message.user {
    align-self: flex-end;
    background: var(--primary-gradient);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.user .timestamp {
    color: rgba(255, 255, 255, 0.6);
}

.message.assistant {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.8);
    color: var(--dark);
    border: 1px solid rgba(26, 79, 122, 0.06);
    border-bottom-left-radius: 4px;
}

.message.assistant .timestamp {
    color: var(--gray);
}

.message .timestamp {
    font-size: 0.6rem;
    margin-top: 6px;
    opacity: 0.7;
    font-family: 'Inter', sans-serif !important;
}

.message .model-badge {
    font-size: 0.55rem;
    color: var(--gray);
    margin-top: 2px;
    opacity: 0.6;
    font-family: 'Inter', sans-serif !important;
}

.message div {
    font-size: 0.95rem;
    line-height: 1.6;
}

.message.assistant div {
    color: var(--dark);
}

.message.user div {
    color: white;
}

/* ===== ИНДИКАТОР ПЕЧАТИ ===== */
.typing-indicator {
    display: none;
    padding: 8px 24px 12px;
    gap: 4px;
    align-items: center;
}

.typing-indicator .dot-typing {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--gray);
    border-radius: 50%;
    animation: typing-bounce 1.4s ease-in-out infinite;
}

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

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

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

@keyframes typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* ===== ПОЛЕ ВВОДА ===== */
.chat-input-area {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.4);
}

.chat-input-area textarea {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    resize: none;
    max-height: 120px;
    min-height: 44px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.6);
}

.chat-input-area textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 79, 122, 0.1);
    background: white;
}

.chat-input-area textarea::placeholder {
    color: var(--gray);
    opacity: 0.6;
}

.btn-send {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 24px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
}

.btn-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(26, 79, 122, 0.25);
}

.btn-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-send i {
    font-size: 1.1rem;
}

/* ===== ИНФОРМАЦИЯ ВНИЗУ ===== */
.chat-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--gray);
    background: rgba(255, 255, 255, 0.2);
}

.chat-info i {
    color: var(--primary);
    font-size: 1rem;
}

/* ===== АДАПТИВ ===== */
@media (max-width: 768px) {
    .chat-hero {
        padding: 40px 0 30px;
    }
    .chat-hero h1 {
        font-size: 2.2rem;
    }
    .chat-hero .lead {
        font-size: 1.1rem;
    }
    .chat-container {
        border-radius: 12px;
    }
    .chat-header {
        padding: 14px 16px;
        flex-wrap: wrap;
    }
    .chat-header .name {
        font-size: 0.9rem;
    }
    .btn-clear {
        font-size: 0.7rem;
        padding: 4px 10px;
    }
    .btn-clear span {
        display: none;
    }
    .chat-messages {
        padding: 14px 16px;
        max-height: 350px;
    }
    .message {
        max-width: 90%;
        padding: 10px 14px;
    }
    .message div {
        font-size: 0.9rem;
    }
    .chat-input-area {
        padding: 12px 16px;
        flex-wrap: wrap;
    }
    .chat-input-area textarea {
        font-size: 0.85rem;
        min-height: 40px;
    }
    .btn-send {
        padding: 0 16px;
        font-size: 0.8rem;
    }
    .btn-send span {
        display: none;
    }
    .chat-info {
        font-size: 0.7rem;
        padding: 10px 16px;
        flex-wrap: wrap;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .chat-hero {
        padding: 30px 0 20px;
    }
    .chat-hero h1 {
        font-size: 1.8rem;
    }
    .chat-hero .lead {
        font-size: 0.95rem;
    }
    .hero-badge {
        font-size: 0.65rem !important;
        padding: 6px 18px;
    }
    .chat-messages {
        max-height: 280px;
        padding: 12px;
    }
    .message {
        max-width: 95%;
        padding: 8px 12px;
    }
    .message div {
        font-size: 0.85rem;
    }
    .chat-input-area {
        padding: 10px 12px;
    }
    .chat-input-area textarea {
        font-size: 0.8rem;
        min-height: 36px;
        padding: 8px 12px;
    }
    .btn-send {
        padding: 0 12px;
        font-size: 0.75rem;
    }
}