/* style.css - Matchiny Theme */
:root {
    --primary-gradient: linear-gradient(135deg, #FF512F 0%, #DD2476 100%);
    --bg-gradient: linear-gradient(135deg, #240b36 0%, #c31432 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: 1px solid rgba(255, 255, 255, 0.18);
    --text-color: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.7);
    --msg-sent: linear-gradient(to right, #DA22FF 0%, #9733EE 51%, #DA22FF 100%);
    --msg-received: rgba(255, 255, 255, 0.15);
}

* { box-sizing: border-box; outline: none; }

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--glass-bg);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 20px;
    border: var(--glass-border);
}

/* Login Page */
.login-container {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    text-align: center;
    animation: fadeIn 0.8s ease-out;
}

.logo {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(to right, #fff, #ffd1dc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 30px;
    font-weight: 300;
}

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

.input-field {
    width: 100%;
    padding: 15px 20px;
    border-radius: 50px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    transition: 0.3s;
}
.input-field:focus { background: rgba(255, 255, 255, 0.2); box-shadow: 0 0 15px rgba(255, 255, 255, 0.1); }
select.input-field { cursor: pointer; }
select option { background: #333; color: white; }

.btn-primary {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 50px;
    background: var(--primary-gradient);
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 5px 15px rgba(221, 36, 118, 0.4);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(221, 36, 118, 0.6); }

/* Chat Interface */
.app-container {
    width: 95%; /* Mobile first */
    height: 90vh; /* Leave some breathing room */
    display: flex;
    overflow: hidden;
    position: relative;
    max-width: 1200px;
}

/* Sidebar (Users) */
.sidebar {
    width: 300px;
    border-right: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    background: rgba(0,0,0,0.2);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.user-profile { display: flex; align-items: center; gap: 10px; }
.avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(45deg, #12c2e9, #c471ed, #f64f59);
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; font-size: 1.2rem;
}
.my-name { font-weight: bold; font-size: 1.1rem; }
.my-status { font-size: 0.8rem; color: #00ff88; }

.user-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}
.user-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    border-radius: 15px;
    cursor: pointer;
    transition: 0.2s;
    margin-bottom: 5px;
}
.user-item:hover { background: rgba(255,255,255,0.1); }
.user-item.active {
    background: linear-gradient(90deg, rgba(221, 36, 118, 0.4) 0%, transparent 100%);
    border-left: 4px solid #DD2476;
}
.user-info h4 { margin: 0; font-size: 1rem; }
.user-info p { margin: 2px 0 0; font-size: 0.8rem; color: var(--text-muted); }

/* Main Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(0,0,0,0.1);
    position: relative;
}

.chat-header {
    padding: 15px 20px;
    background: rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.back-btn { display: none; background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer; }

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

.message {
    max-width: 70%;
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
    position: relative;
    word-wrap: break-word;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.msg-received {
    align-self: flex-start;
    background: var(--msg-received);
    border-bottom-left-radius: 2px;
}

.chat-input-area {
    padding: 20px;
    background: rgba(0,0,0,0.2);
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 15px;
    border-radius: 30px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: white;
}
.send-btn {
    width: 50px; height: 50px;
    border-radius: 50%;
    border: none;
    background: var(--primary-gradient);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: 0.2s;
}
.send-btn:hover { transform: scale(1.1); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .app-container { width: 100%; height: 100vh; border-radius: 0; }
    .sidebar { width: 100%; position: absolute; z-index: 10; height: 100%; transition: transform 0.3s; }
    .sidebar.hidden { transform: translateX(-100%); }
    .chat-area { width: 100%; position: absolute; height: 100%; }
    .chat-area.hidden { transform: translateX(100%); }
    .back-btn { display: block; }
}
