/* Guftagu Messaging App - Premium Stylesheet */

/* Design System & Variables */
:root {
    --bg-main: #0B0E14;
    --bg-panel: #151A24;
    --bg-card: rgba(26, 32, 46, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(0, 168, 132, 0.3);
    
    --primary: #00a884;
    --primary-hover: #00c298;
    --primary-glow: rgba(0, 168, 132, 0.2);
    --danger: #ef4444;
    --danger-hover: #dc2626;
    
    --text-main: #f0f2f5;
    --text-muted: #8696a0;
    --text-link: #53bdeb;
    
    --bubble-outgoing: #005c4b;
    --bubble-incoming: #202c33;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --glass-blur: blur(20px);
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

/* Custom Scrollbar for Webkit */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

body {
    background: var(--bg-main);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* ----------------------------------------- */
/* Authentication Pages CSS */
/* ----------------------------------------- */
.auth-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at top right, rgba(0, 168, 132, 0.15), transparent 40%),
                radial-gradient(circle at bottom left, rgba(83, 189, 235, 0.1), transparent 45%),
                #0b0e14;
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 40px 30px;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    animation: fadeIn 0.6s ease-out;
}

.glass {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header .logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 12px;
}

.auth-header h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-main);
}

.auth-header p {
    font-size: 14px;
    color: var(--text-muted);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(15, 20, 30, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 15px;
    outline: none;
    transition: var(--transition);
}

.input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

/* Message Box */
.message-box {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease-out;
}
.message-box.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}
.message-box.success {
    background: rgba(0, 168, 132, 0.15);
    border: 1px solid rgba(0, 168, 132, 0.3);
    color: #86efac;
}
.hidden {
    display: none !important;
}

/* Buttons */
.btn {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    box-shadow: 0 4px 15px rgba(0, 168, 132, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.auth-footer a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Spinner */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ----------------------------------------- */
/* App Layout CSS (WhatsApp Web Style) */
/* ----------------------------------------- */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    background: var(--bg-main);
}

/* Sidebar */
.sidebar {
    width: 380px;
    min-width: 320px;
    height: 100%;
    border-right: 1px solid var(--border-color);
    background: var(--bg-panel);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 20, 30, 0.4);
    border-bottom: 1px solid var(--border-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #53bdeb);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.username-display {
    font-weight: 600;
    font-size: 15px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
}

.icon-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}

.icon-btn.danger:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* Contacts search and list */
.contacts-search {
    padding: 12px 20px;
}

.search-wrapper {
    position: relative;
}

.search-wrapper input {
    width: 100%;
    padding: 10px 16px;
    background: rgba(15, 20, 30, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-main);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.search-wrapper input:focus {
    border-color: var(--primary);
}

.contacts-list {
    flex: 1;
    overflow-y: auto;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: var(--transition);
}

.contact-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.contact-item.active {
    background: rgba(0, 168, 132, 0.08);
}

.contact-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.contact-name-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-name {
    font-weight: 600;
    font-size: 15px;
}

.unread-badge {
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 4px;
}

.security-indicator {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Chat window area */
.chat-window {
    flex: 1;
    height: 100%;
    background: radial-gradient(circle at center, rgba(15, 20, 30, 0.4) 0%, rgba(11, 14, 20, 1) 100%),
                url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='%23ffffff' fill-opacity='0.015'%3E%3Cpath fill-rule='evenodd' d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm1-61c3.16 0 6-2.84 6-6s-2.84-6-6-6-6 2.84-6 6 2.84 6 6 6zm-.5 17c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm-.5 30c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm26-48c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5z'/%3E%3C/g%3E%3C/svg%3E");
    display: flex;
    flex-direction: column;
}

/* Empty state */
.chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    text-align: center;
    padding: 40px;
    animation: fadeIn 0.5s ease;
}

.chat-empty svg {
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.05);
}

.chat-empty h3 {
    color: var(--text-main);
    font-size: 20px;
    margin-bottom: 8px;
}

.chat-empty p {
    max-width: 320px;
    font-size: 14px;
    line-height: 1.5;
}

/* Active chat pane */
.chat-active {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
}

.chat-header .partner-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header .back-btn {
    display: none; /* Hidden on desktop */
}

.chat-header .status {
    font-size: 12px;
    color: var(--text-muted);
    display: block;
}

.chat-header .status.online {
    color: var(--primary);
}

.chat-actions {
    display: flex;
    gap: 12px;
}

.chat-actions .icon-btn.call-btn {
    color: var(--primary);
}
.chat-actions .icon-btn.call-btn:hover {
    background: rgba(0, 168, 132, 0.1);
}

