* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.chat-container {
    width: 100%;
    max-width: 900px;
    height: 90vh;
    max-height: 800px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.5s ease;
}

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

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.chat-header h1 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}



.status {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #4ade80;
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    display: flex;
    animation: fadeIn 0.3s ease;
}

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

.message.bot {
    justify-content: flex-start;
}

.message.user {
    justify-content: flex-end;
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
}

.bot .message-content {
    background: white;
    border: 1px solid #e5e7eb;
    color: #1f2937;
    border-bottom-left-radius: 4px;
}

.user .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.emergency {
    background: #fee2e2;
    border-left: 4px solid #dc2626;
    padding: 12px;
    margin-top: 10px;
    border-radius: 8px;
}

.system-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.system-btn {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}
  
.system-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
}

.quick-btn {
    background: #e5e7eb;
    border: none;
    padding: 6px 12px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 0.85rem;
    margin-right: 8px;
    margin-top: 8px;
    transition: all 0.3s;
}

.quick-btn:hover {
    background: #667eea;
    color: white;
}

.chat-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
}

.chat-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.send-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.send-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 18px;
    width: fit-content;
    border: 1px solid #e5e7eb;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

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

/* Адаптивность для планшетов */
@media (max-width: 768px) {
    .message-content {
        max-width: 85%;
        font-size: 0.9rem;
    }
    
    .system-btn, .quick-btn {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
    
    .send-btn {
        padding: 12px 20px;
    }
    
    .chat-header h1 {
        font-size: 1.3rem;
    }
}

/* Адаптивность для телефонов */
@media (max-width: 480px) {
    .chat-header h1 {
        font-size: 1.2rem;
    }
    
    .chat-header p {
        font-size: 0.75rem;
    }
    
    .message-content {
        max-width: 90%;
        font-size: 0.85rem;
    }
    
    .system-buttons {
        flex-direction: column;
    }
    
    .system-buttons button {
        width: 100%;
    }
    
    .send-btn {
        padding: 12px 16px;
        font-size: 0.85rem;
    }
}

/* Кастомный скроллбар */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #5a67d8;
}

/* Стили для иконок Font Awesome */
.fas, .far, .fab {
    margin-right: 6px;
}

/* Анимация для иконки в индикаторе печати */
.typing-indicator .fa-brain {
    margin-right: 8px;
    color: #667eea;
    animation: pulse 1s ease-in-out infinite;
}

/* Убираем стандартный отступ у кнопок с иконками */
.system-btn .fas,
.quick-btn .fas,
.send-btn .fas {
    margin-right: 6px;
}

/* Делаем иконки в сообщениях чуть ярче */
.message-content .fas {
    color: #667eea;
}

.user .message-content .fas {
    color: white;
}

/* Иконка отправки*/
.send-btn .fa-paper-plane {
    transition: transform 0.2s;
}

.send-btn:hover .fa-paper-plane {
    transform: translateX(3px);
}