:root {
    --chat-bg: #0b141a;
    --accent-color: #00dcff;
    --primary-green: #00a884;
    --bg-container: #111b21;
    --text-main: #e9edef;
    --text-muted: #8696a0;
    --border-color: rgba(255, 255, 255, 0.08);
    --shadow-light: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* =========================================
   GLOBAL STYLES
========================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }

body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background-color: #000000; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    height: 100vh; 
    color: #ffffff;
    overflow: hidden;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.1)); border-radius: 10px; box-shadow: inset 0 1px 1px rgba(255,255,255,0.5); }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, rgba(0, 220, 255, 0.7), rgba(0, 220, 255, 0.3)); }

/* =========================================
   CONTAINERS & MODALS
========================================= */
.modal-overlay {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    backdrop-filter: blur(8px);
    background: rgba(11, 20, 26, 0.85) !important;
    display: flex; 
    align-items: center; 
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease-out;
}

.auth-container, #profile-container, #chat-container { 
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02)) !important; 
    backdrop-filter: blur(90px) !important; 
    -webkit-backdrop-filter: blur(90px) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important; 
    border-top: 1px solid rgba(255, 255, 255, 0.5) !important; 
    border-left: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.7), inset 0 2px 3px rgba(255, 255, 255, 0.2) !important;
    border-radius: 24px !important; 
}

.auth-container, #profile-container {
    padding: 40px; 
    width: 90%;
    max-width: 400px;
    text-align: center; 
    z-index: 10; 
    animation: slideUp 0.3s ease-out;
}

/* =========================================
   FORMS & BUTTONS
========================================= */
input, textarea, select { 
    width: 100%; 
    padding: 15px; 
    margin: 10px 0; 
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(255, 255, 255, 0.05)); 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px; 
    font-family: inherit; 
    color: #fff; 
    outline: none; 
    transition: 0.3s;
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.4);
    color-scheme: dark; 
}

input::placeholder, textarea::placeholder { 
    color: rgba(255, 255, 255, 0.5); 
    font-weight: 300; 
}

input:focus, textarea:focus, select:focus { 
    border-color: rgba(0, 220, 255, 0.8); 
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3), 0 0 10px rgba(0, 220, 255, 0.3); 
}
input::placeholder, textarea::placeholder { color: rgba(255, 255, 255, 0.6) !important; font-weight: 300; }
input:focus, textarea:focus, select:focus { 
    border-color: rgba(0, 220, 255, 0.8) !important; 
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 220, 255, 0.4) !important; 
}

button { 
    width: 100%; padding: 15px; margin-top: 15px;
    background: linear-gradient(180deg, rgba(0, 220, 255, 0.4) 0%, rgba(0, 220, 255, 0.15) 100%) !important; 
    color: #fff !important; 
    border: 1px solid rgba(0, 220, 255, 0.5) !important; 
    border-top: 1px solid rgba(255, 255, 255, 0.6) !important;
    border-radius: 12px !important; cursor: pointer; font-weight: bold; font-size: 15px; letter-spacing: 0.5px;
    transition: all 0.3s ease; 
}
button:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 12px 25px rgba(0, 220, 255, 0.5) !important;
}
button:active {
    transform: scale(0.98) !important;
}

.hidden { display: none !important; }

/* =========================================
   CHAT INTERFACE
========================================= */
#chat-container { 
    width: 650px; 
    height: 95vh; 
    max-height: 900px;
    display: flex; flex-direction: column; overflow: hidden; position: relative; 
}

#chat-header, #active-chat-header { 
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02)) !important; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: white !important; padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; 
}
#nav-tabs { display: flex; background: rgba(0, 0, 0, 0.3) !important; border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important; }
.nav-tab { 
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 15px 0; 
    cursor: pointer; font-size: 12px; text-transform: uppercase; font-weight: 600; transition: 0.3s;
    color: rgba(255,255,255,0.5) !important;
}
.nav-tab.active, .nav-tab:hover { 
    color: #fff !important; 
    background: linear-gradient(to top, rgba(255,255,255,0.1), transparent) !important;
    border-bottom: 2px solid #00dcff !important;
}
.nav-tab svg { width: 16px; height: 16px; fill: currentColor; }

#chat-list { flex: 1; overflow-y: auto; padding: 15px; background: transparent !important; }
h4 { color: rgba(255,255,255,0.6) !important; font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 15px; font-weight: 600; }
#dynamic-group-list > div:not(h4), #dynamic-user-list > div:not(h4) {
    transition: 0.3s; 
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), transparent) !important;
    border: 1px solid rgba(255, 255, 255, 0.02) !important; 
    border-radius: 16px; margin-bottom: 8px; padding: 15px !important;
}
#dynamic-group-list > div:not(h4):hover, #dynamic-user-list > div:not(h4):hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02)) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