/* Messages area */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message-bubble {
    max-width: 65%;
    padding: 10px 14px 8px 14px;
    border-radius: 12px;
    font-size: 14.5px;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    word-break: break-word;
    animation: popBubble 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message-bubble.outgoing {
    align-self: flex-end;
    background: var(--bubble-outgoing);
    color: var(--text-main);
    border-bottom-right-radius: 2px;
}

.message-bubble.incoming {
    align-self: flex-start;
    background: var(--bubble-incoming);
    color: var(--text-main);
    border-bottom-left-radius: 2px;
}

.message-bubble.system {
    align-self: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 12px;
    padding: 6px 16px;
    border-radius: 20px;
    box-shadow: none;
    text-align: center;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
    align-items: center;
    justify-content: center;
}

.message-time {
    align-self: flex-end;
    font-size: 10px;
    color: rgba(255,255,255,0.4);
    margin-top: 2px;
}

/* E2EE Lock Banner */
.security-banner {
    align-self: center;
    background: rgba(15, 20, 30, 0.8);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    color: #e5c158;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    max-width: 80%;
    text-align: center;
}

/* Media in messages */
.message-media {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 6px;
    display: block;
    cursor: pointer;
}

/* Message Input Area */
.message-input-area {
    padding: 12px 20px;
    background: var(--bg-panel);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.input-actions {
    display: flex;
}

.chat-input-box {
    flex: 1;
    position: relative;
}

.chat-input-box input {
    width: 100%;
    padding: 12px 18px;
    background: rgba(15, 20, 30, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    color: var(--text-main);
    font-size: 15px;
    outline: none;
    transition: var(--transition);
}

.chat-input-box input:focus {
    border-color: var(--primary);
    background: rgba(15, 20, 30, 0.9);
}

/* Image preview container */
.media-preview-container {
    position: absolute;
    bottom: 70px;
    left: 20px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    z-index: 10;
    animation: slideUp 0.25s ease;
}

.media-preview-container img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

.media-preview-details {
    font-size: 12px;
}

.media-preview-details span {
    display: block;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ----------------------------------------- */
/* WebRTC Video Call Screen overlays */
/* ----------------------------------------- */
.call-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #080a0f;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    animation: fadeIn 0.4s ease-out;
}

.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.remote-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

.local-video {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 160px;
    height: 240px;
    border-radius: 16px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    background: #222;
    z-index: 10;
    transition: var(--transition);
}

.call-details {
    position: absolute;
    top: 40px;
    left: 40px;
    z-index: 5;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.call-details h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 6px;
}

.call-details p {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    gap: 8px;
}

.call-controls {
    position: absolute;
    bottom: 50px;
    display: flex;
    gap: 20px;
    z-index: 10;
}

.control-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
    transition: var(--transition);
    color: white;
}

.control-btn.mute-btn {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
}
.control-btn.mute-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}
.control-btn.mute-btn.active {
    background: var(--danger);
}

.control-btn.hangup-btn {
    background: var(--danger);
}

.control-btn.hangup-btn:hover {
    background: var(--danger-hover);
    transform: scale(1.08);
}

/* Incoming Call Modal Banner */
.incoming-call-modal {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-150%);
    width: 90%;
    max-width: 450px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.6);
    z-index: 1000;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.incoming-call-modal.active {
    transform: translateX(-50%) translateY(0);
}

.caller-info-group {
    display: flex;
    align-items: center;
    gap: 14px;
}

.caller-info-text h4 {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
}

.caller-info-text p {
    font-size: 12px;
    color: var(--text-muted);
}

.call-modal-actions {
    display: flex;
    gap: 10px;
}

.modal-action-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: white;
    transition: var(--transition);
}

.modal-action-btn.accept {
    background: var(--primary);
}
.modal-action-btn.accept:hover {
    background: var(--primary-hover);
    transform: scale(1.08);
}

.modal-action-btn.decline {
    background: var(--danger);
}
.modal-action-btn.decline:hover {
    background: var(--danger-hover);
    transform: scale(1.08);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes popBubble {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ----------------------------------------- */
/* Responsive Design (Mobile Support) */
/* ----------------------------------------- */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        display: flex;
    }
    
    .chat-window {
        display: none; /* Default hide on mobile, only show when chat selected */
        width: 100%;
    }
    
    /* Toggle states for mobile single page mode */
    .mobile-chat-active .sidebar {
        display: none;
    }
    
    .mobile-chat-active .chat-window {
        display: flex;
    }
    
    .chat-header .back-btn {
        display: flex;
        color: var(--primary);
        margin-right: 8px;
    }

    .local-video {
        width: 110px;
        height: 165px;
        top: 20px;
        right: 20px;
    }
}

