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

:root {
    /* Пастельные тона */
    --primary: #a8d8ea;
    --primary-hover: #7fb3d5;
    --bg-light: #fef9f3;
    --bg-white: #ffffff;
    --text-dark: #4a5568;
    --text-light: #718096;
    --border: #e2e8f0;
    --success: #9ae6b4;
    --error: #fc8181;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-light);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    line-height: 1.6;
}

/* Контейнер - адаптивный */
.container {
    width: 100%;
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Мобильная версия по умолчанию */
@media (max-width: 768px) {
    .container {
        max-width: 100%;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
    }
}

/* Десктопная версия */
@media (min-width: 769px) {
    .container {
        max-width: 800px;
        height: 600px;
    }
}

/* Хедер */
.chat-header {
    background: var(--bg-white);
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bot-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.header-info h1 {
    color: var(--text-dark);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 2px;
}

.status {
    color: var(--success);
    font-size: 12px;
    font-weight: 500;
}

/* Чат контейнер */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-light);
}

.chat-container::-webkit-scrollbar {
    width: 6px;
}

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

.chat-container::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* Welcome screen */
.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-light);
}

.welcome-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.welcome-screen h2 {
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 20px;
    font-weight: 600;
}

.welcome-screen p {
    font-size: 14px;
}

/* Сообщения */
.message {
    margin-bottom: 12px;
    animation: fadeIn 0.3s ease-out;
}

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

.message-bubble {
    background: var(--bg-white);
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-dark);
    max-width: 90%;
    word-wrap: break-word;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

@media (min-width: 769px) {
    .message-bubble {
        max-width: 70%;
    }
}

.message-bubble b {
    color: var(--text-dark);
    font-weight: 600;
}

.message-bubble i {
    color: var(--text-light);
}

.message-bubble a {
    color: var(--primary-hover);
    text-decoration: none;
}

.message-bubble a:hover {
    text-decoration: underline;
}

.error-bubble {
    background: #fff5f5 !important;
    border-color: var(--error) !important;
    color: #c53030 !important;
}

/* Кнопки */
.input-container {
    padding: 16px 20px;
    background: var(--bg-white);
    border-top: 1px solid var(--border);
}

.btn-start {
    width: 100%;
    padding: 14px 24px;
    background: var(--primary);
    color: var(--text-dark);
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-start:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-start:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 18px;
}

/* Меню */
.menu-container {
    padding: 16px 20px;
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    max-height: 40vh;
    overflow-y: auto;
}

.menu-grid {
    display: grid;
    gap: 8px;
}

/* Мобильная версия - 1 колонка */
@media (max-width: 768px) {
    .menu-grid {
        grid-template-columns: 1fr;
    }
}

/* Десктопная версия - 2 колонки */
@media (min-width: 769px) {
    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.menu-btn {
    padding: 12px 16px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    font-size: 14px;
    text-align: left;
}

.menu-btn:hover {
    background: var(--bg-white);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.menu-btn:active {
    transform: translateY(0);
}

.menu-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.menu-text {
    flex: 1;
    text-align: left;
}

/* Лоадер */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
