:root {
    --primary-color: #00d2ff;
    --secondary-color: #3a7bd5;
    --bg-dark: #0f172a;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --user-msg: #3b82f6;
    --ai-msg: #1e293b;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at top right, #1e293b, #0f172a);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#app {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hidden {
    display: none !important;
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Login Container */
#login-container {
    width: 400px;
    max-width: 90%;
    text-align: center;
}

#login-container h1 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

#login-container p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

input {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    color: white;
    outline: none;
}

button {
    width: 100%;
    padding: 0.8rem;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* Chat Container */
#chat-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.glass-header {
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    width: 32px;
    height: 32px;
}

#chat-window {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
}

#messages {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 70%;
    padding: 1rem;
    border-radius: 15px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    animation: fadeIn 0.3s ease;
}

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

.user-message {
    align-self: flex-end;
    background: var(--user-msg);
    color: white;
    border-bottom-right-radius: 2px;
}

.ai-message {
    align-self: flex-start;
    background: var(--ai-msg);
    color: var(--text-main);
    border-bottom-left-radius: 2px;
}

#thinking-indicator {
    align-self: flex-start;
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.85rem;
    padding: 0.5rem;
}

.glass-footer {
    padding: 1.5rem 2rem;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass-border);
}

.input-wrapper {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

textarea {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.8rem;
    color: white;
    resize: none;
    height: 50px;
    outline: none;
    font-family: inherit;
}

#send-btn {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Side Menu */
#side-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
}

.menu-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    border-radius: 0;
    display: flex;
    flex-direction: column;
}

#close-menu {
    align-self: flex-end;
    width: 40px;
    background: transparent;
}

.menu-content h3 {
    margin: 2rem 0;
}

.menu-content ul {
    list-style: none;
}

.menu-content li {
    padding: 1rem;
    cursor: pointer;
    border-radius: 10px;
    transition: background 0.2s;
}

.menu-content li:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* API Panel */
#api-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    max-width: 90%;
    max-height: 80%;
    overflow-y: auto;
    z-index: 200;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: transparent;
    font-size: 1.5rem;
}

.api-doc pre {
    background: #000;
    padding: 1rem;
    border-radius: 10px;
    margin: 1rem 0;
    font-size: 0.85rem;
    overflow-x: auto;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .glass-header {
        padding: 1rem;
    }
    #chat-window {
        padding: 1rem;
    }
    .message {
        max-width: 85%;
    }
    .glass-footer {
        padding: 1rem;
    }
}