#chat-box { 
    flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; 
    background: transparent !important; 
}

/* =========================================
   MESSAGES & ANIMATIONS
========================================= */
.message { 
    padding: 12px 16px; border-radius: 18px; max-width: 80%; font-size: 14px; position: relative; word-wrap: break-word; 
    backdrop-filter: blur(20px) !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3) !important;
    color: #fff !important; 
    animation: fadeIn 0.3s ease-out; 
}

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

@keyframes slideUp { 
    from { transform: translateY(20px); opacity: 0; } 
    to { transform: translateY(0); opacity: 1; } 
}

/* Needed for Live Location pulse effect */
@keyframes pulseDot {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

.message strong { font-size: 12px; opacity: 0.9; }

.my-message { 
    align-self: flex-end; 
    background: linear-gradient(135deg, rgba(0, 220, 255, 0.3) 0%, rgba(0, 220, 255, 0.1) 100%) !important; 
    border: 1px solid rgba(0, 220, 255, 0.3) !important;
    border-bottom-right-radius: 4px !important; 
}
.my-message strong { color: #80f3ff !important; }

.other-message { 
    align-self: flex-start; 
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%) !important; 
    border: 1px solid rgba(255, 255, 255, 0.15) !important; 
    border-bottom-left-radius: 4px !important; 
}
.other-message strong { color: #ff66b2 !important; }

.deleted-msg {
    font-style: italic;
    color: #888 !important;
    font-size: 13px;
    padding: 8px 12px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    text-align: center;
}

#reply-box {
    background: linear-gradient(90deg, rgba(0, 220, 255, 0.1), rgba(0, 220, 255, 0.02)) !important;
    border-left: 4px solid #00dcff !important;
    padding: 10px !important;
    margin: 5px 15px !important;
    border-radius: 12px !important;
    backdrop-filter: blur(20px) !important;
    color: #fff !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* =========================================
   INPUT AREA
========================================= */
#input-area { 
    display: flex; 
    padding: 15px 20px; 
    align-items: center; 
    gap: 8px;            
    position: relative;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
}

#input-area button {
    flex-shrink: 0;
}
input[type="datetime-local"] {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
}

#input-area > button[title="Attach"] {
    flex-shrink: 0;
    width: 48px; 
    height: 48px;
    background: rgba(255,255,255,0.05) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer;
    transition: 0.3s;
    margin-bottom: 2px;
}
#input-area > button[title="Attach"] svg { fill: rgba(255,255,255,0.7); transition: 0.3s; }
#input-area > button[title="Attach"]:hover { transform: scale(1.05); background: rgba(255,255,255,0.1) !important; }
#input-area > button[title="Attach"]:hover svg { fill: #fff; }

#message-input {
    flex: 1; 
    width: 100%;
    padding: 15px 22px; 
    border: 1px solid rgba(255,255,255,0.15) !important; 
    border-top: 1px solid rgba(255,255,255,0.3) !important; 
    border-radius: 24px !important; 
    outline: none !important; 
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(255, 255, 255, 0.05)) !important; 
    color: #fff !important; 
    font-size: 16px; 
    margin: 0; 
    box-shadow: inset 0 3px 6px rgba(0,0,0,0.5), 0 1px 1px rgba(255,255,255,0.1) !important;
    resize: none; 
    min-height: 52px; 
    max-height: 200px; 
    overflow-y: auto;
    line-height: 1.4;
    font-family: inherit;
    transition: background 0.3s, border-color 0.3s;
}
#message-input::-webkit-scrollbar { width: 4px; }
#message-input::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 4px; }
#message-input::placeholder { color: rgba(255,255,255,0.5) !important; }
#message-input:focus { border-color: rgba(0, 220, 255, 0.6) !important; }

#mic-btn {
    flex-shrink: 0;
    width: 48px; 
    height: 48px;
    background: transparent !important;
    border: none !important;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer;
    margin-bottom: 2px;
}
#mic-btn svg { fill: rgba(255,255,255,0.7); transition: 0.3s; }
#mic-btn:hover svg { fill: #fff; transform: scale(1.1); }

#send-btn {
    flex-shrink: 0;
    width: 48px; 
    height: 48px;
    background: linear-gradient(135deg, rgba(0, 220, 255, 0.5) 0%, rgba(0, 150, 255, 0.2) 100%) !important; 
    border-radius: 50% !important;
    border: 1px solid rgba(0, 220, 255, 0.5) !important;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 4px 15px rgba(0, 220, 255, 0.3) !important;
    margin-bottom: 2px;
}
#send-btn svg { width: 20px; height: 20px; fill: #fff !important; margin-left: 2px; }
#send-btn:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(0, 220, 255, 0.5) !important; }

