:root {
    --bg-color: #0f111a;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --primary-color: #00e5ff;
    --primary-hover: #00b3cc;
    --secondary-color: rgba(255, 255, 255, 0.1);
    --secondary-hover: rgba(255, 255, 255, 0.2);
    --text-main: #ffffff;
    --text-muted: #8b949e;
    --ai-bubble: rgba(0, 229, 255, 0.1);
    --user-bubble: rgba(255, 255, 255, 0.05);
    --error: #ff4d4d;
    --success: #00e676;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Background Animation */
#bg-animation {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -1;
    background: radial-gradient(circle at 15% 50%, rgba(0, 229, 255, 0.08), transparent 25%),
                radial-gradient(circle at 85% 30%, rgba(138, 43, 226, 0.08), transparent 25%);
    animation: pulse 15s ease-in-out infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.2); }
}

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

.hidden {
    display: none !important;
}

/* Typography */
h1 { font-weight: 800; font-size: 2.2rem; margin-bottom: 0.5rem; letter-spacing: -0.5px; }
h2 { font-weight: 600; font-size: 1.4rem; margin-bottom: 1.2rem; }
h3 { font-weight: 600; font-size: 1.1rem; margin-bottom: 0.8rem; color: var(--text-muted); }
p { color: var(--text-muted); margin-bottom: 2rem; }

/* Buttons & Inputs */
input {
    width: 100%;
    padding: 14px 18px;
    margin-bottom: 1rem;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
}

button {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.primary-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: #000;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
}

.primary-btn:hover { background: var(--primary-hover); transform: translateY(-2px); }

.secondary-btn {
    padding: 10px 16px;
    background: var(--secondary-color);
    color: var(--text-main);
}
.secondary-btn:hover { background: var(--secondary-hover); }

.w-100 { width: 100%; }

/* Login Container */
#login-container {
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

.error-text { color: var(--error); margin-top: 1rem; font-size: 0.9rem; }

/* Dashboard Container */
#dashboard-container {
    width: 100%;
    height: 100vh;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeIn 0.5s ease-out;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.logo { font-size: 1.5rem; font-weight: 800; }
.logo span { color: var(--primary-color); }
.user-info { display: flex; align-items: center; gap: 1rem; font-weight: 600; }

.dashboard-grid {
    display: flex;
    flex: 1;
    gap: 1.5rem;
    overflow: hidden;
}

.sidebar {
    width: 300px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.action-buttons { display: flex; flex-direction: column; gap: 1rem; }
.action-btn {
    padding: 12px;
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    text-align: left;
}
.action-btn:hover { border-color: var(--primary-color); background: rgba(0,229,255,0.05); }

#reg-status { margin-top: 0.5rem; font-size: 0.85rem; color: var(--success); }

/* Chat Section */
.chat-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-indicator {
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
}
.status-indicator.connected { background: rgba(0, 230, 118, 0.2); color: var(--success); }
.status-indicator.disconnected { background: rgba(255, 77, 77, 0.2); color: var(--error); }

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

.message {
    display: flex;
    gap: 1rem;
    max-width: 80%;
    animation: slideUp 0.3s ease-out;
}

.user-message { align-self: flex-end; flex-direction: row-reverse; }

.avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    font-weight: 800; font-size: 0.9rem;
    flex-shrink: 0;
}

.ai-message .avatar { background: var(--primary-color); color: #000; }
.user-message .avatar { background: var(--glass-border); border: 1px solid rgba(255,255,255,0.2); }

.bubble {
    padding: 14px 18px;
    border-radius: 18px;
    line-height: 1.5;
    font-size: 1rem;
}

.ai-message .bubble { background: var(--ai-bubble); border-top-left-radius: 4px; }
.user-message .bubble { background: var(--user-bubble); border-top-right-radius: 4px; }

/* Typing indicator cursor */
.typing-cursor::after {
    content: '▋';
    animation: blink 1s step-end infinite;
    color: var(--primary-color);
}
@keyframes blink { 50% { opacity: 0; } }

.chat-input-area {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--glass-border);
}

#chat-form {
    display: flex;
    gap: 1rem;
    position: relative;
}

#chat-input {
    margin-bottom: 0;
    padding-right: 60px;
    border-radius: 15px;
    background: rgba(0,0,0,0.3);
}

.send-btn {
    position: absolute;
    right: 8px;
    top: 8px;
    bottom: 8px;
    width: 40px;
    background: var(--primary-color);
    color: #000;
    border-radius: 10px;
    display: flex; justify-content: center; align-items: center;
}
.send-btn svg { width: 20px; height: 20px; }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
