
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
:root {
    --primary-color: #062055; 
    --secdary-color: #060e40; 
    --info-color:#2E4470;
    --white-color:#fff;
    --light-gray:#D3D3D3;
    --gray-color:#808080;
    --black-color:#000;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--white-color);
    color: var(--black-color);
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    color: var(--white-color);
    background: var(--primary-color);
    padding: 8px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--light-gray);
}

.sidebar-header {
    text-align: center;
    padding: 12px;
    border-bottom: 1px solid var(--light-gray);
    margin-bottom: 12px;
}

.user-info {
    font-size: 12px;
    color: #8e8ea0;
    text-align: right;
    margin-top: 15px;
}

.logout-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-btn {
    width: 100%;
    padding: 8px 12px;
    background: var(--secdary-color);
    border: 1px solid var(--secdary-color);
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: var(--info-color);
    border-color: var(--info-color);
}

.new-chat-btn {
    padding: 12px;
    background: var(--light-gray);
    border: 1px solid var(--light-gray);
    color: var(--black-color);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    transition: background 0.3s;
}

.new-chat-btn:hover {
    background: var(--gray-color);
}

.search-box {
    padding: 8px 12px;
    background: var(--light-gray);
    border: 1px solid var(--gray-color);
    border-radius: 6px;
    margin-bottom: 12px;
    width: 100%;
    outline: none;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.chat-history::-webkit-scrollbar {
  width: 3px;
}


.chat-history::-webkit-scrollbar-track {
  background: transparent; 
}

.chat-history::-webkit-scrollbar-thumb {
  background: var(--light-gray);
  border-radius: 10px;
}

.chat-history::-webkit-scrollbar-thumb:hover {
  background: var(--gray-color);
}



.chat-history-item {
    padding: 12px;
    margin: 2px 0;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
    position: relative;
}

.chat-history-item:hover {
    background: var(--secdary-color);
}

.chat-history-item.active {
    background: var(--secdary-color);
}

.chat-history-item .title {
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 20px;
}

.chat-history-item .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.chat-history-item .date {
    font-size: 11px;
    color: var(--light-gray);
}

.chat-history-item .message-count {
    font-size: 11px;
    color: var(--light-gray);
    background: var(--info-color);
    padding: 2px 6px;
    border-radius: 10px;
}

.delete-chat-btn {
    position: absolute;
    right: 8px;
    top: 25%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--light-gray);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s, color 0.3s;
    padding: 4px;
}

.chat-history-item:hover .delete-chat-btn {
    opacity: 1;
}

.delete-chat-btn:hover {
    color: #ff6b6b;
}

/* Loading skeleton */
.skeleton {
    animation: skeleton-loading 1s linear infinite alternate;
}

@keyframes skeleton-loading {
    0% {
        background: var(--light-gray);
    }
    100% {
        background: var(--gray-color);
    }
}

.chat-skeleton {
    height: 60px;
    margin: 4px 12px;
    border-radius: 6px;
}

/* Stats section */
.stats-section {
    padding: 12px;
    border-top: 1px solid var(--gray-color);
    font-size: 12px;
    color: var(--light-gray);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin: 4px 0;
}

/* Main Chat Area */
.main-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.chat-header {
    padding: 20px;
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    font-size: 18px;
    font-weight: 600;
}

.chat-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    padding: 6px 12px;
    background: var(--light-gray);
    border: 1px solid var(--light-gray);
    color: var(--black-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s;
}

.action-btn:hover {
    background: var(--gray-color);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}

.message {
    display: flex;
    gap: 20px;
    padding: 20px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.message.user {
    padding: 20px 0;
}

.message.assistant {
    border-radius:8px;
    background: var(--light-gray);
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: #5436da;
    margin-top: 7px;
}

.message.assistant .message-avatar {
    background: #10a37f;
    margin-top: 4px;
}

.message-content {
    flex: 1;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message-timestamp {
    font-size: 11px;
    color: var(--gray-color);
    margin-top: 8px;
}

.message-content.loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.typing-indicator {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #8e8ea0;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.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(-10px); 
    }
}

/* Input Area */
.input-container {
    padding: 13px;
    border-top: 1px solid var(--light-gray);
}

.input-wrapper {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

.input-field {
    width: 100%;
    padding: 12px 50px 12px 16px;
    background: var(--light-gray);
    border: 1px solid var(--gray-color);
    border-radius: 8px;
    color: var(--black-color);
    font-size: 16px;
    resize: none;
    outline: none;
    font-family: inherit;
    max-height: 200px;
    overflow-y: hidden;
}

.input-field:focus {
    border-color: #10a37f;
}

.send-btn {
    position: absolute;
    right: 8px;
    bottom: 10px;
    width: 32px;
    height: 32px;
    background: #10a37f;
    border: none;
    border-radius: 4px;
    color: var(--white-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.send-btn:hover {
    background: #0d8f6f;
}

.send-btn:disabled {
    background: var(--gray-color);
    cursor: not-allowed;
}

/* Welcome Screen */
.welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
}

.welcome h1 {
    font-size: 32px;
    margin-bottom: 20px;
}

.welcome p {
    color: #8e8ea0; 
    margin-bottom: 40px;
}

.example-prompts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
    max-width: 600px;
    width: 100%;
}

.example-prompt {
    padding: 16px;
    background: var(--light-gray);
    border: 1px solid var(--gray-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.example-prompt:hover {
    border-color: var(--primary-color);
    background: var(--gray-color);
}

.error-message {
    color: #ff6b6b;
    padding: 12px;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 6px;
    margin: 10px 20px;
}

.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #10a37f;
    color: var(--white-color);
    padding: 12px 20px;
    border-radius: 6px;
    animation: slideIn 0.3s ease;
    z-index: 1000;
}

.notification.error {
    background: #ff6b6b;
}

@keyframes slideIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        z-index: 1000;
        transition: left 0.3s;
        height: 100vh;
    }

    .sidebar.open {
        left: 0;
    }

    .menu-toggle {
        display: block;
        position: fixed;
        top: 20px;
        left: 20px;
        z-index: 1001;
        background: var(--light-gray);
        border: 1px solid var(--gray-color);
        color: var(--white-color);
        padding: 8px;
        border-radius: 4px;
        cursor: pointer;
    }
}

.menu-toggle {
    display: none;
}
