* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #343541;
    color: #ececf1;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Стили боковой панели */
.sidebar {
    width: 260px;
    background-color: #202123;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all 0.3s ease;
}

/* ЛОГОТИП - начало */
.logo-container {
    padding: 20px 15px;
    text-align: center;
    border-bottom: 1px solid #4d4d4f;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 700;
    color: #10a37f;
    transition: all 0.3s ease;
}

.logo-icon {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #10a37f 0%, #5436da 100%);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.logo-icon::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 30% 30%, rgba(255,255,255,0.3) 1px, transparent 2px),
        radial-gradient(circle at 70% 70%, rgba(255,255,255,0.2) 1px, transparent 2px);
    background-size: 20px 20px;
}

.logo-icon i {
    position: relative;
    z-index: 1;
    animation: pulse 2s infinite;
}

.logo-text {
    position: relative;
}

.logo-text span {
    position: relative;
    z-index: 1;
}

.logo-text::after {
    content: "AI";
    position: absolute;
    top: -8px;
    right: -20px;
    font-size: 12px;
    font-weight: bold;
    color: #5436da;
    background-color: rgba(84, 54, 218, 0.2);
    padding: 2px 5px;
    border-radius: 4px;
    transform: rotate(15deg);
}

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

.logo:hover {
    transform: translateY(-3px);
    text-shadow: 0 0 10px rgba(16, 163, 127, 0.5);
}
/* ЛОГОТИП - конец */

.new-chat-btn {
    background-color: transparent;
    border: 1px solid #4d4d4f;
    color: #fff;
    padding: 12px;
    margin: 10px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.2s;
}

.new-chat-btn:hover {
    background-color: #2d2d2f;
}

.history {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
}

.history-item {
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item:hover {
    background-color: #2d2d2f;
}

.history-item.active {
    background-color: #343541;
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid #4d4d4f;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-footer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
}

.sidebar-footer-item:hover {
    background-color: #2d2d2f;
}

/* Основной контент */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100%;
}

.chat-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.message {
    padding: 24px 0;
    display: flex;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.user-message {
    background-color: #444654;
}

.assistant-message {
    background-color: #343541;
}

.avatar {
    width: 30px;
    height: 30px;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 20px;
    flex-shrink: 0;
}

.user-avatar {
    background-color: #5436da;
}

.assistant-avatar {
    background-color: #10a37f;
}

.message-content {
    flex-grow: 1;
    line-height: 1.6;
}

.message-content p {
    margin-bottom: 15px;
}

.message-content code {
    background-color: #2d2d2f;
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
}

.message-content pre {
    background-color: #2d2d2f;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 15px 0;
}

.input-container {
    padding: 20px 15px;
    display: flex;
    justify-content: center;
    background: linear-gradient(180deg, rgba(53,55,64,0) 0%, rgba(53,55,64,0.8) 50%, rgba(53,55,64,1) 100%);
}

.input-box {
    width: 100%;
    max-width: 800px;
    position: relative;
}

textarea {
    width: 100%;
    background-color: #40414f;
    border: none;
    border-radius: 8px;
    padding: 15px 50px 15px 15px;
    color: #ececf1;
    font-size: 16px;
    resize: none;
    max-height: 200px;
    height: 56px;
    outline: none;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

.send-btn {
    position: absolute;
    right: 12px;
    bottom: 12px;
    background: transparent;
    border: none;
    color: #8e8ea0;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover {
    background-color: #343541;
    color: #fff;
}

.mobile-menu-btn {
    display: none;
    position: absolute;
    top: 15px;
    left: 15px;
    background: #40414f;
    border: none;
    border-radius: 5px;
    width: 40px;
    height: 40px;
    color: #fff;
    cursor: pointer;
    z-index: 100;
}

/* Анимации */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background-color: #8e8ea0;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

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

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

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

/* Адаптивность */
@media (max-width: 900px) {
    .sidebar {
        position: absolute;
        left: -260px;
        z-index: 99;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .message {
        padding: 20px 10px;
    }
    
    .avatar {
        margin: 0 10px;
    }
    
    .logo-container {
        padding: 15px 10px;
    }
    
    .logo {
        font-size: 18px;
    }
    
    .logo-icon {
        width: 35px;
        height: 35px;
    }
}

@media (max-width: 600px) {
    .input-box {
        padding: 0 10px;
    }
    
    textarea {
        font-size: 14px;
    }
    
    .logo {
        font-size: 16px;
    }
    
    .logo-icon {
        width: 30px;
        height: 30px;
    }
    
    .logo-text::after {
        font-size: 10px;
        top: -10px;
        right: -15px;
    }
}