/* SENDT v14.0 - Thème Sénégalais + WhatsApp + SENDT Phone Login + E2EE */
:root {
    --sn-green: #00853F; --sn-yellow: #FDEF42; --sn-red: #E31B23;
    --wa-green: #00853F; --wa-dark: #111B21; --wa-darker: #0B141A;
    --wa-panel: #1F2C34; --wa-hover: #2A3942; --wa-outgoing: #005C4B;
    --wa-incoming: #1F2C34; --wa-text: #E9EDEF; --wa-text-muted: #8696A0;
    --wa-border: #2A3942; --wa-input-bg: #2A3942; --wa-header-bg: #1F2C34;
    --bg-primary: var(--wa-dark); --bg-secondary: var(--wa-panel); --bg-tertiary: var(--wa-hover);
    --text-primary: var(--wa-text); --text-muted: var(--wa-text-muted);
    --accent-primary: var(--sn-green); --accent-danger: var(--sn-red); --accent-warning: var(--sn-yellow);
    --border-color: var(--wa-border); --radius: 8px; --radius-lg: 12px;
    --login-bg-top: #0a1628; --login-bg-bottom: #0d1f1a; --login-card-bg: #111B21;
    --login-input-bg: #1a2a36; --login-input-border: #2a4050;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif; background: var(--bg-primary); color: var(--text-primary); height: 100vh; overflow: hidden; }
.screen { display: none; position: fixed; inset: 0; z-index: 1; } .screen.active { display: flex; }
.hidden { display: none !important; }
#loading-screen { background: var(--bg-primary); align-items: center; justify-content: center; z-index: 100; }
.loading-content { text-align: center; }
.sendt-flag-icon { display: flex; width: 80px; height: 56px; border-radius: 6px; overflow: hidden; margin: 0 auto 20px; box-shadow: 0 4px 20px rgba(0,0,0,.4); }
.sendt-flag-icon.small { width: 48px; height: 34px; margin-bottom: 12px; }
.sendt-flag-icon.large { width: 120px; height: 84px; margin-bottom: 24px; box-shadow: 0 8px 32px rgba(0,0,0,.5); }
.flag-stripe { flex: 1; display: flex; align-items: center; justify-content: center; }
.flag-stripe.green { background: var(--sn-green); } .flag-stripe.yellow { background: var(--sn-yellow); } .flag-stripe.red { background: var(--sn-red); }
.flag-star { color: var(--sn-green); font-size: 1.2em; font-weight: bold; }
.sendt-flag-icon.small .flag-star { font-size: .8em; } .sendt-flag-icon.large .flag-star { font-size: 2em; }
.sendt-title { font-size: 2.5rem; font-weight: 700; color: var(--text-primary); letter-spacing: 6px; }
.sendt-subtitle { color: var(--text-muted); margin-top: 8px; font-size: .95rem; }
.loading-spinner { margin-top: 30px; } .spinner-ring { width: 40px; height: 40px; border: 3px solid var(--wa-hover); border-top-color: var(--sn-green); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
#login-screen { background: linear-gradient(165deg, #0a1628 0%, #0d1a2d 30%, #0a2018 60%, #0d1f1a 100%); align-items: center; justify-content: center; position: relative; overflow: hidden; }
#login-screen::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 20% 20%, rgba(0,133,63,0.06) 0%, transparent 50%), radial-gradient(ellipse at 80% 80%, rgba(0,133,63,0.04) 0%, transparent 50%), radial-gradient(ellipse at 50% 50%, rgba(0,40,80,0.08) 0%, transparent 70%); pointer-events: none; }
.login-container { width: 100%; max-width: 420px; padding: 40px 24px 30px; position: relative; z-index: 1; }
.login-header { text-align: center; background: var(--sn-green); border-radius: 20px 20px 0 0; padding: 32px 24px 28px; position: relative; overflow: hidden; }
.login-header::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.08) 0%, transparent 60%), radial-gradient(ellipse at 70% 80%, rgba(0,0,0,0.1) 0%, transparent 50%); pointer-events: none; }
.login-phone-icon { width: 72px; height: 72px; border-radius: 50%; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; position: relative; z-index: 1; box-shadow: 0 4px 20px rgba(0,0,0,0.15); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); border: 2px solid rgba(255,255,255,0.15); }
.login-phone-icon i { font-size: 1.8rem; color: #fff; }
.login-flag { margin: 0 auto 14px !important; box-shadow: 0 2px 12px rgba(0,0,0,0.3); position: relative; z-index: 1; }
.login-header h1 { font-size: 1.8rem; letter-spacing: 3px; color: #fff; font-weight: 700; margin-bottom: 6px; position: relative; z-index: 1; text-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.login-header p { color: rgba(255,255,255,0.8); font-size: .92rem; letter-spacing: 0.5px; position: relative; z-index: 1; }
.login-form-card { background: rgba(17,27,33,0.85); border: 1px solid rgba(42,64,80,0.5); border-top: none; border-radius: 0 0 20px 20px; padding: 28px 24px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.login-form-card .form-group { margin-bottom: 18px; }
.login-form-card .form-group label { display: block; margin-bottom: 8px; font-size: .82rem; color: var(--wa-text-muted); font-weight: 500; letter-spacing: 0.3px; }
.login-form-card .form-group label i { margin-right: 6px; color: var(--sn-green); font-size: .8rem; }
.login-form-card .form-group input, .login-form-card .form-group select { width: 100%; padding: 14px 16px; background: var(--login-input-bg); border: 1px solid var(--login-input-border); border-radius: 10px; color: #fff; font-size: .95rem; outline: none; transition: border-color .25s, box-shadow .25s; }
.login-form-card .form-group input:focus { border-color: var(--sn-green); box-shadow: 0 0 0 3px rgba(0,133,63,0.15); }
.login-form-card .form-group input::placeholder { color: rgba(134,150,160,0.6); }
.login-form-card .form-hint { color: var(--wa-text-muted); font-size: .73rem; margin-top: 6px; display: block; opacity: 0.8; }
.login-form-card .password-wrapper { position: relative; }
.login-form-card .toggle-password { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--wa-text-muted); cursor: pointer; padding: 4px; font-size: .9rem; transition: color .2s; }
.login-form-card .toggle-password:hover { color: var(--sn-green); }
.login-form-card .form-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.login-form-card .checkbox-label { display: flex; align-items: center; gap: 8px; color: var(--wa-text-muted); font-size: .85rem; cursor: pointer; }
.login-form-card .checkbox-label input[type="checkbox"] { accent-color: var(--sn-green); width: 16px; height: 16px; }
.login-form-card .error-message { color: var(--accent-danger); font-size: .85rem; margin-bottom: 12px; display: none; text-align: center; padding: 8px; background: rgba(227,27,35,0.1); border-radius: 8px; }
.login-form-card .error-message.show { display: block; }
.login-form-card .btn-primary { width: 100%; padding: 14px; background: var(--sn-green); color: #fff; border: none; border-radius: 10px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: all .25s; letter-spacing: 0.5px; box-shadow: 0 4px 16px rgba(0,133,63,0.3); }
.login-form-card .btn-primary:hover { filter: brightness(1.1); box-shadow: 0 6px 24px rgba(0,133,63,0.4); transform: translateY(-1px); }
.login-form-card .btn-primary:active { transform: translateY(0); }
.login-form-card .btn-primary:disabled { opacity: .6; transform: none; box-shadow: none; }
.login-footer { text-align: center; margin-top: 28px; padding-top: 4px; }
.login-footer-text { color: var(--wa-text-muted); font-size: .78rem; margin-bottom: 10px; letter-spacing: 0.3px; opacity: 0.8; }
.login-badges { display: flex; justify-content: center; gap: 10px; }
.login-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 14px; border-radius: 20px; font-size: .72rem; font-weight: 600; letter-spacing: 0.3px; }
.login-badge i { font-size: .65rem; }
.badge-secure { background: rgba(0,133,63,0.15); color: var(--sn-green); border: 1px solid rgba(0,133,63,0.3); }
.badge-e2ee { background: rgba(134,150,160,0.1); color: var(--wa-text-muted); border: 1px solid rgba(134,150,160,0.2); }
.form-group { margin-bottom: 16px; } .form-group label { display: block; margin-bottom: 6px; font-size: .85rem; color: var(--text-muted); }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 12px; background: var(--wa-input-bg); border: 1px solid var(--border-color); border-radius: var(--radius); color: var(--text-primary); font-size: .95rem; outline: none; transition: border-color .2s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--accent-primary); }
.form-hint { color: var(--text-muted); font-size: .75rem; margin-top: 4px; display: block; }
.password-wrapper { position: relative; } .toggle-password { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-muted); cursor: pointer; }
.form-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: .85rem; cursor: pointer; }
.error-message { color: var(--accent-danger); font-size: .85rem; margin-bottom: 12px; display: none; } .error-message.show { display: block; }
.btn-primary { width: 100%; padding: 12px; background: var(--sn-green); color: #fff; border: none; border-radius: var(--radius); font-size: 1rem; font-weight: 600; cursor: pointer; transition: .2s; }
.btn-primary:hover { filter: brightness(1.1); } .btn-primary:disabled { opacity: .6; }
.btn-secondary { padding: 10px 20px; background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border-color); border-radius: var(--radius); cursor: pointer; font-size: .9rem; transition: .2s; }
.btn-secondary:hover { background: var(--wa-hover); }
.btn-text { background: none; border: none; color: var(--accent-primary); cursor: pointer; font-size: .85rem; }
.app-layout { display: flex; height: 100vh; width: 100%; }
.sidebar { width: 360px; background: var(--bg-secondary); border-right: 1px solid var(--border-color); display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: var(--wa-header-bg); border-bottom: 1px solid var(--border-color); }
.sidebar-user { display: flex; align-items: center; gap: 10px; cursor: pointer; flex: 1; }
.sidebar-actions { display: flex; gap: 4px; }
.icon-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 8px; border-radius: var(--radius); font-size: 1rem; transition: .15s; }
.icon-btn:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.search-bar { display: flex; align-items: center; padding: 8px 12px; gap: 10px; background: var(--bg-secondary); }
.search-bar input { flex: 1; background: var(--wa-input-bg); border: none; padding: 8px 12px; border-radius: 20px; color: var(--text-primary); font-size: .9rem; outline: none; }
.search-bar i { color: var(--text-muted); }
.tabs { display: flex; border-bottom: 1px solid var(--border-color); }
.tab { flex: 1; padding: 12px; background: none; border: none; border-bottom: 3px solid transparent; color: var(--text-muted); cursor: pointer; font-size: .8rem; transition: .2s; }
.tab.active { color: var(--sn-green); border-bottom-color: var(--sn-green); }
.contact-list { flex: 1; overflow-y: auto; }
.contact-item { display: flex; align-items: center; padding: 12px 16px; gap: 12px; cursor: pointer; transition: background .15s; position: relative; }
.contact-item:hover { background: var(--bg-tertiary); }
.avatar { width: 45px; height: 45px; border-radius: 50%; background: var(--bg-tertiary); display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.avatar.small { width: 36px; height: 36px; }
.avatar-initial { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; font-weight: 600; color: #fff; border-radius: 50%; }
.avatar img, .contact-avatar-img, .sidebar-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.contact-details { flex: 1; min-width: 0; } .contact-top-row { display: flex; justify-content: space-between; align-items: center; }
.contact-name { font-size: .95rem; font-weight: 500; } .contact-time { font-size: .7rem; color: var(--text-muted); }
.contact-bottom-row { display: flex; justify-content: space-between; margin-top: 2px; }
.contact-last-msg { font-size: .8rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.contact-id { font-size: .75rem; color: var(--text-muted); }
.contact-actions-hover { display: none; gap: 4px; } .contact-item:hover .contact-actions-hover { display: flex; }
.icon-btn-small { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 6px; border-radius: 50%; font-size: .85rem; }
.icon-btn-small:hover { background: var(--bg-tertiary); color: var(--sn-green); }
.main-content { flex: 1; display: flex; flex-direction: column; background: var(--bg-primary); }
.welcome-screen { flex: 1; display: flex; align-items: center; justify-content: center; }
.welcome-content { text-align: center; color: var(--text-muted); } .welcome-content h2 { margin-bottom: 8px; color: var(--text-primary); }
.contact-view { display: flex; flex-direction: column; height: 100%; }
.chat-header { display: flex; align-items: center; padding: 10px 16px; gap: 12px; background: var(--wa-header-bg); border-bottom: 1px solid var(--border-color); }
.chat-contact-info { flex: 1; min-width: 0; } .chat-header-actions { display: flex; gap: 4px; } .back-btn { display: none; }
.typing-indicator { padding: 0 16px; overflow: hidden; max-height: 0; transition: max-height .3s; }
.typing-indicator.show { max-height: 40px; padding: 6px 16px; }
.typing-content { display: flex; align-items: center; gap: 8px; }
.typing-dots { display: flex; gap: 3px; } .typing-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); animation: typing 1.4s infinite; }
.typing-dots span:nth-child(2) { animation-delay: .2s; } .typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes typing { 0%,100% { opacity: .4; transform: scale(1); } 50% { opacity: 1; transform: scale(1.2); } }
.typing-text { font-size: .75rem; color: var(--sn-green); font-style: italic; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L60 30L30 60L0 30Z' fill='none' stroke='%23ffffff05' /%3E%3C/svg%3E") var(--wa-darker); }
.empty-chat { text-align: center; padding: 60px 20px; color: var(--text-muted); } .empty-chat i { font-size: 3rem; margin-bottom: 16px; opacity: .3; }
.date-separator { text-align: center; margin: 16px 0 12px; } .date-separator span { background: var(--wa-panel); padding: 4px 12px; border-radius: 8px; font-size: .72rem; color: var(--text-muted); }
.chat-message { display: flex; margin-bottom: 4px; } .chat-message.own { justify-content: flex-end; }
.msg-bubble { max-width: 65%; padding: 6px 8px; border-radius: 8px; background: var(--wa-incoming); position: relative; word-wrap: break-word; }
.chat-message.own .msg-bubble { background: var(--wa-outgoing); }
.msg-body { font-size: .9rem; line-height: 1.4; margin-bottom: 2px; }
.msg-footer { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.msg-time { font-size: .65rem; color: var(--text-muted); } .msg-ticks { font-size: .6rem; color: #53bdeb; }
.edited-badge { font-size: .6rem; color: var(--text-muted); font-style: italic; } .ephemeral-badge { font-size: .6rem; color: var(--accent-warning); }
.wa-reply-bubble { background: rgba(0,0,0,.15); border-left: 3px solid var(--sn-green); border-radius: 4px; padding: 4px 8px; margin-bottom: 4px; font-size: .8rem; }
.wa-reply-name { color: var(--sn-green); font-weight: 600; font-size: .75rem; }
.wa-reply-text { color: var(--text-muted); font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 250px; }
.voice-message { display: flex; align-items: center; gap: 8px; min-width: 200px; }
.voice-play-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--sn-green); border: none; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.voice-track { flex: 1; } .voice-waveform { display: flex; align-items: center; gap: 1.5px; height: 30px; }
.wf-bar { width: 3px; border-radius: 2px; background: var(--text-muted); transition: background .1s; min-height: 3px; } .wf-bar.active { background: var(--sn-green); }
.voice-duration { font-size: .7rem; color: var(--text-muted); flex-shrink: 0; }
.image-message { border-radius: 8px; overflow: hidden; max-width: 280px; } .chat-image { width: 100%; cursor: pointer; border-radius: 8px; display: block; }
.video-message { position: relative; cursor: pointer; border-radius: 8px; overflow: hidden; max-width: 200px; }
.video-placeholder { background: var(--bg-tertiary); padding: 30px; text-align: center; font-size: 2rem; color: var(--text-muted); }
.video-play-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: rgba(255,255,255,.8); }
.file-message { display: flex; align-items: center; gap: 12px; padding: 10px; background: rgba(0,0,0,.1); border-radius: 8px; cursor: pointer; min-width: 200px; }
.file-icon { width: 40px; height: 40px; border-radius: 8px; background: var(--sn-green); display: flex; align-items: center; justify-content: center; color: #fff; }
.file-details { flex: 1; min-width: 0; } .file-name { font-size: .85rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .file-size { font-size: .7rem; color: var(--text-muted); }
.location-message { display: flex; flex-direction: column; border-radius: 8px; cursor: pointer; overflow: hidden; max-width: 280px; background: rgba(0,0,0,.15); }
.location-message .leaflet-container { border-radius: 8px 8px 0 0; }
.location-info { padding: 8px 12px; } .location-coords { font-size: .8rem; display: block; } .location-action { font-size: .7rem; color: var(--sn-green); }
.file-preview { overflow: hidden; max-height: 0; transition: max-height .3s; background: var(--bg-secondary); border-top: 1px solid var(--border-color); }
.file-preview.show { max-height: 200px; padding: 12px 16px; }
.file-preview-content { display: flex; align-items: center; gap: 12px; }
.file-preview-img { max-width: 80px; max-height: 80px; border-radius: 8px; object-fit: cover; }
.file-preview-icon { width: 50px; height: 50px; background: var(--bg-tertiary); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: var(--text-muted); }
.file-preview-info { flex: 1; } .file-preview-name { display: block; font-size: .85rem; font-weight: 500; } .file-preview-size { font-size: .7rem; color: var(--text-muted); }
.file-send-btn { padding: 8px 16px; background: var(--sn-green); border: none; color: #fff; border-radius: 20px; cursor: pointer; font-size: .85rem; }
.file-cancel-btn { padding: 8px; background: none; border: 1px solid var(--border-color); color: var(--text-muted); border-radius: 50%; cursor: pointer; width: 36px; height: 36px; }
.reply-bar { overflow: hidden; max-height: 0; transition: max-height .2s; } .reply-bar.show { max-height: 60px; }
.reply-preview-bar { display: flex; align-items: center; padding: 8px 16px; background: var(--bg-secondary); border-top: 1px solid var(--border-color); }
.reply-preview-accent { width: 3px; height: 36px; background: var(--sn-green); border-radius: 2px; margin-right: 10px; flex-shrink: 0; }
.reply-preview-bar.editing .reply-preview-accent { background: var(--accent-warning); }
.reply-preview-body { flex: 1; min-width: 0; } .reply-preview-name { font-size: .75rem; font-weight: 600; color: var(--sn-green); display: block; }
.reply-preview-text { font-size: .8rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.reply-cancel-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 6px; }
.recording-indicator { display: none; align-items: center; gap: 10px; padding: 10px 16px; background: var(--bg-secondary); border-top: 1px solid var(--border-color); }
.recording-indicator.active { display: flex; }
.recording-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent-danger); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.chat-input-area { display: flex; align-items: center; padding: 8px 12px; gap: 6px; background: var(--bg-secondary); border-top: 1px solid var(--border-color); position: relative; }
.chat-input-area input[type="text"] { flex: 1; background: var(--wa-input-bg); border: none; padding: 10px 14px; border-radius: 20px; color: var(--text-primary); font-size: .9rem; outline: none; }
.send-btn { color: var(--sn-green) !important; } .voice-btn.recording { color: var(--accent-danger) !important; }
.emoji-picker-panel { display: none; position: absolute; bottom: 100%; left: 0; width: 300px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-lg); box-shadow: 0 4px 20px rgba(0,0,0,.4); z-index: 50; }
.emoji-picker-panel.show { display: block; }
.emoji-search-bar { padding: 8px; } .emoji-search-bar input { width: 100%; padding: 6px 10px; background: var(--wa-input-bg); border: 1px solid var(--border-color); border-radius: 20px; color: var(--text-primary); font-size: .85rem; outline: none; }
.emoji-categories-bar { display: flex; gap: 2px; padding: 0 8px; border-bottom: 1px solid var(--border-color); }
.emoji-cat-btn { background: none; border: none; padding: 6px 8px; cursor: pointer; font-size: 1.1rem; opacity: .5; border-bottom: 2px solid transparent; }
.emoji-cat-btn.active { opacity: 1; border-bottom-color: var(--sn-green); }
.emoji-grid-wrapper { max-height: 200px; overflow-y: auto; }
.emoji-grid { display: none; flex-wrap: wrap; padding: 8px; gap: 2px; } .emoji-grid.active { display: flex; }
.emoji-item { background: none; border: none; font-size: 1.4rem; padding: 4px; cursor: pointer; border-radius: 4px; } .emoji-item:hover { background: var(--bg-tertiary); }
.msg-context-menu { position: fixed; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius); box-shadow: 0 4px 16px rgba(0,0,0,.5); z-index: 1000; min-width: 180px; overflow: hidden; }
.ctx-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 16px; background: none; border: none; color: var(--text-primary); font-size: .85rem; cursor: pointer; text-align: left; }
.ctx-menu-item:hover { background: var(--bg-tertiary); } .ctx-menu-item.danger { color: var(--accent-danger); }
#call-screen { background: #000; flex-direction: column; z-index: 50; }
.call-background { flex: 1; position: relative; } #remote-video { width: 100%; height: 100%; object-fit: cover; }
#local-video { position: absolute; top: 20px; right: 20px; width: 160px; height: 120px; border-radius: 12px; object-fit: cover; border: 2px solid rgba(255,255,255,.2); z-index: 2; transform: scaleX(-1); }
.call-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(to bottom, rgba(0,0,0,.6), transparent 40%, transparent 60%, rgba(0,0,0,.8)); pointer-events: none; z-index: 3; }
.call-info { text-align: center; padding-top: 60px; pointer-events: auto; }
.call-name { display: block; font-size: 1.6rem; font-weight: 600; color: #fff; } .call-status { display: block; font-size: .9rem; color: rgba(255,255,255,.7); margin-top: 4px; }
.call-duration { display: block; font-size: 1rem; color: rgba(255,255,255,.9); margin-top: 6px; font-variant-numeric: tabular-nums; }
.call-controls { display: flex; justify-content: center; gap: 16px; padding: 30px 20px 40px; pointer-events: auto; flex-wrap: wrap; }
.call-btn { width: 56px; height: 56px; border-radius: 50%; border: none; font-size: 1.2rem; cursor: pointer; background: rgba(255,255,255,.15); color: #fff; transition: .2s; backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; }
.call-btn:hover { background: rgba(255,255,255,.25); } .call-btn.active { background: rgba(255,255,255,.9); color: #333; }
.call-btn.hangup { background: var(--accent-danger); } .call-btn.hangup:hover { filter: brightness(1.1); }
#call-screen.audio-call .call-background { background: linear-gradient(135deg, var(--wa-darker), #1a2a20); }
#call-screen.audio-call #remote-video, #call-screen.audio-call #local-video { display: none; }
#call-screen.audio-call .call-overlay { background: transparent; }
#call-screen.screen-sharing #local-video { width: 50%; height: 50%; top: auto; bottom: 20px; right: auto; left: 50%; transform: translateX(-50%); border-radius: 12px; }
.in-call-chat-panel { position: absolute; right: 0; top: 0; bottom: 0; width: 320px; background: var(--bg-secondary); z-index: 10; transform: translateX(100%); transition: transform .3s; display: flex; flex-direction: column; }
.in-call-chat-panel.show { transform: translateX(0); }
.in-call-chat-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border-color); }
.in-call-chat-messages { flex: 1; overflow-y: auto; padding: 12px; }
.in-call-chat-form { display: flex; align-items: center; gap: 6px; padding: 8px; border-top: 1px solid var(--border-color); position: relative; }
.in-call-chat-form input { flex: 1; background: var(--wa-input-bg); border: none; padding: 8px 12px; border-radius: 20px; color: var(--text-primary); font-size: .85rem; outline: none; }
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 200; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.modal.show { display: flex; }
.modal-content { background: var(--bg-secondary); border-radius: var(--radius-lg); width: 90%; max-width: 420px; max-height: 85vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border-color); }
.modal-header h3 { font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.close-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; padding: 4px; }
.modal-body { padding: 20px; }
.incoming-call-modal { text-align: center; padding: 40px 24px; }
.incoming-caller-avatar { width: 80px; height: 80px; border-radius: 50%; background: var(--sn-green); margin: 0 auto 16px; display: flex; align-items: center; justify-content: center; font-size: 2rem; color: #fff; }
.pulse-ring { animation: pulse-ring 1.5s infinite; }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(0,133,63,.5); } 100% { box-shadow: 0 0 0 20px rgba(0,133,63,0); } }
.incoming-caller-name { display: block; font-size: 1.3rem; font-weight: 600; margin-bottom: 4px; }
.incoming-call-type { display: block; color: var(--text-muted); font-size: .9rem; margin-bottom: 24px; }
.incoming-call-actions { display: flex; justify-content: center; gap: 40px; }
.call-action-btn { display: flex; flex-direction: column; align-items: center; gap: 8px; border: none; cursor: pointer; background: none; }
.call-action-btn i { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; color: #fff; }
.call-action-btn.decline i { background: var(--accent-danger); } .call-action-btn.accept i { background: var(--sn-green); }
.call-action-btn span { font-size: .8rem; color: var(--text-muted); }
.profile-body { text-align: center; } .profile-avatar-section { margin-bottom: 20px; }
.profile-avatar-preview { width: 100px; height: 100px; border-radius: 50%; background: var(--bg-tertiary); margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: var(--text-muted); overflow: hidden; }
.profile-avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.profile-user-id { padding: 8px; background: var(--bg-tertiary); border-radius: var(--radius); font-size: .85rem; color: var(--text-muted); word-break: break-all; }
.settings-tabs { display: flex; border-bottom: 1px solid var(--border-color); }
.settings-tab { flex: 1; padding: 12px; background: none; border: none; border-bottom: 2px solid transparent; color: var(--text-muted); cursor: pointer; font-size: .85rem; }
.settings-tab.active { color: var(--sn-green); border-bottom-color: var(--sn-green); }
.settings-panel { display: none; padding: 20px; } .settings-panel.active { display: block; }
.e2ee-status-card { display: flex; align-items: center; gap: 14px; padding: 16px; border: 2px solid var(--border-color); border-radius: var(--radius); margin-bottom: 16px; }
.e2ee-status-icon { font-size: 2rem; }
.e2ee-status-text { display: flex; flex-direction: column; gap: 2px; } .e2ee-status-text strong { font-size: .95rem; } .e2ee-status-text span { font-size: .8rem; color: var(--text-muted); }
.device-fingerprint { display: block; padding: 8px 12px; background: var(--bg-tertiary); border-radius: 4px; font-size: .75rem; word-break: break-all; color: var(--text-muted); margin-top: 4px; user-select: all; }
.e2ee-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.e2ee-result { margin-top: 12px; padding: 10px; border-radius: var(--radius); background: var(--bg-tertiary); font-size: .85rem; text-align: center; }
.status-section { padding: 8px 0; } .status-section-title { padding: 8px 16px; font-size: .75rem; color: var(--text-muted); text-transform: uppercase; }
.status-my-status { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; } .status-my-status:hover { background: var(--bg-tertiary); }
.status-avatar { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.status-avatar-add { background: var(--sn-green); color: #fff; font-size: 1.2rem; }
.status-avatar-ring { border: 2px solid var(--sn-green); padding: 2px; overflow: hidden; }
.status-avatar-ring img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.status-info { flex: 1; } .status-name { display: block; font-size: .95rem; font-weight: 500; } .status-time { display: block; font-size: .75rem; color: var(--text-muted); }
.status-contact-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; cursor: pointer; } .status-contact-item:hover { background: var(--bg-tertiary); }
.status-empty { text-align: center; padding: 40px; color: var(--text-muted); }
.status-color-options { display: flex; gap: 8px; margin-bottom: 16px; justify-content: center; }
.status-color-btn { width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; } .status-color-btn.active { border-color: #fff; box-shadow: 0 0 0 2px var(--sn-green); }
#status-text-input { width: 100%; min-height: 100px; resize: vertical; }
.status-actions { display: flex; gap: 10px; margin-top: 12px; justify-content: flex-end; }
.location-options { display: flex; flex-direction: column; gap: 8px; }
.location-option-btn { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px; background: var(--bg-tertiary); border: 1px solid var(--border-color); border-radius: var(--radius); cursor: pointer; color: var(--text-primary); text-align: left; transition: .15s; }
.location-option-btn:hover { background: var(--wa-hover); border-color: var(--sn-green); }
.location-option-btn i { font-size: 1.3rem; color: var(--sn-green); width: 24px; text-align: center; }
.location-option-btn span { font-size: .9rem; font-weight: 500; display: block; } .location-option-btn small { font-size: .7rem; color: var(--text-muted); display: block; margin-top: 2px; }
.forward-contacts-list { max-height: 300px; overflow-y: auto; }
.forward-contact-item { display: flex; align-items: center; gap: 12px; padding: 10px; cursor: pointer; border-radius: var(--radius); } .forward-contact-item:hover { background: var(--bg-tertiary); }
.image-viewer-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.95); z-index: 300; flex-direction: column; } .image-viewer-modal.show { display: flex; }
.image-viewer-header { display: flex; justify-content: flex-end; padding: 16px; } .image-viewer-header .icon-btn { color: #fff; font-size: 1.5rem; }
#image-viewer-img { flex: 1; object-fit: contain; padding: 20px; max-height: calc(100vh - 60px); }
.call-history-item { display: flex; align-items: center; padding: 12px 16px; gap: 12px; cursor: pointer; } .call-history-item:hover { background: var(--bg-tertiary); }
.call-history-details { flex: 1; } .call-history-name { display: block; font-size: .9rem; font-weight: 500; } .call-history-name.missed { color: var(--accent-danger); }
.call-history-meta { display: flex; align-items: center; gap: 6px; font-size: .75rem; color: var(--text-muted); margin-top: 2px; }
.call-missed { color: var(--accent-danger); } .call-success { color: var(--sn-green); } .call-no-answer { color: var(--accent-warning); }
.call-history-action { background: none; border: none; color: var(--sn-green); cursor: pointer; padding: 8px; font-size: 1rem; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); } .empty-state i { font-size: 2.5rem; margin-bottom: 12px; opacity: .3; }
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 20px; border-radius: var(--radius); color: #fff; font-size: .85rem; animation: toastIn .3s ease; box-shadow: 0 4px 12px rgba(0,0,0,.3); }
.toast.success { background: var(--sn-green); } .toast.error { background: var(--accent-danger); }
.toast.info { background: #2196F3; } .toast.warning { background: #FF9800; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } }
.connection-indicator { position: fixed; bottom: 10px; left: 10px; width: 10px; height: 10px; border-radius: 50%; z-index: 100; }
.connection-indicator.connected { background: var(--sn-green); } .connection-indicator.connecting { background: var(--accent-warning); animation: blink 1s infinite; }
.connection-indicator.disconnected, .connection-indicator.failed { background: var(--accent-danger); }
.connection-indicator.idle { background: var(--text-muted); opacity: .3; }
::-webkit-scrollbar { width: 6px; } ::-webkit-scrollbar-track { background: transparent; } ::-webkit-scrollbar-thumb { background: var(--wa-hover); border-radius: 3px; }
@media (max-width: 768px) {
    .sidebar { width: 100%; position: absolute; z-index: 10; }
    .main-content { position: absolute; inset: 0; z-index: 11; transform: translateX(100%); transition: transform .3s; }
    .main-content:has(.contact-view:not(.hidden)) { transform: translateX(0); }
    .back-btn { display: flex !important; }
    #local-video { width: 100px; height: 75px; top: 10px; right: 10px; }
    .in-call-chat-panel { width: 100%; }
    .call-controls { gap: 12px; padding: 20px 10px 30px; } .call-btn { width: 48px; height: 48px; font-size: 1rem; }
    .login-container { padding: 30px 16px 20px; }
    .login-phone-icon { width: 60px; height: 60px; } .login-phone-icon i { font-size: 1.5rem; }
    .login-header h1 { font-size: 1.5rem; } .login-form-card { padding: 22px 18px; }
}
