/* ====================================
   VLYX Messenger - طراحی شیشه‌ای لوکس
   ==================================== */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    background: radial-gradient(circle at 20% 30%, #0b1a22, #03080c);
    color: white;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 70% 30%, rgba(74, 144, 226, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 30% 70%, rgba(126, 200, 255, 0.08) 0%, transparent 50%);
    animation: rotate 60s linear infinite;
    z-index: -1;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========== صفحه احراز هویت لوکس ========== */
.auth-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    backdrop-filter: blur(10px);
}

.auth-card {
    background: rgba(18, 30, 38, 0.65);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(74, 144, 226, 0.25);
    border-radius: 40px;
    padding: 40px 32px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(74, 144, 226, 0.1) inset,
                0 0 20px rgba(74, 144, 226, 0.1);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.logo-section {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    width: 90px;
    height: 90px;
    margin: 0 auto 20px;
    background: linear-gradient(145deg, #4a90e2, #2a5a8a);
    border-radius: 28px;
    padding: 5px;
    box-shadow: 0 15px 25px -8px rgba(0, 0, 0, 0.4),
                0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    position: relative;
}

.logo::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, rgba(74,144,226,0.5), rgba(126,200,255,0.5));
    border-radius: 30px;
    z-index: -1;
    filter: blur(10px);
    opacity: 0.5;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 24px;
}

.logo-section h1 {
    background: linear-gradient(135deg, #fff, #b0e0ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 40px;
    font-weight: 900;
    margin-bottom: 8px;
    letter-spacing: 2px;
    text-shadow: 0 0 30px rgba(74, 144, 226, 0.5);
}

.slogan {
    color: rgba(126, 200, 255, 0.9);
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 1px;
}

/* ========== فیلدهای ورود ========== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: rgba(193, 228, 255, 0.9);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-right: 8px;
}

.username-field {
    display: flex;
    align-items: center;
    background: rgba(8, 20, 28, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1.5px solid rgba(74, 144, 226, 0.3);
    border-radius: 20px;
    padding: 0 20px;
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1);
}

.username-field:hover {
    border-color: rgba(74, 144, 226, 0.6);
    background: rgba(8, 20, 28, 0.7);
}

.username-field:focus-within {
    border-color: #4a90e2;
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.2),
                0 0 20px rgba(74, 144, 226, 0.2);
    background: rgba(8, 20, 28, 0.8);
}

.at-sign {
    color: #7ec8ff;
    font-size: 18px;
    font-weight: 700;
    margin-left: 8px;
    text-shadow: 0 0 10px rgba(126, 200, 255, 0.5);
}

.username-field input,
.form-group input {
    flex: 1;
    padding: 16px 0;
    background: transparent;
    border: none;
    color: white;
    font-size: 16px;
    font-weight: 500;
    direction: ltr;
}

.username-field input:focus,
.form-group input:focus {
    outline: none;
}

.form-group input {
    padding: 16px 20px;
    background: rgba(8, 20, 28, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1.5px solid rgba(74, 144, 226, 0.3);
    border-radius: 20px;
    color: white;
    font-size: 16px;
    transition: all 0.3s;
}

.form-group input:hover {
    border-color: rgba(74, 144, 226, 0.6);
    background: rgba(8, 20, 28, 0.7);
}

.form-group input:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.2);
    background: rgba(8, 20, 28, 0.8);
}

.form-group input::placeholder {
    color: rgba(170, 210, 240, 0.4);
    font-weight: 300;
}

.hint {
    font-size: 12px;
    margin-right: 12px;
    margin-top: 6px;
    font-weight: 400;
}

/* ========== دکمه لوکس ========== */
.auth-btn {
    background: linear-gradient(145deg, #4a90e2, #2a5a8a);
    border: none;
    border-radius: 24px;
    padding: 18px;
    color: white;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    border-bottom: none;
    box-shadow: 0 10px 20px -8px rgba(0, 0, 0, 0.4),
                0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.auth-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.auth-btn:hover::before {
    left: 100%;
}

.auth-btn:active {
    transform: scale(0.98);
}

.auth-switch {
    text-align: center;
    color: rgba(200, 225, 250, 0.7);
    font-size: 14px;
    margin-top: 16px;
}

.auth-switch a {
    color: #7ec8ff;
    text-decoration: none;
    font-weight: 700;
    position: relative;
    padding-bottom: 2px;
}

.auth-switch a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 1.5px;
    background: #7ec8ff;
    transition: width 0.3s ease;
}

.auth-switch a:hover::after {
    width: 100%;
}

/* ========== صفحه اصلی ========== */
.app {
    display: flex;
    height: 100vh;
    width: 100%;
    position: relative;
}

/* ========== سایدبار شیشه‌ای ========== */
.sidebar {
    width: 100%;
    max-width: 380px;
    background: rgba(12, 25, 35, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-left: 1px solid rgba(74, 144, 226, 0.2);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.3);
}

.sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 30%, rgba(74,144,226,0.05) 0%, transparent 70%);
    pointer-events: none;
}

.sidebar-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(74, 144, 226, 0.15);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-avatar {
    width: 52px;
    height: 52px;
    background: linear-gradient(145deg, #4a90e2, #2a5a8a);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: white;
    box-shadow: 0 8px 15px -5px rgba(0, 0, 0, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    position: relative;
}

.user-avatar::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, rgba(74,144,226,0.5), transparent);
    border-radius: 20px;
    z-index: -1;
    filter: blur(8px);
}

