/* =========================================================
   WhatsApp Web Pure CSS - Modern, Flawless, Zero-Overlap Layout
   ========================================================= */

:root {
    --bg-main: #eae6df;
    --bg-panel: #ffffff;
    --bg-header: #f0f2f5;
    --bg-chat: #efeae2;
    --bubble-sent: #d9fdd3;
    --bubble-recv: #ffffff;
    --text-primary: #111b21;
    --text-secondary: #667781;
    --text-muted: #8696a0;
    --border-color: #e9edef;
    --wa-green: #00a884;
    --wa-dark-green: #075e54;
    --wa-blue-tick: #53bdeb;
    --shadow-soft: 0 2px 5px rgba(11,20,26,0.1);
}

body.dark-theme {
    --bg-main: #0c1317;
    --bg-panel: #111b21;
    --bg-header: #202c33;
    --bg-chat: #0b141a;
    --bubble-sent: #005c4b;
    --bubble-recv: #202c33;
    --text-primary: #e9edef;
    --text-secondary: #aebac1;
    --text-muted: #8696a0;
    --border-color: #222e35;
    --wa-green: #00a884;
    --shadow-soft: 0 2px 5px rgba(0,0,0,0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-main);
    color: var(--text-primary);
}

/* Background Top Banner (WhatsApp Web signature look) */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 127px;
    background-color: var(--wa-dark-green);
    z-index: 0;
}
body.dark-theme::before {
    background-color: #0c1317;
}

/* Auth Layout */
.auth-wrapper {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    width: 100vw;
}

.auth-card {
    background: var(--bg-panel);
    color: var(--text-primary);
    padding: 35px 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}

.auth-header {
    text-align: center;
    color: var(--wa-green);
    margin-bottom: 24px;
}
.auth-header i { font-size: 54px; margin-bottom: 8px; }
.auth-header h2 { font-size: 24px; font-weight: 600; color: var(--text-primary); }

.auth-tabs {
    display: flex;
    margin-bottom: 22px;
    border-bottom: 2px solid var(--border-color);
}
.auth-tabs button {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-secondary);
}
.auth-tabs button.active {
    color: var(--wa-green);
    border-bottom: 3px solid var(--wa-green);
}

