﻿:root {
    --bg-gradient: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.12);
    --accent-gradient: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    --accent-hover: linear-gradient(135deg, #7b2cbf 0%, #3a86ff 100%);
    --text-main: #ffffff;
    --text-muted: #a5a6c4;
    --msg-in: rgba(255, 255, 255, 0.1);
    --transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Roboto, sans-serif; }
body {
    background: var(--bg-gradient);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(106, 17, 203, 0.7); }
    70% { box-shadow: 0 0 0 22px rgba(106, 17, 203, 0); }
    100% { box-shadow: 0 0 0 0 rgba(106, 17, 203, 0); }
}
.auth-overlay {
    position: fixed; inset: 0; background: rgba(10, 8, 28, 0.88);
    backdrop-filter: blur(18px); display: flex; justify-content: center;
    align-items: center; z-index: 100; transition: var(--transition);
}
.auth-overlay.hidden { opacity: 0; pointer-events: none; transform: scale(1.05); }
.auth-card {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    padding: 2.5rem; border-radius: 24px; width: 90%; max-width: 400px;
    text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.5s ease forwards;
}
.auth-card h2 {
    font-size: 1.9rem; margin-bottom: 0.4rem;
    background: linear-gradient(90deg, #a18cd1, #66a6ff);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.auth-card p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }
.avatar-picker { display: flex; justify-content: center; gap: 12px; margin-bottom: 1.5rem; }
.avatar-option {
    width: 48px; height: 48px; border-radius: 50%; display: flex;
    justify-content: center; align-items: center; font-size: 1.5rem;
    cursor: pointer; background: rgba(255, 255, 255, 0.08);
    border: 2px solid transparent; transition: var(--transition);
}
.avatar-option:hover, .avatar-option.selected {
    border-color: #3a86ff; transform: scale(1.15); background: rgba(58, 134, 255, 0.2);
}
.input-group { margin-bottom: 1rem; }
.input-group input {
    width: 100%; padding: 12px 16px; border-radius: 14px;
    border: 1px solid var(--glass-border); background: rgba(0, 0, 0, 0.25);
    color: #fff; font-size: 1rem; outline: none; transition: var(--transition);
}
.input-group input:focus { border-color: #6a11cb; box-shadow: 0 0 15px rgba(106, 17, 203, 0.4); }
.btn-primary {
    width: 100%; padding: 13px; border: none; border-radius: 14px;
    background: var(--accent-gradient); color: #fff; font-size: 1rem;
    font-weight: 600; cursor: pointer; transition: var(--transition);
    box-shadow: 0 8px 20px rgba(37, 117, 252, 0.3);
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-2px); }
.app-container {
    width: 95vw; max-width: 1200px; height: 90vh;
    background: var(--glass-bg); backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border); border-radius: 28px;
    display: flex; overflow: hidden; box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.6s ease;
}
.sidebar {
    width: 320px; border-right: 1px solid var(--glass-border);
    display: flex; flex-direction: column; background: rgba(15, 12, 41, 0.4);
}
.my-profile {
    padding: 20px; display: flex; align-items: center;
    justify-content: space-between; border-bottom: 1px solid var(--glass-border);
}
.profile-info { display: flex; align-items: center; gap: 12px; }
.avatar {
    width: 46px; height: 46px; border-radius: 50%;
    background: var(--accent-gradient); display: flex;
    justify-content: center; align-items: center; font-size: 1.4rem;
    position: relative; flex-shrink: 0;
}
.avatar::after {
    content: ""; width: 11px; height: 11px; background: #00f5d4; border-radius: 50%;
    position: absolute; bottom: 1px; right: 1px; border: 2px solid #1a163f;
}
.icon-btn {
    background: rgba(255, 255, 255, 0.08); border: none; color: #fff;
    width: 38px; height: 38px; border-radius: 12px; cursor: pointer;
    display: flex; justify-content: center; align-items: center;
    font-size: 1.1rem; transition: var(--transition);
}
.icon-btn:hover { background: var(--accent-gradient); transform: scale(1.08); }
.contacts-title {
    padding: 14px 20px 6px; font-size: 0.75rem; text-transform: uppercase;
    letter-spacing: 1px; color: var(--text-muted);
}
.contacts-list { flex: 1; overflow-y: auto; padding: 8px 12px; }
.contact-item {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px;
    border-radius: 16px; cursor: pointer; transition: var(--transition); margin-bottom: 6px;
}
.contact-item:hover { background: rgba(255, 255, 255, 0.07); transform: translateX(4px); }
.contact-item.active {
    background: linear-gradient(90deg, rgba(106, 17, 203, 0.4), rgba(37, 117, 252, 0.25));
    border: 1px solid rgba(106, 17, 203, 0.5);
}
.contact-details { flex: 1; overflow: hidden; }
.contact-name { font-weight: 600; font-size: 0.95rem; margin-bottom: 2px; }
.contact-last-msg { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-area { flex: 1; display: flex; flex-direction: column; position: relative; }
.empty-state {
    flex: 1; display: flex; flex-direction: column; justify-content: center;
    align-items: center; color: var(--text-muted); text-align: center; padding: 20px;
}
.chat-header {
    padding: 18px 25px; border-bottom: 1px solid var(--glass-border);
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(15, 12, 41, 0.25);
}
.chat-actions { display: flex; gap: 10px; }
.messages-box {
    flex: 1; padding: 25px; overflow-y: auto; display: flex;
    flex-direction: column; gap: 14px; scroll-behavior: smooth;
}
.message {
    max-width: 68%; padding: 12px 18px; border-radius: 20px;
    font-size: 0.95rem; line-height: 1.45; animation: fadeIn 0.3s ease forwards;
}
.message.in {
    align-self: flex-start; background: var(--msg-in);
    border-bottom-left-radius: 4px; border: 1px solid var(--glass-border);
}
.message.out {
    align-self: flex-end; background: var(--accent-gradient);
    border-bottom-right-radius: 4px; box-shadow: 0 5px 15px rgba(37, 117, 252, 0.25);
}
.msg-time { display: block; font-size: 0.7rem; opacity: 0.7; margin-top: 5px; text-align: right; }
.typing-indicator {
    font-size: 0.8rem; color: #66a6ff; padding: 0 25px 8px;
    height: 24px; opacity: 0; transition: opacity 0.3s ease;
}
.typing-indicator.visible { opacity: 1; }
.chat-input-area {
    padding: 18px 25px; border-top: 1px solid var(--glass-border);
    display: flex; gap: 12px; background: rgba(15, 12, 41, 0.3);
}
.chat-input-area input {
    flex: 1; padding: 14px 20px; border-radius: 18px;
    border: 1px solid var(--glass-border); background: rgba(255, 255, 255, 0.07);
    color: #fff; font-size: 0.95rem; outline: none; transition: var(--transition);
}
.chat-input-area input:focus { border-color: #3a86ff; background: rgba(255, 255, 255, 0.12); }
.send-btn {
    padding: 0 24px; border: none; border-radius: 18px;
    background: var(--accent-gradient); color: #fff; font-weight: 600;
    cursor: pointer; transition: var(--transition);
}
.send-btn:hover { transform: scale(1.05); }
.call-modal {
    position: absolute; inset: 0; background: rgba(12, 10, 36, 0.94);
    backdrop-filter: blur(25px); display: flex; flex-direction: column;
    justify-content: center; align-items: center; z-index: 50;
    opacity: 0; pointer-events: none; transform: scale(0.95); transition: var(--transition);
}
.call-modal.active { opacity: 1; pointer-events: all; transform: scale(1); }
.videos-grid { display: flex; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; justify-content: center; }
video {
    width: 300px; height: 220px; border-radius: 20px; background: #08061a;
    object-fit: cover; border: 2px solid #6a11cb; display: none;
}
.call-avatar {
    width: 110px; height: 110px; border-radius: 50%;
    background: var(--accent-gradient); display: flex;
    justify-content: center; align-items: center; font-size: 3.5rem;
    margin-bottom: 20px; animation: pulseGlow 2s infinite;
}
.call-controls { display: flex; gap: 20px; margin-top: 25px; }
.call-btn {
    width: 58px; height: 58px; border-radius: 50%; border: none;
    font-size: 1.4rem; cursor: pointer; color: #fff;
    background: rgba(255, 255, 255, 0.15); transition: var(--transition);
}
.call-btn:hover { transform: scale(1.1); }
.call-btn.accept { background: #00b894; box-shadow: 0 8px 25px rgba(0, 184, 148, 0.4); }
.call-btn.end { background: #ff2a5f; box-shadow: 0 8px 25px rgba(255, 42, 95, 0.4); }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 10px; }