/* =========================================
   MENUS & ATTACHMENTS
========================================= */
#dropdown-menu, #attachment-menu, #context-menu {
    background: linear-gradient(135deg, rgba(20, 30, 50, 0.9), rgba(10, 15, 30, 0.95)) !important; 
    backdrop-filter: blur(50px) !important; 
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.4) !important;
    border-left: 1px solid rgba(255, 255, 255, 0.25) !important;
    border-radius: 16px !important; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.8) !important; 
    z-index: 1000;
}

#dropdown-menu { 
    position: absolute; 
    top: 50px; 
    right: 15px; 
    width: 230px; 
    max-width: 90vw; 
    padding: 10px 0; 
    max-height: 70vh; 
    overflow-y: auto;
    background: linear-gradient(135deg, rgba(20, 30, 50, 0.95), rgba(10, 15, 30, 0.98)) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5) !important;
    z-index: 1000;
}

.status-ring {
    width: 60px; height: 60px; border-radius: 50%;
    border: 2px solid #00a884; display: flex;
    justify-content: center; align-items: center;
    padding: 2px;
}
.add-icon {
    font-size: 24px; color: #00a884; font-weight: bold;
}
#context-menu { position: absolute; width: 220px; padding: 8px 0; color: #e1e1e1; font-family: sans-serif; font-size: 14px; }

.menu-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px !important; font-size: 14px !important; cursor: pointer; color: #e1e1e1 !important; transition: all 0.2s ease !important; }
.menu-item:hover { background: rgba(0, 220, 255, 0.15) !important; border-left: 3px solid #00dcff; padding-left: 25px !important; color: #00dcff !important; }
.menu-item svg { width: 20px; height: 20px; fill: currentColor; opacity: 0.9; }

.menu-item[onclick*="deleteForEveryone"]:hover { color: #ff5c5c !important; background: rgba(255, 92, 92, 0.1) !important; border-left-color: #ff5c5c; }

#avatar-container {
    width: 100%;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.05); 
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 10px;
}

#avatar-canvas {
    width: 200px !important;
    height: 200px !important;
}

#attachment-menu { 
    position: absolute; 
    bottom: calc(100% + 15px); 
    left: 15px; 
    padding: 20px; 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 15px; 
}
.attach-item { 
    cursor: pointer; 
    padding: 8px; 
    text-align: center; 
    border-radius: 12px; 
    transition: all 0.3s; 
    background: transparent !important; 
    border: none !important; 
}

.attach-item:hover { 
    transform: translateY(-4px) scale(1.05); 
    background: rgba(255, 255, 255, 0.05) !important; 
}
/* =========================================
   EMOJI PICKER & REACTIONS 
========================================= */
.emoji-picker {
    position: absolute; 
    bottom: calc(100% + 15px); 
    left: 15px;
    background: rgba(20, 30, 50, 0.95) !important;
    backdrop-filter: blur(30px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    padding: 8px 12px !important; border-radius: 20px !important; display: flex; gap: 12px; z-index: 100;
}
.emoji-picker span { cursor: pointer; font-size: 18px; display: inline-block; transition: 0.2s; }
.emoji-picker span:hover { transform: scale(1.5) translateY(-4px) !important; }

[onclick^="reactMsg"] { transition: all 0.2s ease-in-out; }
[onclick^="reactMsg"]:hover { transform: scale(1.15); background: rgba(255, 255, 255, 0.2) !important; }

/* =========================================
   NEW ADDITIONS (AUDIO / VOICE MESSAGE)
========================================= */
audio { height: 35px; max-width: 100%; border-radius: 25px; outline: none; opacity: 0.9; transition: 0.3s; }
audio:hover { opacity: 1; }

/* =========================================
   STATUS & LIVE LOCATION STYLES
========================================= */
.live-icon { font-size: 30px; filter: drop-shadow(0 0 10px rgba(0, 220, 255, 0.6)); }
.live-status { font-size: 12px; color: #00dcff; font-weight: bold; }
.active-chat-item { background: rgba(255, 255, 255, 0.1) !important; border-left: 4px solid #00dcff !important; }

.status-bubble {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 60px;
}
.status-bubble img {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    border: 2px solid #00dcff; 
    object-fit: cover;
}

/* রাইট ক্লিক মেনু স্টাইল */
#context-menu {
    position: absolute;
    background: linear-gradient(135deg, rgba(20, 30, 50, 0.95), rgba(10, 15, 30, 0.98)) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    width: 200px !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6) !important;
    z-index: 1000;
    padding: 8px 0 !important;
    color: #e9edef !important;
    font-family: 'Inter', sans-serif;
    font-size: 14px !important;
}

.menu-item {
    padding: 10px 20px !important;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.menu-item:hover {
    background: rgba(0, 220, 255, 0.15) !important;
    color: #00dcff !important;
}

#whiteboard-canvas {
    width: 100%;
    max-width: 600px;
    height: auto;
    touch-action: none;
}