/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0a0a0a;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* Узкий контейнер чата (как в GPT) */
.chat-wrapper {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background: #1e1e1e;
    border-radius: 28px;
    box-shadow: 0 25px 45px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    height: 90vh;
    max-height: 800px;
    overflow: hidden;
}

/* Шапка с логотипом слева */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #1a1a1a;
    border-bottom: 1px solid #2c2c2c;
    flex-shrink: 0;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-area img {
    height: 36px;
    width: auto;
    border-radius: 8px;
}

.brand {
    font-size: 1.3rem;
    font-weight: 600;
    background: linear-gradient(135deg, #e0e0e0, #b0b0b0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.3px;
}

.subtitle {
    font-size: 0.75rem;
    color: #888;
    background: #252525;
    padding: 4px 10px;
    border-radius: 40px;
}

/* Область сообщений */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

/* Стилизация скроллбара */
.chat-container::-webkit-scrollbar {
    width: 6px;
}
.chat-container::-webkit-scrollbar-track {
    background: #2c2c2c;
    border-radius: 3px;
}
.chat-container::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

/* Сообщения */
.message {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.message.user {
    flex-direction: row-reverse;
}

.avatar {
    width: 36px;
    height: 36px;
    background: #2d2d2d;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.message.user .avatar {
    background: #3a3a3a;
}

.bubble {
    background: #2a2a2a;
    padding: 10px 14px;
    border-radius: 20px;
    max-width: 80%;
    color: #e4e4e4;
    line-height: 1.45;
    font-size: 15px;
    word-wrap: break-word;
    box-shadow: 0 1px 1px rgba(0,0,0,0.2);
}

.message.user .bubble {
    background: #2b5278;
    color: white;
}

.message-time {
    font-size: 10px;
    color: #888;
    margin-top: 6px;
    text-align: right;
}

.message.user .message-time {
    text-align: left;
}

/* Индикатор печати */
.typing-indicator {
    display: flex;
    gap: 6px;
    padding: 10px 14px;
    background: #2a2a2a;
    border-radius: 20px;
    width: fit-content;
}
.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #aaa;
    border-radius: 50%;
    display: inline-block;
    animation: typing 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 typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-8px); opacity: 1; }
}

/* Кнопка прослушивания в сообщении */
.audio-control {
    margin-top: 10px;
}
.audio-control button {
    background: #3a3a3a;
    border: none;
    color: #ddd;
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 30px;
    cursor: pointer;
    transition: 0.2s;
}
.audio-control button:hover {
    background: #4a4a4a;
}

/* Область ввода */
.input-area {
    background: #1a1a1a;
    padding: 16px;
    border-top: 1px solid #2c2c2c;
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

textarea {
    flex: 1;
    background: #2c2c2c;
    border: none;
    border-radius: 28px;
    padding: 12px 18px;
    color: #f0f0f0;
    font-family: inherit;
    font-size: 15px;
    resize: none;
    outline: none;
    max-height: 120px;
}
textarea::placeholder {
    color: #888;
}
textarea:focus {
    background: #333;
}

button {
    background: #2c2c2c;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 44px;
    font-size: 22px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    color: #ddd;
}
button:hover {
    background: #3d3d3d;
    transform: scale(1.02);
}
.mic-button.listening {
    background: #b85c1a;
    color: white;
    animation: pulse 1.2s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(184, 92, 26, 0.6); }
    70% { box-shadow: 0 0 0 8px rgba(184, 92, 26, 0); }
    100% { box-shadow: 0 0 0 0 rgba(184, 92, 26, 0); }
}

/* Адаптация под мобильные */
@media (max-width: 600px) {
    body {
        padding: 8px;
    }
    .chat-wrapper {
        height: 95vh;
        border-radius: 20px;
    }
    .bubble {
        max-width: 90%;
    }
    .avatar {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    .logo-area img {
        height: 28px;
    }
    .brand {
        font-size: 1.1rem;
    }
    .subtitle {
        font-size: 0.65rem;
    }
}