:root {
    --bg-dark: #0a0a0c;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #22d3ee;
    --message-bg: rgba(255, 255, 255, 0.05);
    --message-mine: rgba(99, 102, 241, 0.2);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background-image: radial-gradient(circle at top right, rgba(99, 102, 241, 0.15), transparent 40%),
                      radial-gradient(circle at bottom left, rgba(34, 211, 238, 0.1), transparent 40%);
}

.app-container {
    width: 100%;
    max-width: 900px;
    height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .app-container {
        height: 90vh;
        border-radius: 24px;
        overflow: hidden;
        border: 1px solid var(--glass-border);
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    }
}

.screen {
    display: none;
    width: 100%;
    height: 100%;
    flex-direction: column;
}

.screen.active {
    display: flex;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
}

.glass-header, .glass-footer {
    background: rgba(10, 10, 12, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
}

.glass-footer {
    border-bottom: none;
    border-top: 1px solid var(--glass-border);
}

/* Auth Screen */
#auth-screen {
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.auth-panel {
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
    color: var(--primary);
}

.auth-panel p {
    color: var(--text-muted);
    margin-bottom: 32px;
    font-size: 0.9rem;
}

.input-group input {
    width: 100%;
    padding: 14px 20px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(0,0,0,0.2);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
    margin-bottom: 20px;
}

.input-group input:focus {
    border-color: var(--primary);
}

.btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.primary-btn {
    background: var(--primary);
    color: white;
}

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

.message {
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--accent);
}

/* Chat Screen */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
}

.header-info h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.icon-btn {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.icon-btn:hover {
    opacity: 1;
}

.chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-area::-webkit-scrollbar {
    width: 6px;
}
.chat-area::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 3px;
}

.message-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    background: var(--message-bg);
    align-self: flex-start;
    border: 1px solid var(--glass-border);
    animation: fadeIn 0.3s ease forwards;
}

.message-bubble.mine {
    align-self: flex-end;
    background: var(--message-mine);
    border-color: rgba(99, 102, 241, 0.3);
    border-bottom-right-radius: 4px;
}

.message-bubble:not(.mine) {
    border-bottom-left-radius: 4px;
}

.msg-sender {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: block;
}

.msg-content {
    font-size: 0.95rem;
    line-height: 1.4;
}

.msg-content .mention {
    color: var(--accent);
    font-weight: 500;
}

.chat-footer {
    padding: 16px 24px;
}

#chat-form {
    display: flex;
    gap: 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 8px 8px 8px 20px;
    align-items: center;
}

#message-input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 0.95rem;
    outline: none;
}

.send-btn {
    background: var(--primary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
}

.send-btn:hover {
    transform: scale(1.05);
}

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