/* Main Styles for CodeGen Website */

:root {
    --primary-color: #10a37f;
    --primary-hover: #0d8c6d;
    --secondary-color: #f7f7f8;
    --text-color: #343541;
    --light-text: #8e8ea0;
    --border-color: #e5e5e5;
    --sidebar-bg: #202123;
    --sidebar-text: #ffffff;
    --code-bg: #f6f8fa;
    --error-color: #ff4d4f;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    background-color: #ffffff;
    line-height: 1.6;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* Login Screen Styles */
.login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100vw;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(3px);
}

.login-container {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    padding: 40px;
    width: 400px;
    max-width: 90%;
    text-align: center;
    animation: modalFadeIn 0.3s ease-out;
    transform: translateY(0);
    position: relative;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 2.5rem;
}

.login-header p {
    color: var(--light-text);
    margin-bottom: 30px;
}

.google-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

.google-login-btn:hover {
    background-color: var(--secondary-color);
}

.google-login-btn i {
    margin-right: 10px;
    color: #4285F4;
}

.close-login-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: var(--light-text);
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
}

.close-login-btn:hover {
    color: var(--text-color);
}

/* Main App Styles */
.main-app {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.new-chat-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
}

.new-chat-btn:hover {
    background-color: var(--primary-hover);
}

.history-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.chat-history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-bottom: 5px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.chat-history-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.chat-history-item.active {
    background-color: rgba(255, 255, 255, 0.2);
}

.chat-history-item i {
    font-size: 14px;
}

.chat-history-item p {
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
}

.logout-btn, .login-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: transparent;
    color: var(--sidebar-text);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    padding: 8px 10px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
    justify-content: center;
}

.logout-btn:hover, .login-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Main Content Styles */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.welcome-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    padding: 20px;
}

.welcome-message h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.welcome-message p {
    font-size: 1.1rem;
    color: var(--light-text);
    margin-bottom: 30px;
}

.example-prompts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    width: 100%;
    max-width: 900px;
}

.example-prompt {
    background-color: var(--secondary-color);
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.example-prompt:hover {
    background-color: var(--border-color);
}

.example-prompt i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.example-prompt p {
    font-size: 0.9rem;
    margin: 0;
    text-align: left;
    color: var(--text-color);
}

.message {
    display: flex;
    gap: 16px;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.message.user {
    background-color: white;
}

.message.assistant {
    background-color: var(--secondary-color);
}

.message-avatar {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.message.user .message-avatar {
    background-color: #5436da;
    color: white;
}

.message.assistant .message-avatar {
    background-color: var(--primary-color);
    color: white;
}

.message-content {
    flex: 1;
}

.message-text p {
    margin-bottom: 15px;
}

.message-text p:last-child {
    margin-bottom: 0;
}

.code-block {
    position: relative;
    background-color: var(--code-bg);
    border-radius: 6px;
    margin: 15px 0;
    overflow: hidden;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #e5e7eb;
    padding: 8px 15px;
    font-size: 0.85rem;
    color: #4b5563;
}

.code-language {
    font-weight: 600;
}

.copy-btn {
    background-color: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    color: #4b5563;
    transition: color 0.3s;
}

.copy-btn:hover {
    color: var(--primary-color);
}

.code-content {
    padding: 15px;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre;
}

/* Input Container Styles */
.input-container {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 15px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

#prompt-input {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    max-height: 200px;
    overflow-y: auto;
}

#send-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

#send-btn:hover {
    background-color: var(--primary-hover);
}

.disclaimer {
    font-size: 0.8rem;
    color: var(--light-text);
    text-align: center;
    margin-top: 10px;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--light-text);
}

.loading-dots {
    display: flex;
    gap: 4px;
}

.loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--light-text);
    animation: pulse 1.5s infinite ease-in-out;
}

.loading-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.5;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .main-app {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: fixed;
        bottom: 0;
        z-index: 100;
        display: none;
    }

    .sidebar.active {
        display: flex;
        height: 80vh;
    }

    .main-content {
        width: 100%;
    }

    .example-prompts {
        grid-template-columns: 1fr;
    }

    .menu-toggle {
        display: block;
        position: fixed;
        top: 10px;
        left: 10px;
        z-index: 101;
        background-color: var(--primary-color);
        color: white;
        border: none;
        border-radius: 5px;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }
}