﻿
:root {
    --primary-color: #4361ee;
    --primary-dark: #3a56d4;
    --secondary-color: #222;
    --dark-color: #121212;
    --darker-color: #0a0a0a;
    --light-gray: #2a2a2a;
    --border-color: #333;
    --text-color: #f8f9fa;
    --text-muted: #a0a0a0;
    --bot-message-bg: #2d2d3d;
    --user-message-bg: #4361ee;
    --highlight-color: #ff7700;
}

body {
    background-color: var(--dark-color);
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100vh;
    overflow: hidden;
}

.chat-container {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

/* Sidebar styles */
.sidebar {
    background-color: var(--darker-color);
    border-right: 1px solid var(--border-color);
    transition: all 0.3s;
    z-index: 1040;
}

.sidebar-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

    .sidebar-header .logo {
        font-size: 1.5rem;
        font-weight: 600;
        color: var(--text-color);
        display: flex;
        align-items: center;
        gap: 10px;
    }

        .sidebar-header .logo span {
            color: var(--highlight-color);
        }

.new-chat-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 12px;
    font-size: 14px;
    font-weight: 500;
    width: 100%;
    margin-top: 15px;
    transition: all 0.2s;
}

    .new-chat-btn:hover {
        background-color: var(--primary-dark);
    }

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 15px 0;
}

.history-section {
    padding: 0 15px 15px;
    margin-bottom: 10px;
}

.history-section-title {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding-left: 10px;
    letter-spacing: 1px;
}

.chat-history-item {
    padding: 12px 15px;
    border-radius: 4px;
    margin: 2px 0;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-muted);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

    .chat-history-item:hover, .chat-history-item.active {
        background-color: var(--light-gray);
        color: var(--text-color);
    }

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-muted);
}

/* Main chat area */
.main-content {
    background-color: var(--dark-color);
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 15px 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--darker-color);
}

.hamburger-menu {
    cursor: pointer;
    color: var(--text-color);
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

    .hamburger-menu:hover {
        background-color: var(--light-gray);
    }

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.model-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--light-gray);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
}

.model-dropdown {
    background-color: transparent;
    border: none;
    color: var(--text-color);
    font-size: 14px;
    outline: none;
}

    .model-dropdown option {
        background-color: var(--darker-color);
    }

.header-actions .btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--light-gray);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s;
}

    .header-actions .btn-icon:hover {
        background-color: var(--primary-color);
    }

.chat-area {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message {
    max-width: 85%;
    padding: 15px;
    border-radius: 12px;
    line-height: 1.5;
    font-size: 14px;
    position: relative;
}

.bot-message {
    align-self: flex-start;
    background-color: var(--bot-message-bg);
    border-bottom-left-radius: 4px;
}

.user-message {
    align-self: flex-end;
    background-color: var(--user-message-bg);
    border-bottom-right-radius: 4px;
}

.message-container {
    display: flex;
    align-items: flex-start;
}

.bot-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    margin-right: 10px;
    background-color: var(--highlight-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 16px;
}

.message-actions {
    position: absolute;
    right: 15px;
    top: 5px;
    display: none;
}

.message:hover .message-actions {
    display: flex;
    gap: 5px;
}

.message-action-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background-color: rgba(0,0,0,0.1);
    cursor: pointer;
    color: inherit;
    font-size: 12px;
}

.bot-message .message-action-btn:hover {
    background-color: rgba(0,0,0,0.2);
}

.user-message .message-action-btn:hover {
    background-color: rgba(255,255,255,0.2);
}

.input-area {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background-color: var(--darker-color);
}

.input-container {
    display: flex;
    align-items: flex-end;
    background-color: var(--light-gray);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px 16px;
}

.message-input {
    flex: 1;
    border: none;
    background-color: transparent;
    padding: 10px;
    font-size: 14px;
    resize: none;
    max-height: 150px;
    min-height: 40px;
    outline: none;
    color: var(--text-color);
}

.input-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-action-btn {
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

    .input-action-btn:hover {
        color: var(--text-color);
        background-color: rgba(255,255,255,0.1);
    }

.send-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 8px;
    font-weight: 500;
}

    .send-btn:hover {
        background-color: var(--primary-dark);
    }

    .send-btn:disabled {
        background-color: var(--light-gray);
        color: var(--text-muted);
        cursor: not-allowed;
    }

    .send-btn i {
        margin-right: 0;
    }

    .send-btn.extended i {
        margin-right: 8px;
    }

.welcome-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 20px;
}

.welcome-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
}

.welcome-icon {
    font-size: 48px;
    margin-bottom: 20px;
    color: var(--highlight-color);
}

.welcome-title {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    background: linear-gradient(to right, var(--primary-color), var(--highlight-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 10px;
    max-width: 600px;
}

.welcome-badges {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.feature-badge {
    background-color: var(--light-gray);
    color: var(--text-color);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    max-width: 900px;
    width: 100%;
}

.example-card {
    background-color: var(--bot-message-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: left;
    height: 100%;
    display: flex;
    flex-direction: column;
}

    .example-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    }

.example-card-icon {
    font-size: 24px;
    margin-bottom: 15px;
    color: var(--highlight-color);
}

.example-card h3 {
    font-size: 16px;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--primary-color);
}

.example-card p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 10px;
    flex: 1;
}

.example-questions {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.example-question {
    font-size: 13px;
    color: var(--primary-color);
    padding: 6px 10px;
    border-radius: 4px;
    background-color: rgba(67, 97, 238, 0.1);
    cursor: pointer;
    transition: all 0.2s;
}

    .example-question:hover {
        background-color: rgba(67, 97, 238, 0.2);
    }

.typing-indicator {
    padding: 15px;
    display: flex;
    gap: 5px;
}

    .typing-indicator span {
        width: 8px;
        height: 8px;
        background-color: var(--text-muted);
        border-radius: 50%;
        display: inline-block;
        animation: bounce 1.5s infinite ease-in-out;
    }

        .typing-indicator span:nth-child(1) {
            animation-delay: 0s;
        }

        .typing-indicator span:nth-child(2) {
            animation-delay: 0.2s;
        }

        .typing-indicator span:nth-child(3) {
            animation-delay: 0.4s;
        }

@keyframes bounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-5px);
    }
}

/* Markdown styling */
.markdown-content code {
    background-color: rgba(0,0,0,0.2);
    padding: 2px 5px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
}

.markdown-content pre {
    background-color: rgba(0,0,0,0.2);
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    overflow-x: auto;
}

    .markdown-content pre code {
        background-color: transparent;
        padding: 0;
    }

.markdown-content p {
    margin-bottom: 10px;
}

.markdown-content ul, .markdown-content ol {
    margin-bottom: 10px;
    padding-left: 20px;
}

.markdown-content h1, .markdown-content h2, .markdown-content h3,
.markdown-content h4, .markdown-content h5, .markdown-content h6 {
    margin-top: 16px;
    margin-bottom: 10px;
}

.markdown-content table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 10px;
}

    .markdown-content table th, .markdown-content table td {
        border: 1px solid var(--border-color);
        padding: 8px;
    }

    .markdown-content table th {
        background-color: rgba(0,0,0,0.2);
    }

/* Overlay for mobile sidebar */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1030;
    display: none;
}

/* Mobile styles */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px !important;
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    }

        .sidebar.show {
            left: 0;
        }

    .sidebar-overlay.show {
        display: block;
    }

    .examples-grid {
        grid-template-columns: 1fr;
    }

    .welcome-title {
        font-size: 1.8rem;
    }

    .welcome-subtitle {
        font-size: 1rem;
    }
}