.user-info h3 {
    color: #e6f3ff;
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 6px;
    text-shadow: 0 0 15px rgba(74, 144, 226, 0.5);
}

.status {
    font-size: 12px;
    color: #4ade80;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 15px #4ade80;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(0.9); }
}

/* ========== دکمه‌های شیشه‌ای ========== */
.icon-btn {
    background: rgba(74, 144, 226, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: 16px;
    padding: 12px;
    color: #b0e0ff;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.icon-btn:hover {
    background: rgba(74, 144, 226, 0.2);
    border-color: rgba(74, 144, 226, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -5px rgba(0, 0, 0, 0.3);
}

/* ========== جستجو ========== */
.search-section {
    padding: 16px 20px;
    position: relative;
}

.search-icon {
    position: absolute;
    right: 38px;
    top: 32px;
    color: rgba(126, 200, 255, 0.6);
    z-index: 1;
}

.search-section input {
    width: 100%;
    padding: 16px 50px 16px 24px;
    background: rgba(8, 20, 28, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1.5px solid rgba(74, 144, 226, 0.2);
    border-radius: 30px;
    color: white;
    font-size: 15px;
    transition: all 0.3s;
}

.search-section input:focus {
    outline: none;
    border-color: #4a90e2;
    background: rgba(8, 20, 28, 0.7);
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.1),
                0 0 20px rgba(74, 144, 226, 0.2);
}

/* ========== لیست گفتگوها ========== */
.chats-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: rgba(74, 144, 226, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(74, 144, 226, 0.1);
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1);
}

.chat-item:hover {
    background: rgba(74, 144, 226, 0.08);
    border-color: rgba(74, 144, 226, 0.3);
    transform: translateX(-4px);
    box-shadow: 0 10px 25px -10px rgba(0, 0, 0, 0.4);
}

.chat-item.active {
    background: rgba(74, 144, 226, 0.15);
    border-color: #4a90e2;
    box-shadow: 0 0 0 1px rgba(74, 144, 226, 0.5),
                0 10px 25px -8px rgba(74, 144, 226, 0.3);
}

.chat-avatar {
    width: 56px;
    height: 56px;
    background: linear-gradient(145deg, #2a4a6a, #1a2a3a);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: white;
    box-shadow: 0 5px 10px -3px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

/* ========== بخش چت شیشه‌ای ========== */
.chat-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: rgba(8, 18, 25, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: relative;
}

.chat-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 80% 20%, rgba(74,144,226,0.05) 0%, transparent 70%);
    pointer-events: none;
}

.chat-header {
    padding: 16px 24px;
    background: rgba(12, 25, 35, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(74, 144, 226, 0.15);
    display: flex;
    align-items: center;
    gap: 16px;
}

.chat-user-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(145deg, #4a90e2, #2a5a8a);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: white;
    box-shadow: 0 6px 12px -4px rgba(0, 0, 0, 0.3);
}

/* ========== پیام‌ها ========== */
.messages-area {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 70%;
    animation: messageSlide 0.3s cubic-bezier(0.2, 0.9, 0.4, 1);
}

@keyframes messageSlide {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.sent {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(145deg, #2a4a6a, #1a2a3a);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: white;
    flex-shrink: 0;
}

.message-content {
    background: rgba(25, 45, 60, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 14px 18px;
    border-radius: 24px;
    border: 1px solid rgba(74, 144, 226, 0.15);
    box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.3);
}

.message.sent .message-content {
    background: rgba(74, 144, 226, 0.25);
    border-color: rgba(74, 144, 226, 0.3);
}

/* ========== مودال شیشه‌ای لوکس ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
    animation: modalFade 0.3s ease;
}

@keyframes modalFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: rgba(18, 30, 38, 0.8);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(74, 144, 226, 0.3);
    border-radius: 48px;
    padding: 32px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    animation: modalZoom 0.4s cubic-bezier(0.2, 0.9, 0.4, 1);
}

@keyframes modalZoom {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* ========== کارت جستجوی کاربر لوکس ========== */
.user-preview-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: rgba(74, 144, 226, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(74, 144, 226, 0.4);
    border-radius: 28px;
    margin: 24px 0;
    box-shadow: 0 15px 35px -15px rgba(0, 0, 0, 0.4);
    animation: glow 3s infinite;
}

@keyframes glow {
    0%, 100% { border-color: rgba(74, 144, 226, 0.4); }
    50% { border-color: rgba(74, 144, 226, 0.8); }
}

.user-preview-avatar {
    width: 64px;
    height: 64px;
    background: linear-gradient(145deg, #4a90e2, #2a5a8a);
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: white;
    box-shadow: 0 10px 20px -8px rgba(0, 0, 0, 0.4);
}

.user-preview-info h4 {
    color: #e6f3ff;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}

.user-preview-info p {
    color: #7ec8ff;
    font-size: 15px;
    margin-bottom: 8px;
}

.user-status-badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(74, 144, 226, 0.2);
    backdrop-filter: blur(5px);
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.3);
}

/* ========== اسکرول شیشه‌ای ========== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(10, 25, 35, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(74, 144, 226, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 144, 226, 0.5);
}