.input-group {
    display: flex;
    align-items: center;
    background: var(--bg-header);
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.input-group i { color: var(--text-muted); margin-right: 12px; font-size: 16px; width: 18px; text-align: center; }
.input-group input {
    border: none;
    background: transparent;
    width: 100%;
    outline: none;
    color: var(--text-primary);
    font-size: 15px;
}

.btn-green {
    width: 100%;
    padding: 13px;
    background: var(--wa-green);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-green:hover { background: #019474; }

/* Main App Wrapper (Centered Container on large screens) */
.app-container {
    position: relative;
    z-index: 10;
    display: flex;
    width: 100%;
    height: 100vh;
    max-width: 1650px;
    margin: 0 auto;
    background: var(--bg-panel);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    overflow: hidden;
}

@media (min-width: 1441px) {
    .app-container {
        height: calc(100vh - 38px);
        margin: 19px auto;
        border-radius: 4px;
    }
}

/* =========================================================
   LEFT SIDEBAR ARCHITECTURE
   ========================================================= */

.sidebar {
    width: 35%;
    max-width: 450px;
    min-width: 330px;
    height: 100%;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: var(--bg-panel);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-header {
    height: 60px;
    padding: 10px 16px;
    background: var(--bg-header);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.user-avatar img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; cursor: pointer; border: 1px solid var(--border-color); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.header-actions button { background: none; border: none; font-size: 18px; color: var(--text-secondary); cursor: pointer; padding: 6px; border-radius: 50%; transition: background 0.2s; }
.header-actions button:hover { background: rgba(0,0,0,0.06); }

/* Dropdown Menu */
.dropdown-wrapper { position: relative; display: inline-block; }
.dropdown-menu {
    position: absolute;
    right: 0;
    top: 40px;
    background: var(--bg-panel);
    box-shadow: 0 4px 18px rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 8px 0;
    min-width: 190px;
    z-index: 1000;
    border: 1px solid var(--border-color);
}
.dropdown-item {
    padding: 10px 18px;
    font-size: 14.5px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
}
.dropdown-item:hover { background: var(--bg-header); }
.dropdown-item i { width: 18px; color: var(--text-muted); }

/* Search & Filter Chips */
.search-section { padding: 8px 12px; background: var(--bg-panel); border-bottom: 1px solid var(--border-color); flex-shrink: 0; }
.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-header);
    padding: 7px 12px;
    border-radius: 8px;
}
.search-box i { color: var(--text-muted); font-size: 14px; margin-right: 8px; }
.search-box input {
    width: 100%;
    background: transparent;
    color: var(--text-primary);
    border: none;
    outline: none;
    font-size: 14px;
}

.filter-chips { display: flex; gap: 8px; margin-top: 8px; }
.filter-chips .chip {
    background: var(--bg-header);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 4px 12px;
    font-size: 12.5px;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
}
.filter-chips .chip.active { background: var(--wa-green); color: #fff; border-color: var(--wa-green); }

/* Sidebar Tabs: CHATS, STATUS, CALLS */
.sidebar-tabs {
    height: 42px;
    display: flex;
    background: var(--wa-green);
    color: #fff;
    flex-shrink: 0;
}
.sidebar-tabs .tab {
    flex: 1;
    text-align: center;
    line-height: 42px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.5px;
}
.sidebar-tabs .tab.active { border-bottom: 3.5px solid #ffffff; }

.tab-content {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-panel);
}

/* Chat & Call Items */
.chat-item, .call-log-item, .contact-pick-item {
    display: flex;
    padding: 12px 16px;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}
.chat-item:hover, .chat-item.active, .call-log-item:hover, .contact-pick-item:hover { background: var(--bg-header); }
.chat-item img, .call-log-item img, .contact-pick-item img { width: 48px; height: 48px; border-radius: 50%; margin-right: 14px; object-fit: cover; flex-shrink: 0; }
.chat-item-details, .call-details, .contact-details { flex: 1; min-width: 0; }
.chat-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.chat-item-header h4 { font-size: 16px; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-header span { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.chat-item-body { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; color: var(--text-secondary); }
.chat-item-body p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 85%; }
.unread-badge { background: #25d366; color: #fff; border-radius: 50%; padding: 2px 7px; font-size: 11px; font-weight: bold; }

/* Status Tab */
.my-status-card { display: flex; align-items: center; padding: 14px 16px; cursor: pointer; border-bottom: 1px solid var(--border-color); }
.status-avatar-wrapper { position: relative; width: 48px; height: 48px; margin-right: 14px; flex-shrink: 0; }
.status-avatar-wrapper img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.plus-icon { position: absolute; bottom: 0; right: 0; background: var(--wa-green); color: #fff; border-radius: 50%; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; font-size: 11px; border: 2px solid var(--bg-panel); }
.recent-status-header { padding: 14px 16px 8px 16px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.story-item { display: flex; align-items: center; padding: 10px 16px; cursor: pointer; }
.story-item:hover { background: var(--bg-header); }
.story-ring { width: 46px; height: 46px; border-radius: 50%; border: 2.5px solid var(--wa-green); margin-right: 14px; object-fit: cover; flex-shrink: 0; }

/* =========================================================
   SLIDE-IN PANELS (Smooth Slide inside Sidebar)
   ========================================================= */

.sidebar-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-panel);
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.25s ease-in-out;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.sidebar-panel.open { transform: translateX(0); }

.panel-header {
    height: 90px;
    background: var(--wa-green);
    color: #ffffff;
    display: flex;
    align-items: flex-end;
    padding: 16px 20px;
    gap: 20px;
    flex-shrink: 0;
}
.panel-header button { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; }
.panel-header h3 { font-size: 19px; font-weight: 600; }
.panel-body { flex: 1; overflow-y: auto; padding: 20px; }

/* Profile Form */
.profile-pic-section { text-align: center; margin-bottom: 25px; position: relative; width: 160px; margin-left: auto; margin-right: auto; }
.profile-pic-section img { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border-color); }
.edit-pic-badge { position: absolute; bottom: 6px; right: 6px; background: var(--wa-green); color: #fff; border-radius: 50%; width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 18px; box-shadow: 0 2px 6px rgba(0,0,0,0.25); }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13.5px; color: var(--wa-green); margin-bottom: 6px; font-weight: 500; }
.form-group input { width: 100%; padding: 11px 12px; border: 1px solid var(--border-color); border-radius: 6px; background: var(--bg-panel); color: var(--text-primary); outline: none; font-size: 15px; }
.static-text { font-size: 15px; color: var(--text-primary); padding: 4px 0; }

/* Settings Switches */
.setting-item { display: flex; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--border-color); cursor: pointer; }
.setting-icon { font-size: 20px; color: var(--text-secondary); margin-right: 18px; width: 26px; text-align: center; }
.setting-text { flex: 1; }
.setting-text h4 { font-size: 15px; color: var(--text-primary); font-weight: 500; }
.setting-text p { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .3s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .3s; border-radius: 50%; }
input:checked + .slider { background-color: var(--wa-green); }
input:checked + .slider:before { transform: translateX(20px); }

/* Group Details & Select Lists */
.members-select-list { max-height: 220px; overflow-y: auto; border: 1px solid var(--border-color); border-radius: 6px; padding: 10px; background: var(--bg-header); }
.select-member-row { display: flex; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border-color); font-size: 14px; }
.select-member-row input { width: auto; margin-right: 12px; }
.group-hero { text-align: center; margin-bottom: 20px; }
.group-hero img { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; margin-bottom: 10px; border: 2px solid var(--border-color); }
.group-section-title { display: flex; justify-content: space-between; align-items: center; margin: 18px 0 10px 0; font-size: 13px; color: var(--text-muted); font-weight: bold; }
.btn-sm-add { background: var(--wa-green); color: #fff; border: none; padding: 5px 12px; border-radius: 4px; cursor: pointer; font-size: 13px; }
.gi-member-item { display: flex; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border-color); }
.gi-member-item img { width: 40px; height: 40px; border-radius: 50%; margin-right: 12px; }
.gi-member-info { flex: 1; }
.admin-badge { background: #e9edef; color: var(--wa-green); font-size: 11px; padding: 2px 6px; border-radius: 4px; font-weight: bold; }
.btn-leave-group { width: 100%; margin-top: 25px; padding: 12px; background: #ea0038; color: #fff; border: none; border-radius: 8px; font-weight: bold; cursor: pointer; font-size: 15px; }

/* =========================================================
   RIGHT CHAT AREA ARCHITECTURE
   ========================================================= */

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-chat);
    background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png');
    position: relative;
    height: 100%;
    overflow: hidden;
    min-width: 0;
}

.empty-state {
    margin: auto;
    text-align: center;
    color: var(--text-secondary);
    padding: 20px;
}
.empty-state i { font-size: 80px; color: var(--wa-green); margin-bottom: 20px; }
.empty-state h2 { font-size: 28px; font-weight: 300; color: var(--text-primary); margin-bottom: 10px; }
.empty-state p { font-size: 14px; line-height: 20px; }
.encryption-tag { margin-top: 30px; font-size: 13px; color: var(--text-muted); }

.active-chat {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

.chat-header {
    height: 60px;
    padding: 10px 16px;
    background: var(--bg-header);
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.chat-header .back-btn { display: none; background: none; border: none; font-size: 18px; margin-right: 12px; color: var(--text-secondary); cursor: pointer; }
.chat-header img { width: 40px; height: 40px; border-radius: 50%; margin-right: 12px; object-fit: cover; cursor: pointer; flex-shrink: 0; }
.chat-header .chat-info { flex: 1; min-width: 0; cursor: pointer; }
.chat-header .chat-info h4 { font-size: 16px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-header .chat-info span { font-size: 12px; color: var(--text-muted); }
.chat-actions { display: flex; align-items: center; gap: 6px; }
.chat-actions button { background: none; border: none; font-size: 18px; color: var(--text-secondary); cursor: pointer; padding: 6px; border-radius: 50%; }
.chat-actions button:hover { background: rgba(0,0,0,0.06); }

/* In-Chat Search Bar */
.in-chat-search-bar {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.in-chat-search-bar input { flex: 1; padding: 8px 12px; border: 1px solid var(--border-color); border-radius: 6px; outline: none; margin: 0 10px; background: var(--bg-panel); color: var(--text-primary); font-size: 14px; }
.in-chat-search-bar button { background: none; border: none; font-size: 16px; color: var(--text-secondary); cursor: pointer; }

/* Messages Stream */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px 5%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.message-bubble {
    max-width: 65%;
    padding: 6px 9px 8px 9px;
    border-radius: 7.5px;
    font-size: 14.2px;
    line-height: 19px;
    position: relative;
    word-wrap: break-word;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-soft);
}
.message-bubble.sent { align-self: flex-end; background: var(--bubble-sent); border-top-right-radius: 0; }
.message-bubble.received { align-self: flex-start; background: var(--bubble-recv); border-top-left-radius: 0; }

.message-sender-name { font-size: 12.5px; font-weight: 600; color: var(--wa-green); margin-bottom: 3px; }

.message-content-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px;
}
.msg-body {
    flex: 1 1 auto;
    margin: 0;
    word-break: break-word;
}
.message-time-meta {
    font-size: 11px;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: auto;
    white-space: nowrap;
    align-self: flex-end;
}
.blue-tick { color: var(--wa-blue-tick); }

/* Quoted Reply inside Bubble */
.quoted-reply-box {
    background: rgba(0,0,0,0.06);
    border-left: 4px solid var(--wa-green);
    padding: 5px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
    font-size: 12.5px;
}
body.dark-theme .quoted-reply-box { background: rgba(255,255,255,0.08); }

/* Reactions Badges */
.reactions-badge-container {
    position: absolute;
    bottom: -10px;
    right: 10px;
    background: var(--bg-panel);
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    display: flex;
    gap: 3px;
    z-index: 5;
}
.msg-hover-actions {
    display: none;
    position: absolute;
    top: -15px;
    right: 10px;
    background: var(--bg-panel);
    border-radius: 16px;
    padding: 3px 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    gap: 8px;
    z-index: 20;
    border: 1px solid var(--border-color);
}
.message-bubble:hover .msg-hover-actions { display: flex; }
.msg-hover-actions button { background: none; border: none; font-size: 14px; cursor: pointer; color: var(--text-secondary); }

/* Quoted Reply Preview Bar */
.reply-preview-bar {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--bg-header);
    border-left: 5px solid var(--wa-green);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}
.reply-preview-bar .reply-content { flex: 1; }
.reply-preview-bar .reply-author { font-size: 12.5px; font-weight: 600; color: var(--wa-green); }
.reply-preview-bar .reply-text { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.reply-preview-bar button { background: none; border: none; font-size: 16px; color: var(--text-secondary); cursor: pointer; }

/* Attachment Popup */
.attachment-popup {
    position: absolute;
    bottom: 70px;
    left: 20px;
    background: var(--bg-panel);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 200;
    border: 1px solid var(--border-color);
}
.attach-item { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14px; color: var(--text-primary); }
.attach-icon { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; }

/* Emoji Picker Box */
.emoji-picker-container {
    padding: 10px 16px;
    background: var(--bg-panel);
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 22px;
    max-height: 150px;
    overflow-y: auto;
    flex-shrink: 0;
}
.emoji-picker-container span { cursor: pointer; transition: transform 0.1s; }
.emoji-picker-container span:hover { transform: scale(1.3); }

/* Chat Input Bar */
.chat-input-bar {
    padding: 8px 16px;
    background: var(--bg-header);
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 62px;
    flex-shrink: 0;
}
.chat-input-bar button { background: none; border: none; font-size: 20px; color: var(--text-secondary); cursor: pointer; padding: 6px; }
.chat-input-bar input {
    flex: 1;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    outline: none;
    background: var(--bg-panel);
    color: var(--text-primary);
    font-size: 15px;
}
#send-btn { color: var(--wa-green); }

/* Voice Recording Bar */
.voice-status {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-panel);
    padding: 8px 14px;
    border-radius: 8px;
}
.recording-dot { width: 12px; height: 12px; border-radius: 50%; background: #ea0038; animation: pulse 1s infinite; }
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.3; } 100% { opacity: 1; } }

/* Lightbox Modal */
.lightbox-modal {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.88); z-index: 10000;
    display: flex; align-items: center; justify-content: center;
}
.lightbox-modal img { max-width: 90%; max-height: 90%; border-radius: 8px; }

/* Story / Status Viewer Overlay */
.story-viewer-modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: #000; z-index: 10000; display: flex; flex-direction: column; }
.story-progress-bar { width: 100%; height: 4px; background: rgba(255,255,255,0.3); }
.story-progress-fill { width: 0%; height: 100%; background: #fff; transition: width 5s linear; }
.story-header { padding: 15px 20px; display: flex; align-items: center; color: #fff; gap: 12px; }
.story-header img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.story-header button { margin-left: auto; background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; }
.story-content { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; padding: 20px; }
#story-display-img { max-width: 90%; max-height: 75vh; object-fit: contain; border-radius: 8px; }
#story-display-text { color: #fff; font-size: 24px; font-weight: bold; text-align: center; max-width: 80%; }
#story-caption-text { color: #fff; margin-top: 15px; font-size: 16px; text-align: center; }

/* WebRTC Calling Modal */
.call-modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: #111b21; z-index: 9999; display: flex; justify-content: center; align-items: center; }
.call-container { width: 90%; max-width: 800px; height: 85vh; display: flex; flex-direction: column; }
.call-header { text-align: center; color: #fff; margin-bottom: 12px; }
.video-grid { flex: 1; position: relative; background: #000; border-radius: 12px; overflow: hidden; }
#remote-video { width: 100%; height: 100%; object-fit: cover; }
#local-video { position: absolute; bottom: 20px; right: 20px; width: 140px; height: 190px; border-radius: 8px; border: 2px solid #fff; object-fit: cover; }
.call-controls { display: flex; justify-content: center; gap: 20px; padding: 20px; }
.call-controls button { width: 52px; height: 52px; border-radius: 50%; border: none; font-size: 20px; background: #374248; color: #fff; cursor: pointer; }
.call-controls .btn-hangup { background: #ea0038; }

/* Incoming Call Dialog */
.incoming-call-dialog { position: fixed; top: 20px; right: 20px; background: var(--bg-panel); padding: 15px 20px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.3); display: flex; align-items: center; gap: 20px; z-index: 10000; border: 1px solid var(--border-color); }
.ring-anim { font-size: 26px; color: #25d366; animation: ring 1s infinite; }
@keyframes ring { 0% { transform: scale(1); } 50% { transform: scale(1.25); } 100% { transform: scale(1); } }
.incoming-actions button { width: 42px; height: 42px; border-radius: 50%; border: none; color: #fff; font-size: 16px; cursor: pointer; }
.btn-accept { background: #25d366; }
.btn-reject { background: #ea0038; }

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .sidebar { width: 100%; max-width: 100%; min-width: 100%; }
    .chat-area { display: none; }
    .app-container.chat-opened .sidebar { display: none; }
    .app-container.chat-opened .chat-area { display: flex; width: 100%; }
    .chat-header .back-btn { display: block; }
}
