:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f7f7f8;
    --bg-sidebar: #202123;
    --bg-input: #40414f;
    --border-color: #e5e5e5;
    --border-dark: #343541;
    --text-primary: #343541;
    --text-secondary: #6e6e80;
    --text-light: #8e8ea0;
    --text-sidebar: #ececf1;
    --accent-primary: #10a37f;
    --accent-hover: #1a7f64;
    --message-bot: #f7f7f8;
    --message-user: #f2f2f2;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

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

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    color: var(--text-sidebar);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-dark);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 8px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-primary), #2ecc71);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon i {
    font-size: 16px;
}

.company-name {
    font-size: 18px;
    font-weight: 600;
    background: linear-gradient(135deg, #fff, #ececf1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.new-chat-btn {
    width: 100%;
    padding: 12px;
    background-color: transparent;
    color: var(--text-sidebar);
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.new-chat-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--text-light);
}

.services-section {
    padding: 16px;
    border-bottom: 1px solid var(--border-dark);
}

.section-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    margin-bottom: 12px;
}

.services-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.service-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.service-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.service-item.active {
    background-color: rgba(16, 163, 127, 0.2);
    color: var(--accent-primary);
}

.service-item i {
    width: 16px;
    text-align: center;
    font-size: 14px;
}

.company-info {
    padding: 16px;
    flex-grow: 1;
}

.info-card {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-dark);
    border-radius: 8px;
    padding: 16px;
    font-size: 14px;
}

.info-card p {
    margin-bottom: 8px;
}

.info-text {
    color: var(--text-light);
    font-size: 13px;
    margin-bottom: 16px !important;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    font-size: 13px;
}

.contact-item i {
    width: 16px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-dark);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.user-profile:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.avatar {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.username {
    font-size: 14px;
    font-weight: 500;
}

.user-status {
    font-size: 12px;
    color: var(--text-light);
}

/* Main Content Styles */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-primary);
    overflow: hidden;
}

.chat-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-primary);
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
}

.menu-btn:hover {
    background-color: var(--bg-secondary);
}

.chat-title {
    font-size: 18px;
    font-weight: 600;
}

.model-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    padding: 8px 12px;
    background-color: var(--bg-secondary);
    border-radius: 20px;
}

.model-info i {
    color: var(--accent-primary);
}

/* Chat Container */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.message-group {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.message {
    display: flex;
    gap: 24px;
    max-width: 48rem;
    margin: 0 auto;
    width: 100%;
    animation: fadeIn 0.3s ease;
}

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

.message .avatar {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 4px;
}

.bot-message .avatar {
    background: linear-gradient(135deg, var(--accent-primary), #2ecc71);
    color: white;
}

.message-content {
    flex: 1;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.sender {
    font-weight: 600;
    font-size: 14px;
}

.timestamp {
    font-size: 12px;
    color: var(--text-secondary);
}

.message-body {
    line-height: 1.6;
    font-size: 15px;
}

.message-body p {
    margin-bottom: 12px;
}

.message-body ul, .message-body ol {
    margin: 12px 0;
    padding-left: 24px;
}

.message-body li {
    margin-bottom: 6px;
}

.message-body strong {
    font-weight: 600;
}

.message-body code {
    background-color: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 14px;
}

.suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.suggestion-btn {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-btn:hover {
    background-color: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* Input Area */
.input-area {
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    padding: 20px 24px;
}

.input-container {
    max-width: 48rem;
    margin: 0 auto;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: flex-end;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background-color: var(--bg-primary);
    padding: 12px;
    transition: border-color 0.2s ease;
    box-shadow: 0 2px 10px var(--shadow-light);
}

.input-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 2px 15px rgba(16, 163, 127, 0.1);
}

#messageInput {
    flex: 1;
    border: none;
    background: none;
    resize: none;
    outline: none;
    font-size: 16px;
    line-height: 1.5;
    padding: 4px 8px;
    max-height: 200px;
    font-family: inherit;
    color: var(--text-primary);
}

#messageInput::placeholder {
    color: var(--text-secondary);
}

.input-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.send-btn {
    background-color: var(--accent-primary);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.send-btn:hover:not(:disabled) {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.disclaimer {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 60%;
}

.model-indicator {
    background-color: var(--bg-secondary);
    padding: 4px 12px;
    border-radius: 20px;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    align-items: center;
    gap: 12px;
    max-width: 48rem;
    margin: 0 auto 24px;
    padding: 0 24px;
    animation: fadeIn 0.3s ease;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background-color: var(--accent-primary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.typing-text {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.sidebar::-webkit-scrollbar-track {
    background: var(--bg-sidebar);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-dark);
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.2);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .menu-btn {
        display: block;
    }

    .mobile-overlay.active {
        display: block;
    }

    .chat-header {
        padding: 16px;
    }

    .input-area {
        padding: 16px;
    }

    .chat-container {
        padding: 16px;
    }

    .message {
        gap: 16px;
    }

    .input-footer {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .disclaimer {
        max-width: 100%;
    }

    .suggestions {
        flex-direction: column;
    }

    .suggestion-btn {
        width: 100%;
        text-align: left;
    }
}

@media (max-width: 480px) {
    .chat-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .header-left, .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .message .avatar {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
}