:root {
    --sidebar-bg: #202123;
    --sidebar-hover: #2a2b32;
    --sidebar-text: #ffffff;
    --main-bg: #ffffff;
    --main-text: #343541;
    --input-border: #dcdcdc;
    --primary-button: #10a37f;
    --primary-button-hover: #0d8a6c;
    --user-bubble: #10a37f;
    --ai-bubble: #f7f7f7;
    --ai-bubble-border: #e5e5e5;
    --error: #ff4a4a;
    --warning-text: #888;
}

/* Dark theme variables */
body.dark-theme {
    --main-bg: #343541;
    --main-text: #ececf1;
    --input-border: #4d4d4f;
    --ai-bubble: #444654;
    --ai-bubble-border: #565869;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    background-color: var(--main-bg);
    color: var(--main-text);
    height: 100vh;
    margin: 0;
    transition: background-color 0.3s ease;
}

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.sidebar-header {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Logo styling */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 15px;
}

.logo i {
    font-size: 26px;
    color: #10a37f;
}

.logo-img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.new-chat-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-button);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.new-chat-btn:hover {
    background-color: var(--primary-button-hover);
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.conversation-item {
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-item:hover {
    background-color: var(--sidebar-hover);
}

.conversation-item.active {
    background-color: var(--sidebar-hover);
}

.conversation-item i {
    color: #8e8ea0;
    font-size: 14px;
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-btn {
    width: 100%;
    padding: 10px;
    background-color: transparent;
    color: var(--sidebar-text);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
}

.sidebar-btn:hover {
    background-color: var(--sidebar-hover);
}

/* Adăugare stiluri pentru linkuri în sidebar */
.sidebar-links {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
}

.sidebar-link {
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 5px;
    transition: color 0.2s;
}

.sidebar-link i {
    font-size: 16px;
}

.sidebar-link:hover {
    color: var(--primary-button);
}

/* Main Content Styles */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--input-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h1 {
    font-size: 18px;
    font-weight: 500;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.header-actions button {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--main-text);
    padding: 5px;
    border-radius: 4px;
    font-size: 16px;
}

.header-actions button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    position: relative;
}

.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
    text-align: center;
}

.welcome-logo {
    margin-bottom: 20px;
    width: 100px;
    height: 100px;
    background-color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.welcome-logo-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.welcome-screen h2 {
    margin-bottom: 10px;
    font-size: 28px;
}

.welcome-screen p {
    margin-bottom: 30px;
    color: #666;
    max-width: 600px;
}

.example-prompts {
    width: 100%;
    max-width: 600px;
}

.example-prompts h3 {
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 500;
}

.example-prompt {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    margin-bottom: 10px;
    background-color: var(--ai-bubble);
    border: 1px solid var(--ai-bubble-border);
    border-radius: 8px;
    cursor: pointer;
    color: var(--main-text);
    font-size: 14px;
    transition: background-color 0.2s;
}

.example-prompt:hover {
    background-color: #eaeaea;
}

/* Stiluri pentru linkul din pagina de bun venit */
.welcome-tips {
    margin-top: 30px;
}

.welcome-tip-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-button);
    text-decoration: none;
    font-size: 14px;
    padding: 8px 15px;
    border-radius: 20px;
    background-color: rgba(16, 163, 127, 0.1);
    transition: background-color 0.2s;
}

.welcome-tip-link:hover {
    background-color: rgba(16, 163, 127, 0.2);
}

#chat-history {
    display: flex;
    flex-direction: column;
}

.message-container {
    padding: 20px;
    border-bottom: 1px solid var(--input-border);
    animation: fadein 0.5s;
}

.user-container {
    background-color: var(--main-bg);
}

.ai-container {
    background-color: var(--ai-bubble);
}

.message-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    gap: 20px;
}

.message-avatar {
    width: 30px;
    height: 30px;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar {
    background-color: var(--user-bubble);
    color: white;
}

.ai-avatar {
    background-color: transparent;
    padding: 0;
}

.ai-avatar-img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.message {
    flex: 1;
    line-height: 1.8;
}

.message p, .message ul, .message ol, .message pre, .message blockquote {
    margin-bottom: 15px;
}

.message code {
    background-color: #f1f1f1;
    padding: 2px 5px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

.message pre {
    background-color: #f6f8fa;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
}

.message pre code {
    background-color: transparent;
    padding: 0;
}

.error {
    background-color: #ffebee;
    color: var(--error);
    padding: 15px;
    border-radius: 8px;
    margin: 20px;
    text-align: center;
}

.retry-btn {
    background-color: var(--error);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    margin-left: 10px;
    cursor: pointer;
    font-size: 14px;
}

.typing {
    color: #888;
    font-style: italic;
}

.typing-indicator {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #888;
    animation: pulse 1.5s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

.chat-input-container {
    padding: 20px;
    border-top: 1px solid var(--input-border);
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    padding: 10px 15px;
    background-color: var(--main-bg);
}

textarea#message-input {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    padding: 0;
    font-family: inherit;
    font-size: 16px;
    background-color: transparent;
    color: var(--main-text);
    max-height: 200px;
    overflow-y: auto;
}

.send-btn {
    background-color: transparent;
    border: none;
    cursor: pointer;
    color: var(--primary-button);
    font-size: 18px;
    padding: 5px 10px;
    margin-left: 10px;
}

.send-btn:hover {
    color: var(--primary-button-hover);
}

.disclaimer {
    font-size: 12px;
    color: var(--warning-text);
    text-align: center;
    margin-top: 10px;
}

.chat-id {
    font-size: 12px;
    color: var(--warning-text);
    text-align: center;
    margin-top: 10px;
}

/* Stiluri pentru butoanele de copiere cod */
.code-copy-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0,0,0,0.2);
    border: none;
    color: white;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 12px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.code-copy-btn:hover {
    opacity: 1;
}

pre {
    position: relative;
}

/* Stiluri pentru autentificare Discord */
.auth-container {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 10px;
}

.auth-container.logged-in {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 10px;
    border: 2px solid var(--primary-button);
}

.user-info {
    flex: 1;
    overflow: hidden;
}

.user-name {
    font-weight: bold;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-discriminator {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.auth-btn {
    background-color: #5865f2; /* Culoare Discord */
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.2s;
}

.auth-btn:hover {
    background-color: #4752c4;
}

.auth-btn i {
    font-size: 16px;
}

.logout-btn {
    background-color: transparent;
    color: white;
    border: none;
    padding: 5px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.logout-btn:hover {
    opacity: 1;
}

/* Stil pentru butonul de profil */
.profile-dropdown {
    position: relative;
}

.profile-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    background-color: var(--sidebar-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    width: 200px;
    padding: 8px 0;
    margin-bottom: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 100;
}

.profile-dropdown.open .profile-menu {
    display: block;
}

.profile-menu-item {
    padding: 8px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-menu-item:hover {
    background-color: var(--sidebar-hover);
}

.profile-menu-item i {
    width: 18px;
}

/* Mobile responsiveness for auth UI */
@media (max-width: 768px) {
    .auth-container {
        justify-content: center;
        margin-bottom: 15px;
    }
    
    .auth-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Animations */
@keyframes fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.5;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Media Queries */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
}
