/* style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #1a1a1a;
    color: #e0e0e0;
    height: 100vh;
    overflow: hidden;
}

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

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: #2d2d2d;
    border-right: 1px solid #404040;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid #404040;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: #fff;
}

.sidebar-header h2 i {
    color: #4a9eff;
    margin-right: 10px;
}

.model-info {
    font-size: 0.85rem;
    color: #888;
    background: #363636;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.history-item {
    padding: 10px;
    margin-bottom: 8px;
    background: #363636;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
}

.history-item:hover {
    background: #404040;
    border-color: #4a9eff;
}

.history-item i {
    color: #4a9eff;
    font-size: 0.9rem;
}

.history-item span {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #404040;
}

.new-chat-btn {
    width: 100%;
    padding: 12px;
    background: #4a9eff;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 15px;
}

.new-chat-btn:hover {
    background: #6aaeff;
    transform: translateY(-2px);
}

.new-chat-btn i {
    margin-right: 8px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #363636;
    border-radius: 8px;
    font-size: 0.85rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #666;
    transition: background 0.3s ease;
}

.status-dot.connected {
    background: #4ade80;
    box-shadow: 0 0 10px #4ade80;
}

.status-dot.disconnected {
    background: #f87171;
}

/* Main Chat Area */
.main-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #1a1a1a;
}

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

.welcome-message {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.welcome-message i {
    font-size: 4rem;
    color: #4a9eff;
    margin-bottom: 20px;
}

.welcome-message h3 {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 10px;
}

.welcome-message p {
    font-size: 1rem;
    color: #888;
}

.message {
    display: flex;
    gap: 15px;
    max-width: 80%;
    animation: slideIn 0.3s ease;
}

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

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-content {
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
    font-size: 0.95rem;
}

.user-message .message-content {
    background: #4a9eff;
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-message .message-content {
    background: #2d2d2d;
    color: #e0e0e0;
    border-bottom-left-radius: 4px;
}

.error-message {
    align-self: center;
    background: #442222;
    border-radius: 8px;
    padding: 12px 20px;
    color: #ff6b6b;
    font-size: 0.9rem;
}

.error-message i {
    margin-right: 8px;
}

.message-time {
    font-size: 0.7rem;
    color: #666;
    align-self: flex-end;
}

/* Input Area */
.input-area {
    padding: 20px;
    background: #2d2d2d;
    border-top: 1px solid #404040;
}

#chat-form {
    display: flex;
    gap: 10px;
    background: #363636;
    border-radius: 12px;
    padding: 5px;
}

#user-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 16px;
    color: #e0e0e0;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    resize: none;
    max-height: 150px;
    outline: none;
}

#user-input::placeholder {
    color: #666;
}

#send-btn {
    width: 50px;
    background: transparent;
    border: none;
    color: #4a9eff;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
}

#send-btn:hover {
    color: #6aaeff;
    background: #404040;
}

#send-btn:disabled {
    color: #666;
    cursor: not-allowed;
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding: 0 10px;
    font-size: 0.8rem;
    color: #666;
}

.typing-indicator {
    color: #4a9eff;
}

.typing-indicator i {
    margin-right: 5px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #2d2d2d;
}

::-webkit-scrollbar-thumb {
    background: #404040;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4a4a4a;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 0;
        display: none;
    }
    
    .message {
        max-width: 90%;
    }
}