/* WhatsApp Web Dark style dropdown menu */
.header-dropdown-menu {
    position: absolute;
    top: 55px;
    right: 15px;
    background: #233138;
    border: none;
    border-radius: 8px;
    padding: 8px 0;
    width: 250px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: slideDown 0.15s ease-out;
}

.header-dropdown-menu .menu-item {
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14.5px;
    color: #e9edef;
    cursor: pointer;
    transition: background 0.1s ease;
}

.header-dropdown-menu .menu-item:hover {
    background: #182229;
}

.header-dropdown-menu .menu-item svg {
    color: #8696a0;
}

.header-dropdown-menu .menu-item.danger-action {
    color: #ef4444;
}
.header-dropdown-menu .menu-item.danger-action svg {
    color: #ef4444;
}
.header-dropdown-menu .menu-item.danger-action:hover {
    background: rgba(239, 68, 68, 0.1);
}

.header-dropdown-menu .menu-item.dropdown-item {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    cursor: default;
}
.header-dropdown-menu .menu-item.dropdown-item:hover {
    background: transparent;
}

.destruct-dropdown-header {
    width: 100%;
    background: #111b21;
    border: 1px solid #2a3942;
    color: #d1d7db;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s ease;
}
.destruct-dropdown-header:focus {
    border-color: #00a884;
}
.destruct-dropdown-header option {
    background: #111b21;
    color: #d1d7db;
}

.destruct-timer {
    display: block;
    font-size: 11px;
    color: #fca5a5;
    margin-top: 4px;
    font-weight: 600;
}

/* Voice Call UI Elements */
.voice-call-avatar-container {
    display: none;
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 5;
}
.voice-call-active .voice-call-avatar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.voice-call-avatar {
    width: 120px;
    height: 120px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: 700;
    box-shadow: 0 0 30px rgba(0, 200, 150, 0.4);
    animation: pulseAvatar 2s infinite;
}

@keyframes pulseAvatar {
    0% { box-shadow: 0 0 0 0 rgba(0, 200, 150, 0.4); }
    70% { box-shadow: 0 0 0 25px rgba(0, 200, 150, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 200, 150, 0); }
}

/* WhatsApp ticks styling */
.message-time {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.message-status {
    display: inline-flex;
    margin-left: 2px;
}
.ticks {
    font-size: 13px;
    color: #8696a0;
    line-height: 1;
}
.ticks.read {
    color: #53bdeb; /* WhatsApp blue tick color */
}

/* Sidebar Contact Unread Badge styling */
.unread-badge {
    background: #00a884; /* WhatsApp green */
    color: #111b21;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-sizing: border-box;
    margin-left: auto;
}
.unread-badge.hidden {
    display: none;
}

/* Profile Photo styling */
.clickable-avatar {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.clickable-avatar::after {
    content: "📷";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.clickable-avatar:hover::after {
    opacity: 1;
}
.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

/* Online Indicator status dot styling */
.avatar-wrapper {
    position: relative;
    display: inline-block;
}
.status-dot {
    position: absolute;
    bottom: 0px;
    right: 0px;
    width: 10px;
    height: 10px;
    background-color: #8696a0; /* Offline color */
    border: 2px solid #111b21; /* Panel background border */
    border-radius: 50%;
    transition: background-color 0.25s ease, box-shadow 0.25s ease;
    display: block;
}
.status-dot.online {
    background-color: #00a884; /* WhatsApp Green */
    box-shadow: 0 0 8px rgba(0, 168, 132, 0.6);
}

/* Chat Header online statuses */
.chat-header .status.online, .chat-header .status.typing {
    color: #00a884 !important;
    font-weight: 600;
}
.chat-header .status.offline {
    color: var(--text-muted) !important;
}

/* Profile Photo Crop Modal Styles */
.crop-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease-out;
}
.crop-modal.hidden {
    display: none !important;
}
.crop-modal-content {
    background: #233138;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.crop-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.crop-modal-header h3 {
    margin: 0;
    color: #e9edef;
    font-size: 18px;
}
.crop-modal-header .close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #8696a0;
    cursor: pointer;
}
.crop-area {
    width: 100%;
    background: #111b21;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    box-sizing: border-box;
}
.crop-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}
.crop-modal-footer .btn {
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 8px;
}
.crop-modal-footer .btn-secondary {
    background: #2a3942;
    color: #d1d7db;
}
.crop-modal-footer .btn-primary {
    background: #00a884;
    color: #111b21;
}
