* {
    box-sizing: border-box;
}
body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    margin: 0; 
    display: flex; 
    flex-direction: column;
    height: 100svh; 
    background: #eef2f5; 
    overflow: hidden;
}

.top-nav {
    width: 100%;
    height: 48px;
    background: #2196F3; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    color: white;
    padding: 0 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 100;
}
.app-logo {
    font-weight: bold; 
    font-size: 20px;
    letter-spacing: 0.5px;
}
.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}
.nav-icon-btn {
    font-size: 18px;
    cursor: pointer;
    text-decoration: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease, opacity 0.2s;
    user-select: none;
}
.nav-icon-btn:hover {
    transform: scale(1.15);
    opacity: 0.9;
}
.logout-color {
    font-size: 19px;
    margin-left: 2px;
}

.main-wrapper {
    display: flex;
    flex: 1;
    width: 100%;
    position: relative;
    height: calc(100svh - 48px);
}

.sidebar { 
    width: 320px; 
    background: white; 
    border-right: 1px solid #e2e8f0; 
    display: flex; 
    flex-direction: column; 
    z-index: 20;
    position: relative;
    flex-shrink: 0;
}

.search-container-slider {
    width: 100%;
    max-height: 0;
    overflow: hidden;
    background: #f1f5f9;
    transition: max-height 0.25s ease-in-out, padding 0.25s ease-in-out;
    padding: 0 12px;
}
.search-container-slider.active-search {
    max-height: 56px;
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
}
.search-box-inner {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 20px;
    padding: 2px 12px;
    border: 1px solid #cbd5e1;
}
.search-box-inner input {
    flex: 1;
    border: none;
    outline: none;
    padding: 8px 4px;
    font-size: 14px;
    background: transparent;
}
.search-close-btn {
    font-size: 14px;
    color: #94a3b8;
    cursor: pointer;
    margin-left: 4px;
    padding: 4px;
}
.search-close-btn:hover {
    color: #ef4444;
}

.chat-list { 
    flex: 1; 
    overflow-y: auto; 
}
.chat-item { 
    display: flex; 
    align-items: center; 
    padding: 12px 14px; 
    cursor: pointer; 
    border-bottom: 1px solid #f1f5f9; 
    user-select: none;
}
.chat-item:hover { 
    background: #f8fafc; 
}
.unread-chat { 
    background: #f0f7ff !important; 
} 
.avatar { 
    width: 48px; 
    height: 48px; 
    border-radius: 50%; 
    object-fit: cover; 
    background: #e2e8f0; 
    margin-right: 12px; 
    display: block;
}

