:root {
    --bg-dark: #0a101e;
    --bg-darker: #050a15;
    --user-msg: #005c4b;
    --ai-msg: #1f2c3b;
    --text-light: #e9edef;
    --accent: #00a884;
    --input-height: 60px;
    
    /* Light theme variables */
    --bg-light: #e4e5e9;
    --bg-lighter: #f8f9fa;
    --text-dark: #202c33;
    --user-msg-light: #d9fdd3;
    --ai-msg-light: #ffffff;
    
    /* Dark theme new background variables */
    --bg-dark-alt: #111b2d;  /* This is a lighter black/blue tone */
    --bg-darker-alt: #0b1121; /* This is a darker tone */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background: var(--bg-dark-alt);
    color: var(--text-light);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: background-color 0.3s, color 0.3s;
}

/* Light theme */
body.light-theme {
    background: var(--bg-light);
    color: var(--text-dark);
}

body.light-theme .header {
    background: var(--bg-lighter);
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

body.light-theme .status {
    color: #667781;
}

body.light-theme .menu-btn,
body.light-theme .theme-btn,
body.light-theme .home-btn {
    color: var(--text-dark);
}

body.light-theme .chat-container {
    background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABmJLR0QA/wD/AP+gvaeTAAAA+UlEQVQ4y+3UMUoDQRTG8Z8psJBUKTyAR7ATvIBgKTYW1oKtnRewsbK0sbKQNFZCTiB2Fh6gEOxEwUIUJlnYZWZndk0abPhhYHjz5v/emx1m4j9jgDlW8Yo3POA6Vd7gPpVf4S5VXuI2VV7gJlVe4CZVXuA2VZ7jKlWe4TJVnuIiVZ7gPFWe4CxVnuA0VZ7gJFWe4DhVnuAoVZ7gMFWe4CBVnmA/VZ5gL1WeYCdVnmAnVZ5gJ1WeYCdVnmA7VZ5gK1WeYCtVnmAzVZ5gI1WeYCNVnmA9VZ5gLVWeYC1VnmA1VZ5gJVX+AH+uM3Gp/UZIAAAAAElFTkSuQmCC') var(--bg-light);
}

body.light-theme .ai-message {
    background: var(--ai-msg-light);
    color: var(--text-dark);
}

body.light-theme .user-message {
    background: var(--user-msg-light);
    color: var(--text-dark);
}

body.light-theme .timestamp {
    color: rgba(0,0,0,0.6);
}

body.light-theme .input-area {
    background: var(--bg-lighter);
    border-top: 1px solid rgba(0,0,0,0.1);
}

body.light-theme #messageInput {
    background: rgba(0,0,0,0.05);
    color: var(--text-dark);
}

body.light-theme .menu-dropdown {
    background: var(--bg-lighter);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

body.light-theme .menu-item {
    color: var(--text-dark);
}

body.light-theme .menu-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Header */
.header {
    background: var(--bg-darker-alt);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
}

.logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.header-text {
    flex-grow: 1;
    min-width: 0;
}

.status {
    font-size: 0.8rem;
    color: #8696a0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Header Buttons */
.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.menu-btn,
.theme-btn,
.home-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 8px;
    flex-shrink: 0;
}

.menu-btn:hover,
.theme-btn:hover,
.home-btn:hover {
    opacity: 0.8;
}

/* Menu dropdown styles */
.menu-dropdown {
    display: none;
    position: absolute;
    right: 10px;
    top: 60px;
    background: var(--bg-darker-alt);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    min-width: 200px;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-dropdown.show {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-light);
    font-size: 16px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s;
}

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

/* Neon button styles */
.neon-button {
    position: relative;
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(90deg, #ff00ff, #00ffff);
    color: white;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.7), 
                0 0 20px rgba(0, 255, 255, 0.7);
    overflow: hidden;
    transition: all 0.3s;
    animation: neonPulse 2s infinite;
}

.neon-button:hover {
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.9), 
                0 0 30px rgba(0, 255, 255, 0.9);
    transform: scale(1.05);
}

.neon-text {
    position: relative;
    z-index: 1;
}

@keyframes neonPulse {
    0% {
        box-shadow: 0 0 10px rgba(255, 0, 255, 0.7), 
                    0 0 20px rgba(0, 255, 255, 0.7);
    }
    50% {
        box-shadow: 0 0 15px rgba(255, 0, 255, 0.9), 
                    0 0 30px rgba(0, 255, 255, 0.9);
    }
    100% {
        box-shadow: 0 0 10px rgba(255, 0, 255, 0.7), 
                    0 0 20px rgba(0, 255, 255, 0.7);
    }
}

/* Chat Container */
.chat-container {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABmJLR0QA/wD/AP+gvaeTAAAA+UlEQVQ4y+3UMUoDQRTG8Z8psJBUKTyAR7ATvIBgKTYW1oKtnRewsbK0sbKQNFZCTiB2Fh6gEOxEwUIUJlnYZWZndk0abPhhYHjz5v/emx1m4j9jgDlW8Yo3POA6Vd7gPpVf4S5VXuI2VV7gJlVe4CZVXuA2VZ7jKlWe4TJVnuIiVZ7gPFWe4CxVnuA0VZ7gJFWe4DhVnuAoVZ7gMFWe4CBVnmA/VZ5gL1WeYCdVnmAnVZ5gJ1WeYCdVnmA7VZ5gK1WeYCtVnmAzVZ5gI1WeYCNVnmA9VZ5gLVWeYC1VnmA1VZ5gJVX+AH+uM3Gp/UZIAAAAAElFTkSuQmCC') var(--bg-dark-alt);
    display: flex;
    flex-direction: column;
    gap: 8px;
    overscroll-behavior: contain;
}

/* Messages */
.message {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.4;
    animation: fadeIn 0.3s ease-out;
    word-wrap: break-word;
    position: relative;
}

.ai-message {
    align-self: flex-start;
    background: var(--ai-msg);
    border-top-left-radius: 0;
    margin-right: 15%;
}

.user-message {
    align-self: flex-end;
    background: var(--user-msg);
    border-top-right-radius: 0;
    margin-left: 15%;
}

.timestamp {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.6);
    display: inline-block;
    margin-left: 8px;
    vertical-align: text-bottom;
}

/* Input Area */
.input-area {
    background: var(--bg-darker-alt);
    padding: 8px 16px;
    display: flex;
    gap: 10px;
    border-top: 1px solid rgba(255,255,255,0.1);
    position: sticky;
    bottom: 0;
    flex-shrink: 0;
}

#messageInput {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: none;
    border-radius: 20px;
    padding: 10px 16px;
    color: var(--text-light);
    outline: none;
    font-size: 1rem;
    min-height: 40px;
    max-height: 120px;
    resize: none;
    overflow-y: auto;
}

#sendButton {
    background: var(--accent);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s;
}

#sendButton:active {
    transform: scale(0.95);
}

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

/* Mobile Optimizations */
@media (max-width: 768px) {
    .header {
        padding: 10px 12px;
    }

    .message {
        max-width: 85%;
    }

    #messageInput {
        padding: 8px 14px;
    }

    /* Prevent zoom on input focus */
    input, textarea {
        font-size: 16px !important;
    }
    
    .neon-button {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    .menu-dropdown {
        right: 5px;
        top: 55px;
        min-width: 180px;
    }
}