@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600&display=swap');

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%), 
        radial-gradient(at 50% 0%, hsla(225,39%,30%,1) 0, transparent 50%), 
        radial-gradient(at 100% 0%, hsla(339,49%,30%,1) 0, transparent 50%);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Auth Page */
.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 40px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    outline: none;
    transition: all 0.3s;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

button {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* Chat Page Layout */
.app-container {
    width: 95vw;
    height: 90vh;
    display: flex;
}

.sidebar {
    width: 320px;
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
}

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

.user-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.user-item {
    padding: 12px 16px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.user-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.user-item.active {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info h4 {
    font-size: 1rem;
    font-weight: 600;
}

.user-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.message {
    max-width: 70%;
    padding: 12px 18px;
    border-radius: 20px;
    font-size: 0.95rem;
    line-height: 1.4;
    position: relative;
}

.message.sent {
    align-self: flex-end;
    background: var(--primary);
    border-bottom-right-radius: 4px;
}

.message.received {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.1);
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
    display: block;
    text-align: right;
}

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

.input-wrapper {
    display: flex;
    gap: 12px;
}

.input-wrapper input {
    flex: 1;
}

.input-wrapper button {
    width: auto;
    padding: 0 24px;
}

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

.message {
    animation: fadeIn 0.3s ease-out;
}
