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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fb;
    height: 100vh;
    overflow: hidden;
}

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

.sidebar {
    width: 260px;
    background-color: #202123;
    color: #fff;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.new-chat-header {
    padding: 0.5rem;
}

.new-chat-btn {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #4d4d4f;
    border-radius: 6px;
    background-color: transparent;
    color: #fff;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

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

.sessions-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.session-item {
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.25rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
}

.session-item:hover {
    background-color: #2a2b2e;
}

.session-item.active {
    background-color: #3f3f41;
}

.session-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.delete-session {
    background: none;
    border: none;
    color: #8e8ea0;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.session-item:hover .delete-session {
    opacity: 1;
}

.delete-session:hover {
    background-color: #494a4d;
    color: #ee6d6d;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #6e8efb, #a777e3);
    color: white;
    padding: 1rem 2rem;
    flex-shrink: 0;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1rem;
}

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

.message {
    max-width: 80%;
    padding: 0.8rem 1.2rem;
    border-radius: 18px;
    line-height: 1.5;
    position: relative;
    animation: fadeIn 0.3s ease-out;
}

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

.bot-message {
    align-self: flex-start;
    background-color: #f0f4ff;
    border-bottom-left-radius: 4px;
    color: #333;
}

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

.message-content p {
    margin: 0;
    white-space: pre-wrap;
}

.input-container {
    display: flex;
    padding: 1rem;
    background-color: #f8fafd;
    border-top: 1px solid #eaeef5;
    gap: 0.5rem;
}

#userInput {
    flex: 1;
    padding: 0.8rem 1.2rem;
    border: 1px solid #ddd;
    border-radius: 24px;
    resize: none;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    max-height: 150px;
    min-height: 20px;
}

#userInput:focus {
    border-color: #6e8efb;
    box-shadow: 0 0 0 2px rgba(110, 142, 251, 0.2);
}

#sendButton {
    background: linear-gradient(135deg, #6e8efb, #a777e3);
    color: white;
    border: none;
    border-radius: 24px;
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

#sendButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(110, 142, 251, 0.3);
}

#sendButton:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar,
.sessions-list::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track,
.sessions-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb,
.sessions-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.sessions-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive design */
@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        left: -260px;
        z-index: 100;
        transition: left 0.3s ease;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .message {
        max-width: 90%;
    }
    
    header h1 {
        font-size: 1.25rem;
    }
}