.online-dot, .offline-dot { 
    width: 12px; 
    height: 12px; 
    border-radius: 50%; 
    position: absolute; 
    bottom: 2px; 
    right: 12px; 
    border: 2px solid white; 
}
.online-dot { background: #22c55e; }
.offline-dot { background: #cbd5e1; }

.chat-info { 
    flex: 1; 
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0; 
}
.chat-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.chat-info-row-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.chat-info h4 { 
    margin: 0; 
    color: #1e293b; 
    font-size: 15px; 
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.list-msg-time {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
    margin-left: 6px;
}
.list-last-msg { 
    margin: 0; 
    color: #64748b; 
    font-size: 13px; 
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.unread-badge {
    background: #22c55e;
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 8px;
}

.chat-area { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    background: #e5ddd5; 
    z-index: 10;
}

.chat-area.active-blank {
    display: flex;
    background: #f1f5f9;
    justify-content: center;
    align-items: center;
}

.chat-header { 
    background: #2196F3; 
    color: white; 
    padding: 10px 16px; 
    display: flex; 
    align-items: center; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
#back-btn-mobile {
    display: none; 
    background: none; 
    border: none; 
    color: white; 
    font-size: 22px; 
    margin-right: 12px; 
    cursor: pointer;
}
.chat-header-info h3 { margin: 0; font-size: 15px; font-weight: 600;}
.chat-header-info p { margin: 2px 0 0; font-size: 12px; color: #e0f2fe; opacity: 0.9; }

.chat-box { 
    flex: 1; 
    padding: 16px; 
    overflow-y: auto; 
    display: flex; 
    flex-direction: column; 
}
.msg-row { display: flex; margin-bottom: 12px; }
.my-msg { justify-content: flex-end; }
.other-msg { justify-content: flex-start; }

.msg-bubble { 
    max-width: 75%; 
    padding: 8px 12px 4px 12px; 
    border-radius: 16px; 
    font-size: 15px; 
    position: relative; 
    line-height: 1.4;
    display: flex;
    flex-direction: column;
}
.my-msg .msg-bubble { background: #dbeafe; color: #1e3a8a; border-top-right-radius: 0; }
.other-msg .msg-bubble { background: white; color: #334155; border-top-left-radius: 0; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }

.msg-meta { 
    display: flex; justify-content: flex-end; align-items: center;
    font-size: 10px; color: #64748b; margin-top: 4px; gap: 4px; align-self: flex-end;
}
.chat-delete-icon { color: #ef4444; cursor: pointer; margin-left: 4px; opacity: 0.4; }
.chat-delete-icon:hover { opacity: 1; }

.chat-inline-img { max-width: 200px; max-height: 250px; border-radius: 12px; display: block; cursor: pointer; object-fit: cover; }
.bubble-image { padding: 4px !important; background: #ffffff !important; border: 1px solid #e2e8f0; }
.my-msg .bubble-image { background: #dbeafe !important; }

/* 🎙️ ভয়েস মেসেজ প্লেয়ার কাস্টম সিএসএস */
.chat-voice-player {
    max-width: 240px;
    height: 36px;
    outline: none;
}
.bubble-voice {
    padding: 6px 8px 4px 8px !important;
    background: #ffffff !important;
}
.my-msg .bubble-voice {
    background: #dbeafe !important;
}

.chat-footer-container { 
    background: #f1f5f9; 
    padding: 10px 12px; 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
    border-top: 1px solid #e2e8f0; 
    width: 100%;
}
.quick-emojis { 
    display: flex; 
    justify-content: flex-start; 
    gap: 18px; 
    padding: 4px 8px; 
    overflow-x: auto;       
    white-space: nowrap;    
    -webkit-overflow-scrolling: touch; 
}
.quick-emojis::-webkit-scrollbar { display: none; }
.quick-emojis { -ms-overflow-style: none; scrollbar-width: none; }
.quick-emojis span { font-size: 24px; cursor: pointer; transition: transform 0.1s; display: inline-block; flex-shrink: 0; }
.quick-emojis span:hover { transform: scale(1.2); }

.input-wrapper-main { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    width: 100%; 
    max-width: 100%; 
}

.input-box-pill { 
    flex: 1; 
    height: 46px;
    background: white; 
    display: flex; 
    align-items: center; 
    padding: 0 14px; 
    border-radius: 24px; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
    min-width: 0; 
}
.input-box-pill input { 
    flex: 1; 
    border: none; 
    outline: none; 
    height: 100%;
    font-size: 15px; 
    background: transparent; 
    min-width: 0; 
    padding: 0;
}
.input-icon { font-size: 20px; color: #64748b; cursor: pointer; margin-left: 8px; flex-shrink: 0; }

#send-btn-round { 
    width: 46px; 
    height: 46px; 
    border-radius: 50%; 
    background: #00bcd4; 
    border: none; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    cursor: pointer; 
    flex-shrink: 0; 
    transition: background-color 0.2s, transform 0.1s;
}
#btn-icon { color: white; font-size: 20px; }

/* 🛑 রেকর্ডিং চলার সময় বাটনের লাল অ্যানিমেশন ইফেক্ট */
.recording-active {
    background-color: #ef4444 !important;
    animation: pulseRecording 1.2s infinite;
}
@keyframes pulseRecording {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.9; }
    100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 768px) {
    .sidebar { width: 100% !important; position: absolute; left: 0; top: 0; height: 100%; transition: transform 0.25s; }
    .sidebar.hide-mobile { transform: translateX(-100%); }
    .chat-area { width: 100% !important; position: absolute; left: 0; top: 0; height: 100%; }
    #back-btn-mobile { display: block !important; }
    .chat-area.active-blank { display: none !important; }
    
    .input-box-pill { height: 42px; padding: 0 12px; }
    #send-btn-round { width: 42px; height: 42px; }
    .input-box-pill input { font-size: 14px; }
    .quick-emojis span { font-size: 20px; }
    .chat-voice-player { max-width: 180px; }
}


/* ভয়েস মেসেজ বাবেল ও প্লেয়ারের ডিজাইন */
.bubble-voice {
    background: #f1f5f9 !important; /* হালকা ব্যাকগ্রাউন্ড */
    padding: 10px 14px !important;
    border-radius: 16px !important;
    max-width: 300px !important;
    display: inline-block;
}

.my-msg .bubble-voice {
    background: #e0f2fe !important; /* নিজের পাঠানো ভয়েসের ব্যাকগ্রাউন্ড */
}

.chat-voice-player {
    display: block;
    max-width: 100%;
    height: 36px;
    outline: none;
}

/* অডিও প্লেয়ারের ভেতরের কন্ট্রোলারের কালার ঠিক করার জন্য */
audio::-webkit-media-controls-enclosure {
    background-color: #f8fafc;
}