* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    transition: all 0.3s;
}

body.dark {
    background: #1a1a1a;
    color: #fff;
}

.container {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 250px;
    background: #2c3e50;
    color: white;
    padding: 20px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
}

.new-chat-btn {
    width: 100%;
    padding: 10px;
    background: #3498db;
    border: none;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 20px;
}

.chat-item {
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 5px;
    cursor: pointer;
}

.chat-item.active {
    background: #34495e;
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.header {
    background: white;
    padding: 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body.dark .header {
    background: #2d2d2d;
    border-color: #444;
}

.theme-btn {
    background: none;
    border: 1px solid #ddd;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
}

.messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 70%;
    padding: 15px;
    border-radius: 10px;
    animation: fadeIn 0.3s;
}

.user-msg {
    align-self: flex-end;
    background: #3498db;
    color: white;
}

.bot-msg {
    align-self: flex-start;
    background: #ecf0f1;
    color: #333;
}

body.dark .bot-msg {
    background: #34495e;
    color: white;
}

.msg-content {
    margin-bottom: 5px;
}

.msg-time {
    font-size: 12px;
    opacity: 0.7;
}

.input-area {
    padding: 20px;
    background: white;
    border-top: 1px solid #ddd;
}

body.dark .input-area {
    background: #2d2d2d;
    border-color: #444;
}

.typing {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
    color: #666;
}

.dots span {
    animation: blink 1.4s infinite;
}

.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }

.input-container {
    display: flex;
    gap: 10px;
}

textarea {
    flex: 1;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: none;
    height: 60px;
    font-family: inherit;
}

body.dark textarea {
    background: #3d3d3d;
    border-color: #555;
    color: white;
}

button {
    padding: 15px 25px;
    background: #3498db;
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
    }
    .message {
        max-width: 85%;
    }
}