/* Chat Container */
.chat-container {
    display: flex;
    height: 100vh;
    background-color: #f8f9fa;
}

.chat-sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

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

.sidebar-header .logo {
    color: white;
    margin-bottom: 20px;
}

.new-chat-btn {
    width: 100%;
    padding: 10px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.new-chat-btn:hover {
    background-color: var(--primary-dark);
}

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

.history-item {
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.history-item:hover {
    background-color: var(--sidebar-hover);
}

.history-item.active {
    background-color: var(--sidebar-hover);
    font-weight: 500;
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--sidebar-hover);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-btn {
    background: none;
    border: none;
    color: var(--sidebar-text);
    font-size: 1.2rem;
    cursor: pointer;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: white;
}

.chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.clear-chat-btn {
    background: none;
    border: 1px solid var(--gray-color);
    color: var(--gray-color);
    padding: 5px 10px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.clear-chat-btn:hover {
    background-color: #f8f9fa;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f8f9fa;
}

.message {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    max-width: 80%;
}

.message .avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message.ai-message .avatar {
    background-color: var(--dark-gray);
}

.message-content {
    flex: 1;
}

.message.ai-message .message-content {
    background-color: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.message.user-message {
    margin-left: auto;
    flex-direction: row-reverse;
}

.message.user-message .message-content {
    background-color: var(--primary-color);
    color: white;
    padding: 15px;
    border-radius: 10px;
}

.code-block {
    background-color: var(--code-bg);
    color: white;
    border-radius: 5px;
    padding: 15px;
    margin: 10px 0;
    position: relative;
    overflow-x: auto;
}

.code-block pre {
    margin: 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
}

.copy-code-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
}

.code-block:hover .copy-code-btn {
    opacity: 1;
}

.chat-input-container {
    padding: 15px;
    border-top: 1px solid #e2e8f0;
}

.input-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.attach-btn {
    background: none;
    border: none;
    color: var(--gray-color);
    font-size: 1.2rem;
    cursor: pointer;
}

.message-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

#message-input {
    width: 100%;
    padding: 12px 50px 12px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 25px;
    resize: none;
    font-family: inherit;
    font-size: 1rem;
    min-height: 50px;
    max-height: 150px;
    outline: none;
    transition: border-color 0.3s;
}

#message-input:focus {
    border-color: var(--primary-color);
}

.send-btn {
    position: absolute;
    right: 10px;
    background: var(--primary-color);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

.send-btn:hover {
    background-color: var(--primary-dark);
}

.input-footer {
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--gray-color);
    text-align: center;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 15px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    width: fit-content;
}

.typing-indicator .dot {
    width: 8px;
    height: 8px;
    background-color: var(--gray-color);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator .dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .chat-sidebar {
        position: absolute;
        z-index: 100;
        height: 100%;
        transform: translateX(-100%);
    }
    
    .chat-sidebar.open {
        transform: translateX(0);
    }
    
    .message {
        max-width: 90%;
    }
}
/* Add these new styles */
.code-container {
    position: relative;
    background: #1e1e1e;
    border-radius: 6px;
    overflow: hidden;
    margin: 10px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #252526;
    color: #9e9e9e;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.9rem;
}

.code-filename {
    display: flex;
    align-items: center;
    gap: 8px;
}

.code-actions {
    display: flex;
    gap: 8px;
}

.code-btn {
    background: #3e3e42;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background 0.2s;
}

.code-btn:hover {
    background: #007acc;
}

.code-btn i {
    font-size: 0.8rem;
}

.code-content {
    padding: 12px;
    overflow-x: auto;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 80%;
    max-width: 900px;
    height: 80%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    padding: 12px 16px;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.modal-body {
    flex: 1;
    padding: 0;
}

#preview-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}