:root {
    --primary: #5F63F2;
    --primary-light: #8A8DF5;
    --secondary: #FF6B6B;
    --accent: #4ECDC4;
    --bg: #F8FAFF;
    --card-bg: #FFFFFF;
    --text: #2D3748;
    --text-light: #718096;
    --border: #E2E8F0;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* Общие стили для кнопок */
button {
    cursor: pointer;
    transition: all .2s;
}

/* Боковое меню */
.sidebar,.sidebar-overlay {
    position: fixed;
    z-index: 1000;
    top: 0;
    height: 100%;
}

.sidebar {
    right: -320px;
    width: 320px;
    background: var(--card-bg);
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.1);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.sidebar.active {
    transform: translateX(-320px);
}

.sidebar-overlay {
    left: 0;
    right: 0;
    background: rgba(0,0,0,.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.sidebar-header h3 {
    font-size: 20px;
    font-weight: 600;
}

.close-sidebar {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-light);
}

.menu-item {
    display: block;
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: all .2s;
}

.menu-item:hover {
    background: var(--bg);
    color: var(--primary);
}

/* Основной чат */
.chat-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: 100vh;
    max-height: 900px;
    margin: 0 auto;
    background: var(--card-bg);
    box-shadow: var(--shadow);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chat-header,.input-container {
    padding: 16px 24px;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.chat-header {
    position: relative;
}

.menu-button {
    background: none;
    border: none;
    margin-right: 16px;
    color: var(--text-light);
}

.menu-button:hover {
    color: var(--primary);
}

.ai-info {
    display: flex;
    align-items: center;
}

.ai-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg,#F8FAFF 0%,#E0E7FF 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.ai-avatar svg {
    width: 24px;
    height: 24px;
}

.ai-name {
    font-weight: 600;
    font-size: 18px;
}

.chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    max-width: 80%;
    padding: 16px 20px;
    border-radius: 20px;
    line-height: 1.5;
    animation: fadeIn .3s ease;
    font-size: 15px;
    position: relative;
}

.ai-message {
    align-self: flex-start;
    background: #F8FAFF;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(95,99,242,.1);
}

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

.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.quick-reply {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    transition: all .2s;
}

.quick-reply:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
    color: #fff;
    transform: translateY(-2px);
}

.input-container {
    border-top: 1px solid var(--border);
    gap: 12px;
}

#userInput {
    flex: 1;
    padding: 14px 20px;
    border: 1px solid var(--border);
    border-radius: 24px;
    font-size: 15px;
    outline: none;
    transition: all .2s;
    background: var(--bg);
}

#userInput:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 2px rgba(95,99,242,.2);
}

#sendButton {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

#sendButton:hover {
    background: var(--primary-light);
    transform: scale(1.05);
}

#sendButton svg {
    width: 20px;
    height: 20px;
}

/* Блоки с контентом */
.result-container,.page-content {
    padding: 24px;
}

.result-container {
    background: var(--bg);
    border-top: 1px solid var(--border);
    display: none;
}

.result-content,.review-card,.info-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.edit-answers-btn,.add-review-btn,.restart-button {
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    font-weight: 500;
    transition: all .2s;
}

.edit-answers-btn {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text);
}

.edit-answers-btn:hover {
    background: var(--bg);
    border-color: var(--primary-light);
    color: var(--primary);
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px) }
    to { opacity: 1; transform: translateY(0) }
}

.typing-indicator {
    display: flex;
    padding: 12px 16px;
    background: #F8FAFF;
    border-radius: 20px;
    align-self: flex-start;
    margin-bottom: 16px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--primary-light);
    border-radius: 50%;
    margin: 0 3px;
    animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s }
.typing-dot:nth-child(2) { animation-delay: .2s }
.typing-dot:nth-child(3) { animation-delay: .4s }

@keyframes typingAnimation {
    0%,60%,100% { transform: translateY(0) }
    30% { transform: translateY(-5px) }
}

/* Сообщения об ошибках */
.error-message,.message.ai-message.error {
    color: #d32f2f;
    background-color: #ffebee;
    border-left: 3px solid #d32f2f;
    padding-left: 15px;
}

.error-message {
    margin: 10px 0;
}

/* Кнопки */
.button-container {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.restart-button,.save-button {
    background-color: var(--primary);
    color: #fff;
}

.retry-button {
    background-color: var(--accent);
    color: #fff;
}

.support-button {
    background-color: var(--secondary);
    color: #fff;
}

.restart-button,.retry-button,.save-button,.support-button {
    padding: 10px 20px;
    border-radius: 20px;
    border: none;
    font-weight: 500;
}

/* Секции */
.plan-section,.payment-section {
    margin: 15px 0;
    padding: 15px;
    border-radius: 8px;
}

.plan-section {
    background: #f8f9fa;
}

.payment-section {
    background: #f8f9fa;
    text-align: center;
    border: 1px solid #e0e0e0;
}

.payment-button {
    background-color: var(--primary);
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(95,99,242,.2);
}

.payment-button:hover {
    background-color: #4a4fd1;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(95,99,242,.3);
}

.payment-note {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .chat-container {
        border-radius: 0;
        max-height: 100vh;
        height: 100vh;
    }
    
    .sidebar {
        width: 280px;
    }
    
    .message {
        max-width: 90%;
    }
    
    .chat-header,.chat-messages,.input-container {
        padding: 16px;
    }
}

.no-scroll {
    overflow: hidden;
}

/* Стили для страниц */
.page-content {
    flex: 1;
    overflow-y: auto;
}

.reviews-container,.custom-content {
    max-width: 800px;
    margin: 0 auto;
}

.reviews-container h2,.custom-content h2 {
    margin-bottom: 24px;
    color: var(--primary);
    text-align: center;
}

.review-card {
    margin-bottom: 20px;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.review-author {
    font-weight: 600;
}

.review-rating {
    color: #FFC107;
    font-size: 18px;
}

.review-text {
    margin-bottom: 12px;
    line-height: 1.6;
}

.review-date {
    font-size: 14px;
    color: var(--text-light);
    text-align: right;
}

.add-review-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    margin-top: 16px;
}

.add-review-btn:hover {
    background: var(--primary-light);
}

/* Свободная страница */
.custom-content p {
    margin-bottom: 16px;
    line-height: 1.6;
}

.info-card h3 {
    margin-bottom: 16px;
    color: var(--primary);
}

.info-card ul {
    padding-left: 20px;
    margin-bottom: 0;
}

.info-card li {
    margin-bottom: 8px;
}

.image-card {
    margin-top: 24px;
    text-align: center;
}

.image-card img {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 8px;
    box-shadow: var(--shadow);
}

.image-caption {
    font-size: 14px;
    color: var(--text-light);
}