/* ============================================
   Sunny - Ultra Modern Purple/Lavender Design System
   Matches Reference Chat App UI Design
   ============================================ */

:root {
    --primary: #5B42F3;
    --primary-hover: #4A32E1;
    --primary-dark: #3F2AB5;
    --primary-light: #F0EEFF;
    --primary-grad: linear-gradient(135deg, #6C5CE7 0%, #5B42F3 100%);
    --accent: #8065FF;
    
    --bg-app: linear-gradient(135deg, #EAE6FF 0%, #F5F3FF 50%, #ECE8FE 100%);
    --bg-sidebar: #FFFFFF;
    --bg-chat-header: linear-gradient(135deg, #5B42F3 0%, #6C5CE7 100%);
    --bg-chat-body: #F7F6FE;
    --bg-input: #FFFFFF;
    
    --incoming-msg: #5B42F3;
    --incoming-msg-text: #FFFFFF;
    --outgoing-msg: #FFFFFF;
    --outgoing-msg-text: #1F1D2B;
    
    --text-primary: #1F1D2B;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --text-light: #A09CB5;
    
    --online: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    
    --border-subtle: rgba(91, 66, 243, 0.08);
    --border-glass: rgba(255, 255, 255, 0.8);
    
    --shadow-sm: 0 4px 12px rgba(91, 66, 243, 0.04);
    --shadow-md: 0 10px 25px rgba(91, 66, 243, 0.08);
    --shadow-lg: 0 20px 40px rgba(91, 66, 243, 0.12);
    --shadow-glow: 0 8px 24px rgba(91, 66, 243, 0.35);
    
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 26px;
    --radius-pill: 50px;
    
    --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    font-family: var(--font-body);
    background: var(--bg-app);
    color: var(--text-primary);
    overflow: hidden;
    overscroll-behavior: none;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: rgba(91, 66, 243, 0.2);
    color: var(--primary);
}

/* Custom Scrollbar */
*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
*::-webkit-scrollbar-track {
    background: transparent;
}
*::-webkit-scrollbar-thumb {
    background: rgba(91, 66, 243, 0.15);
    border-radius: 10px;
}
*::-webkit-scrollbar-thumb:hover {
    background: rgba(91, 66, 243, 0.3);
}

/* ============================================
   AUTH SCREEN
   ============================================ */
.auth-screen {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-app);
    padding: 20px;
    position: relative;
}

.auth-card {
    background: #FFFFFF;
    border-radius: 32px;
    padding: 44px 40px;
    width: 420px;
    max-width: 100%;
    box-shadow: 0 20px 50px rgba(91, 66, 243, 0.12);
    text-align: center;
    border: 1px solid var(--border-glass);
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.auth-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--primary-grad);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: #FFFFFF;
    box-shadow: var(--shadow-glow);
}

.auth-title {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 28px;
}

.auth-tabs {
    display: flex;
    gap: 6px;
    background: #F4F3FD;
    border-radius: var(--radius-pill);
    padding: 5px;
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    padding: 11px 16px;
    border: none;
    border-radius: var(--radius-pill);
    background: transparent;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.auth-tab.active {
    background: var(--primary);
    color: #FFFFFF;
    box-shadow: var(--shadow-glow);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.input-group {
    display: flex;
    align-items: center;
    background: #F8F7FF;
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 13px 16px;
    transition: var(--transition);
}

.input-group:focus-within {
    border-color: var(--primary);
    background: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(91, 66, 243, 0.1);
}

.input-group i {
    color: var(--primary);
    margin-right: 12px;
    font-size: 15px;
}

.input-group input,
.input-group select,
.input-group textarea {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 15px;
    font-family: var(--font-body);
    color: var(--text-primary);
    width: 100%;
}

.auth-btn {
    background: var(--primary-grad);
    color: #FFFFFF;
    border: none;
    padding: 15px 24px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 700;
    font-family: var(--font-display);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-glow);
    margin-top: 6px;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(91, 66, 243, 0.4);
}

/* ============================================
   MAIN APP LAYOUT (Multi-pane / Glass Frame)
   ============================================ */
.main-app {
    display: flex;
    height: 100vh;
    height: 100dvh;
    padding: 24px;
    gap: 24px;
    background: var(--bg-app);
    max-width: 1600px;
    margin: 0 auto;
}

/* ============================================
   SIDEBAR (Left Screen Mockup)
   ============================================ */
.sidebar {
    width: 380px;
    min-width: 340px;
    background: #FFFFFF;
    border-radius: 28px;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-glass);
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 22px 14px 22px;
    background: #FFFFFF;
}

.profile-section {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-grad);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(91, 66, 243, 0.25);
    background-size: cover;
    background-position: center;
    position: relative;
}

