body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: #0f172a;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* Боковая панель */
.sidebar {
    width: 260px;
    background: #0f172a;
    color: white;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #1e293b;
    transition: transform 0.3s ease;
    z-index: 2000;
}

.sidebar-header {
    padding: 20px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1e293b;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    color: #818cf8;
}

.new-chat-btn {
    width: 32px;
    height: 32px;
    border-radius: 16px;
    background: #4f46e5;
    color: white;
    border: none;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2001;
}

.new-chat-btn:hover {
    background: #6366f1;
    transform: scale(1.05);
}

.chats-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.chat-item {
    padding: 12px 15px;
    margin-bottom: 5px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    color: #94a3b8;
    font-size: 14px;
    border: 1px solid transparent;
}

.chat-item:hover {
    background: #1e293b;
    color: white;
}

.chat-item.active {
    background: #4f46e5;
    color: white;
    border-color: #818cf8;
}

.chat-item > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.chat-item span:first-child {
    flex: 1;
    cursor: pointer;
}

.chat-item span:last-child {
    cursor: pointer;
    color: #ef4444;
    font-size: 16px;
    font-weight: bold;
    padding: 0 4px;
}

.chat-item span:last-child:hover {
    color: #ff6b6b;
}

/* Основная область чата */
.chat-container {
    flex: 1;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.menu-btn {
    display: none;
    position: absolute;
    top: 15px;
    left: 15px;
    width: 40px;
    height: 40px;
    border-radius: 20px;
    background: #4f46e5;
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.chat-header {
    background: #0f172a;
    color: white;
    padding: 20px 20px 15px;
    text-align: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    position: relative;
}

.chat-header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 500;
    letter-spacing: -0.5px;
    color: white;
    line-height: 1.2;
}

.subtitle {
    font-size: 12px;
    opacity: 0.7;
    margin: 5px 0 0;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.divider {
    width: 40px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #4f46e5, transparent);
    margin: 10px auto;
}

.description {
    font-size: 13px;
    line-height: 1.4;
    margin: 3px 0;
    opacity: 0.9;
    font-weight: 300;
}

.description strong {
    font-weight: 600;
    color: #818cf8;
}

.status {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    margin: 10px auto 5px;
    box-shadow: 0 0 8px #10b981;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
    100% { opacity: 1; transform: scale(1); }
}

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

.message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 18px;
    word-wrap: break-word;
    animation: fadeIn 0.3s ease;
    font-size: 14px;
    line-height: 1.4;
}

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

.user-message {
    align-self: flex-end;
    background: #4f46e5;
    color: white;
    border-bottom-right-radius: 4px;
}

.bot-message {
    align-self: flex-start;
    background: white;
    color: #0f172a;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.input-area {
    display: flex;
    padding: 15px;
    gap: 10px;
    background: white;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

#messageInput {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 30px;
    outline: none;
    font-size: 14px;
    transition: all 0.3s;
    background: #f8fafc;
    font-style: italic;
}

#messageInput:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
    font-style: normal;
}

#sendButton {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 25px;
    background: #4f46e5;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    flex-shrink: 0;
}

#sendButton:hover {
    transform: scale(1.05);
    background: #6366f1;
}

#sendButton:disabled {
    opacity: 0.5;
    transform: none;
    box-shadow: none;
}

/* Уменьшение шапки при скролле */
.chat-header.compact {
    padding: 8px 15px 6px;
}

.chat-header.compact h1 {
    font-size: 20px;
}

.chat-header.compact .subtitle {
    font-size: 10px;
    margin: 2px 0 0;
}

.chat-header.compact .divider {
    width: 30px;
    margin: 5px auto;
}

.chat-header.compact .description {
    font-size: 11px;
    margin: 2px 0;
}

.chat-header.compact .status {
    width: 4px;
    height: 4px;
    margin: 5px auto 2px;
}

/* Мобильная версия */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 2000;
        transform: translateX(-100%);
        box-shadow: 2px 0 10px rgba(0,0,0,0.3);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .menu-btn {
        display: flex;
    }
    
    .chat-header {
        padding-left: 60px;
    }
}
