/* =====================================
🔥 RESET + BASE
===================================== */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: clamp(14px, 1.2vw, 16px);
}

html, body {
    height: 100%;
    margin: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    color: white;
    overflow: hidden;
}

/* =====================================
🌌 BACKGROUND (DEPTH EFFECT)
===================================== */
body {
    background: #000;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at top, #1a1a1a, #000);
    z-index: -2;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(120deg, transparent, rgba(255,215,0,0.05), transparent);
    z-index: -1;
}

/* =====================================
🔥 LOGIN (CENTERED GLASS)
===================================== */
.login {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(30px);
}

.login h2 {
    color: gold;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.login input {
    padding: 12px;
    width: 250px;
    border-radius: 12px;
    border: none;
    background: #111;
    color: white;
    transition: all 0.2s ease;
}

.login input:focus {
    outline: none;
    box-shadow: 0 0 0 2px gold, 0 0 15px rgba(255,215,0,0.4);
}

/* =====================================
🔥 AVATAR (SMOOTH GRID)
===================================== */
.avatar-select {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 260px;
}

.avatar-select img {
    width: 48px;
    margin: 5px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.avatar-select img:hover {
    transform: scale(1.1) rotate(2deg);
}

.avatar-select img.selected {
    border: 2px solid gold;
    transform: scale(1.2);
}

/* =====================================
🔥 APP LAYOUT
===================================== */
.app {
    display: flex;
    height: 100%;
    animation: appFade 0.4s ease;
}

/* =====================================
🔥 SIDEBAR (PREMIUM GLASS)
===================================== */
.sidebar {
    width: min(300px, 30%);
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(30px);
    padding: 10px;
    overflow-y: auto;
    border-right: 1px solid rgba(255,255,255,0.1);
}

/* USER LIST */
#userList div {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 12px 12px 22px;
    margin: 6px 0;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

#userList div:hover {
    background: rgba(255,255,255,0.08);
    transform: translateX(5px);
}

#userList div.active {
    background: rgba(255,215,0,0.2);
}

/* ONLINE DOT */
#userList div::before {
    content: "";
    width: 8px;
    height: 8px;
    background: lime;
    border-radius: 50%;
    position: absolute;
    left: 6px;
    animation: pulse 1.5s infinite;
}

/* =====================================
🔥 CHAT SECTION
===================================== */
.chat-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(25px);
}

/* =====================================
🔥 HEADER (UPGRADED)
===================================== */
.header {
    padding: 12px;
    color: gold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.7);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* =====================================
💬 CHAT BOX
===================================== */
.chat-box {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.chat-box::-webkit-scrollbar {
    width: 4px;
}
.chat-box::-webkit-scrollbar-thumb {
    background: gold;
}

/* =====================================
💬 MESSAGE (ADVANCED BUBBLES)
===================================== */
.message {
    max-width: 70%;
    padding: 10px 14px;
    margin: 6px 10px;
    border-radius: 18px;
    position: relative;
    animation: fadeInUp 0.25s ease;
}

/* YOU */
.message.you {
    background: linear-gradient(135deg, #2e7d32, #43a047);
    margin-left: auto;
}

/* OTHER */
.message.other {
    background: #2a2a2a;
}

/* BUBBLE TAIL */
.message.you::after {
    content: "";
    position: absolute;
    right: -6px;
    top: 10px;
    border: 6px solid transparent;
    border-left-color: #43a047;
}

.message.other::after {
    content: "";
    position: absolute;
    left: -6px;
    top: 10px;
    border: 6px solid transparent;
    border-right-color: #2a2a2a;
}

/* SYSTEM */
.message.system {
    text-align: center;
    color: gray;
    font-size: 12px;
}

/* IMAGE */
.message img {
    border-radius: 10px;
    margin-top: 5px;
    max-width: 100%;
}

/* =====================================
✍️ INPUT (MODERN)
===================================== */
.input-box {
    display: flex;
    gap: 6px;
    padding: 10px;
    background: rgba(0,0,0,0.9);
    border-top: 1px solid rgba(255,255,255,0.1);
}

.input-box input {
    flex: 1;
    padding: 10px;
    border-radius: 12px;
    border: none;
    background: #1a1a1a;
    color: white;
}

.input-box input:focus {
    outline: none;
    box-shadow: 0 0 0 2px gold;
}

/* =====================================
🔘 BUTTON (MODERN)
===================================== */
button {
    padding: 10px;
    background: linear-gradient(135deg, gold, orange);
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: 0.2s;
}

button:hover {
    transform: scale(1.08);
}

button:active {
    transform: scale(0.95);
}

/* =====================================
🔔 NOTIFICATION
===================================== */
.notif {
    position: absolute;
    top: 10px;
    right: 10px;
    background: red;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 10px;
}

/* =====================================
😀 EMOJI
===================================== */
.emoji-picker {
    position: fixed;
    bottom: 85px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    background: #1a1a1a;
    border-radius: 12px;
    padding: 10px;
}

/* =====================================
📱 MOBILE
===================================== */
@media (max-width: 600px) {
    .sidebar { display: none; }
    .message { max-width: 90%; }
    .input-box {
        position: fixed;
        bottom: 0;
        width: 100%;
    }
    .chat-box {
        padding-bottom: 70px;
    }
}

/* =====================================
🎬 ANIMATIONS
===================================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes appFade {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0% {opacity:1;}
    50% {opacity:0.3;}
    100% {opacity:1;}
}