.avatar-large {
    width: 68px;
    height: 68px;
    font-size: 28px;
}

.profile-meta {
    display: flex;
    flex-direction: column;
}

.profile-greeting {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.1;
}

.profile-name {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

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

.icon-btn-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid #ECEAFE;
    background: #F8F7FF;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.icon-btn-circle:hover {
    background: var(--primary-light);
    color: var(--primary);
    transform: scale(1.05);
}

/* Header Dropdown Menu */
.dropdown-wrapper {
    position: relative;
}

.header-menu-dropdown {
    display: none;
    position: absolute;
    top: 50px;
    right: 0;
    background: #FFFFFF;
    border-radius: 20px;
    box-shadow: 0 14px 40px rgba(91, 66, 243, 0.15);
    border: 1px solid rgba(91, 66, 243, 0.1);
    min-width: 210px;
    padding: 8px;
    z-index: 100;
    animation: fadeInDown 0.25s ease;
}

.header-menu-dropdown.show {
    display: flex;
    flex-direction: column;
}

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

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
    width: 100%;
}

.menu-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.menu-item.danger {
    color: var(--danger);
}
.menu-item.danger:hover {
    background: #FEE2E2;
}

.menu-divider {
    height: 1px;
    background: #F0EEFF;
    margin: 4px 0;
}

/* Tab Filtering Bar ("All Chats", "Groups", "Contacts") */
.sidebar-tabs-bar {
    display: flex;
    background: #F4F3FD;
    margin: 8px 20px 14px 20px;
    padding: 5px;
    border-radius: var(--radius-pill);
    gap: 4px;
}

.sidebar-tab {
    flex: 1;
    padding: 9px 12px;
    border: none;
    border-radius: var(--radius-pill);
    background: transparent;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13.5px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-tab.active {
    background: var(--primary);
    color: #FFFFFF;
    box-shadow: 0 4px 14px rgba(91, 66, 243, 0.3);
}

/* Search bar */
.search-bar {
    display: flex;
    align-items: center;
    margin: 0 20px 14px 20px;
    padding: 10px 16px;
    background: #F8F7FF;
    border-radius: var(--radius-pill);
    gap: 10px;
    border: 1.5px solid transparent;
    transition: var(--transition);
}

.search-bar:focus-within {
    border-color: var(--primary);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(91, 66, 243, 0.1);
}

.search-bar i {
    color: var(--text-muted);
    font-size: 14px;
}

.search-bar input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: var(--text-primary);
}

/* Pending Requests Badge */
.pending-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 20px 10px 20px;
    padding: 10px 16px;
    background: #FFFBEB;
    border-radius: 14px;
    border: 1px solid #FDE68A;
    color: #D97706;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.badge-count {
    background: var(--danger);
    color: #FFFFFF;
    border-radius: 50px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 700;
    margin-left: auto;
}

/* Chat list */
.chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px 70px 12px;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 14px 14px;
    margin-bottom: 4px;
    border-radius: 18px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.chat-item:hover {
    background: #F8F7FF;
}

.chat-item.active {
    background: var(--primary-light);
}

.chat-item-info {
    flex: 1;
    margin-left: 14px;
    overflow: hidden;
    min-width: 0;
}

.chat-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.chat-item-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-last-msg {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 3px;
}

.chat-item-time {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
}

.unread-badge {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(91, 66, 243, 0.3);
}

.online-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--online);
    border: 2px solid #FFFFFF;
    position: absolute;
    bottom: 12px;
    left: 48px;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

/* Sidebar FAB */
.sidebar-fab {
    position: absolute;
    bottom: 24px;
    right: 24px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--primary-grad);
    color: #FFFFFF;
    border: none;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-glow);
    transition: var(--transition);
    z-index: 10;
}

.sidebar-fab:hover {
    transform: scale(1.08) rotate(90deg);
}

/* ============================================
   CHAT AREA (Middle Screen Mockup)
   ============================================ */
.chat-area {
    flex: 1;
    background: var(--bg-chat-body);
    border-radius: 28px;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-glass);
    overflow: hidden;
}

.chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    padding: 30px;
}

.chat-empty-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.chat-empty h2 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.chat-window {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

/* Curved Purple Header (Matches 2nd screen top header in reference image!) */
.chat-header {
    background: var(--primary-grad);
    color: #FFFFFF;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
    box-shadow: 0 10px 30px rgba(91, 66, 243, 0.2);
    z-index: 5;
}

.chat-header-user {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
}

.chat-header-info {
    display: flex;
    flex-direction: column;
}

.chat-header-info .profile-name {
    color: #FFFFFF;
    font-size: 19px;
}

.chat-header-info .profile-status {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
}

.header-call-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #FFFFFF;
}

.header-call-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    color: #FFFFFF;
}

.mobile-back-btn {
    display: none;
    background: transparent;
    border: none;
    color: #FFFFFF;
    font-size: 20px;
    margin-right: 10px;
    cursor: pointer;
}

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

.message {
    display: flex;
    flex-direction: column;
    max-width: 68%;
    animation: msgIn 0.3s ease;
}

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

.message.incoming {
    align-self: flex-start;
}

.message.outgoing {
    align-self: flex-end;
}

.message-bubble {
    padding: 14px 18px;
    font-size: 15px;
    line-height: 1.5;
    word-break: break-word;
    position: relative;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.message.incoming .message-bubble {
    background: var(--incoming-msg);
    color: var(--incoming-msg-text);
    border-radius: 22px 22px 22px 6px;
}

.message.outgoing .message-bubble {
    background: var(--outgoing-msg);
    color: var(--outgoing-msg-text);
    border-radius: 22px 22px 6px 22px;
}

.message-meta {
    font-size: 11px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.message.incoming .message-meta {
    color: rgba(255, 255, 255, 0.7);
    justify-content: flex-start;
}

.message.outgoing .message-meta {
    color: var(--text-muted);
    justify-content: flex-end;
}

/* Document Attachment Pill inside Chat Bubble (Matches "UI Brief.docx" in reference image!) */
.file-attachment-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
    padding: 12px 16px;
    border-radius: 16px;
    margin-top: 6px;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.message.outgoing .file-attachment-card {
    background: #F4F3FD;
    border: 1px solid #EAE6FF;
}

.file-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #FFFFFF;
}

.message.outgoing .file-icon {
    background: var(--primary-light);
    color: var(--primary);
}

.file-details {
    flex: 1;
    overflow: hidden;
}

.file-name {
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 11px;
    opacity: 0.8;
}

.file-download-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.message.outgoing .file-download-btn {
    background: var(--primary);
    color: #FFFFFF;
}

/* Floating Input Bar (Matches bottom floating input in reference image) */
.chat-input-area {
    margin: 16px 20px 20px 20px;
    padding: 8px 12px 8px 18px;
    background: #FFFFFF;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(91, 66, 243, 0.08);
    border: 1px solid var(--border-glass);
}

.icon-btn-input {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
}

.icon-btn-input:hover {
    color: var(--primary);
}

.input-wrapper {
    flex: 1;
}

.input-wrapper input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 15px;
    font-family: var(--font-body);
    color: var(--text-primary);
    background: transparent;
}

.send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-grad);
    color: #FFFFFF;
    border: none;
    font-size: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-glow);
    transition: var(--transition);
}

.send-btn:hover {
    transform: scale(1.06);
}

/* ============================================
   CALL MODAL (Matches 3rd Phone Mockup Screen!)
   ============================================ */
.call-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 12, 35, 0.7);
    backdrop-filter: blur(16px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.call-card-frame {
    width: 420px;
    height: 720px;
    max-width: 95vw;
    max-height: 90vh;
    background: #121026;
    border-radius: 36px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Top call bar overlay */
.call-header-overlay {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, transparent 100%);
}

.call-user-meta {
    display: flex;
    align-items: center;
    gap: 14px;
}

.call-meta-text .call-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 20px;
    color: #FFFFFF;
}

.call-meta-text .call-status {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.call-video-container {
    position: absolute;
    inset: 0;
    background: #181534;
}

.remote-video-feed {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Floating Local Video Picture-in-Picture (PiP) */
.local-pip-card {
    position: absolute;
    bottom: 110px;
    right: 20px;
    width: 110px;
    height: 150px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 2px solid var(--primary);
    z-index: 10;
    background: #000;
}

.local-video-feed {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Bottom Control Translucent Action Pill Bar */
.call-action-pill-bar {
    margin: 20px;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    border-radius: 50px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.call-action-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.3);
    color: #FFFFFF;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.call-action-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.5);
}

.call-action-btn.end-btn,
.call-action-btn.reject-btn {
    background: #EF4444;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
}

.call-action-btn.accept-btn {
    background: #10B981;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

/* ============================================
   MODALS (Profile, Watch Together, Games, etc.)
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 12, 35, 0.6);
    backdrop-filter: blur(10px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal {
    background: #FFFFFF;
    border-radius: 28px;
    width: 480px;
    max-width: 95vw;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-glass);
    overflow: hidden;
    animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-large {
    width: 800px;
}

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.94);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    padding: 20px 24px;
    background: #F8F7FF;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
}

.modal-body {
    padding: 24px;
    max-height: 80vh;
    overflow-y: auto;
}

/* Translucent icon button for call modal top bar */
.icon-btn-circle.translucent {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #FFFFFF;
}
.icon-btn-circle.translucent:hover {
    background: rgba(255, 255, 255, 0.4);
    color: #FFFFFF;
}

/* Chat Info Panel (Right Drawer) */
.chat-info-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    background: #FFFFFF;
    box-shadow: -10px 0 30px rgba(91, 66, 243, 0.15);
    z-index: 200;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 1px solid var(--border-subtle);
}

.chat-info-panel.open {
    transform: translateX(0);
}

.chat-info-header {
    padding: 32px 24px;
    background: var(--bg-chat-body);
    text-align: center;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chat-info-header h3 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    margin-top: 10px;
}

.chat-info-header p {
    font-size: 13px;
    color: var(--online);
}

.chat-info-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.chat-info-actions {
    padding: 20px 24px;
    border-top: 1px solid var(--border-subtle);
}

.info-action-btn {
    width: 100%;
    padding: 12px;
    border-radius: 14px;
    border: none;
    font-weight: 700;
    cursor: pointer;
}

.info-action-btn.danger {
    background: #FEE2E2;
    color: var(--danger);
}

/* Responsive Rules for Mobile */
@media (max-width: 850px) {
    .main-app {
        padding: 0;
        gap: 0;
    }
    .sidebar {
        width: 100%;
        min-width: 100%;
        border-radius: 0;
    }
    .chat-area {
        position: fixed;
        inset: 0;
        z-index: 100;
        border-radius: 0;
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }
    .main-app.mobile-chat-open .chat-area {
        transform: translateX(0);
    }
    .mobile-back-btn {
        display: flex;
    }
}