/* =========================================================
   assets/css/whatsapp-theme.css
   Authentic WhatsApp Mobile Dark Mode + Ultra-Secure Interface
   ========================================================= */

:root {
    --wa-bg-deep: #0c1317;
    --wa-bg-panel: #111b21;
    --wa-bg-sidebar: #111b21;
    --wa-bg-chat: #0b141a;
    --wa-bubble-out: #005c4b;
    --wa-bubble-in: #202c33;
    --wa-green: #00a884;
    --wa-green-hover: #00c99e;
    --wa-green-dark: #008069;
    --wa-text-primary: #e9edef;
    --wa-text-secondary: #8696a0;
    --wa-text-muted: #667781;
    --wa-border: #222d34;
    --wa-input-bg: #2a3942;
    --wa-danger: #ea4335;
    --wa-danger-glow: rgba(234, 67, 53, 0.3);
    --wa-shield: #25d366;
    --font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
}

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

html {
    width: 100%;
    height: 100%;
    height: -webkit-fill-available;
    height: 100dvh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: var(--wa-bg-panel);
}

body {
    background-color: var(--wa-bg-deep);
    color: var(--wa-text-primary);
    font-family: var(--font-family);
    width: 100%;
    height: 100%;
    height: -webkit-fill-available;
    height: 100dvh;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

/* -------------------------------------------------------------
   DEVICE CONTAINER (Auto-Fills Every Mobile Screen & Adjusts Dynamically)
   ------------------------------------------------------------- */
.app-container {
    width: 100%;
    height: 100%;
    height: -webkit-fill-available;
    height: 100dvh;
    background-color: var(--wa-bg-panel);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* DESKTOP / LARGE DISPLAYS: Elegant Frame */
@media (min-width: 769px) {
    body {
        background-color: #080d10;
        padding: 16px;
    }

    .app-container {
        max-width: 440px;
        height: min(920px, calc(100dvh - 32px));
        max-height: 920px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
        border-radius: 28px;
    }

    .phone-status-bar {
        display: flex;
    }
}

/* ALL MOBILE & TABLET DEVICES: 100% Screen Auto-Fill Width & Height */
@media (max-width: 768px) {
    body {
        padding: 0;
        margin: 0;
        display: block;
        background-color: var(--wa-bg-panel);
    }

    .app-container {
        width: 100vw;
        max-width: 100vw;
        height: 100%;
        height: -webkit-fill-available;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0 !important;
        box-shadow: none !important;
        border: none !important;
    }

    /* Hide fake status bar on real mobile screens so full display is utilized */
    .phone-status-bar {
        display: none !important;
    }

    /* Prevent mobile browser auto-zoom */
    .auth-input,
    .search-box input,
    .input-field-wrap input {
        font-size: 16px !important;
    }
}

/* Top Phone Notch / Status Bar */
.phone-status-bar {
    height: 28px;
    background-color: var(--wa-bg-panel);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    font-size: 11px;
    font-weight: 600;
    color: var(--wa-text-secondary);
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
}

.phone-status-bar .status-icons {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* -------------------------------------------------------------
   MAIN SCREENS SYSTEM (Auth, Chat List, Conversation)
   ------------------------------------------------------------- */
.screen {
    flex: 1 1 0%;
    display: none;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

.screen.active {
    display: flex;
}

/* -------------------------------------------------------------
   AUTH SCREEN (Login & Signup)
   ------------------------------------------------------------- */
.auth-screen {
    justify-content: center;
    align-items: center;
    padding: 20px 16px;
    background: radial-gradient(circle at top, #182229 0%, #0c1317 100%);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.auth-card {
    width: 100%;
    max-width: 360px;
    text-align: center;
    margin: auto;
    padding: 12px 0;
}

.auth-logo-badge {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--wa-green-dark), var(--wa-green));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    box-shadow: 0 8px 24px rgba(0, 168, 132, 0.3);
}

.auth-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--wa-text-primary);
    margin-bottom: 6px;
}

.auth-subtitle {
    font-size: 13px;
    color: var(--wa-text-secondary);
    margin-bottom: 24px;
    line-height: 1.4;
}

.auth-pill-nav {
    display: flex;
    background: #182229;
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.auth-pill-btn {
    flex: 1;
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--wa-text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-pill-btn.active {
    background: var(--wa-green-dark);
    color: #fff;
}

.auth-input-group {
    margin-bottom: 14px;
    text-align: left;
}

.auth-input-group label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--wa-text-secondary);
    margin-bottom: 6px;
}

.auth-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--wa-border);
    background-color: var(--wa-input-bg);
    color: var(--wa-text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.auth-input:focus {
    border-color: var(--wa-green);
}

.auth-submit-btn {
    width: 100%;
    padding: 13px;
    background: var(--wa-green);
    color: #0c1317;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-submit-btn:hover {
    background: var(--wa-green-hover);
}

.auth-submit-btn:active {
    transform: scale(0.98);
}

.security-shield-note {
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11px;
    color: var(--wa-text-muted);
}

/* PWA Installation Buttons */
.pwa-install-banner-btn {
    width: 100%;
    margin-top: 14px;
    padding: 10px 14px;
    background: rgba(0, 168, 132, 0.15);
    border: 1px solid rgba(0, 168, 132, 0.4);
    color: var(--wa-green);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.pwa-install-banner-btn:hover {
    background: var(--wa-green);
    color: #0c1317;
}

.pwa-install-header-btn {
    background: rgba(0, 168, 132, 0.15);
    border: 1px solid rgba(0, 168, 132, 0.35);
    color: var(--wa-green);
    padding: 4px 9px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
}

.pwa-install-header-btn:hover {
    background: var(--wa-green);
    color: #0c1317;
}

/* -------------------------------------------------------------
   WHATSAPP HEADER & APP BAR
   ------------------------------------------------------------- */
.wa-app-bar {
    min-height: 60px;
    height: auto;
    background-color: var(--wa-bg-panel);
    padding: max(8px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--wa-border);
    flex-shrink: 0;
}

.wa-app-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--wa-text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.wa-app-title span.title-green {
    color: var(--wa-green);
}

.wa-app-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wa-icon-btn {
    background: none;
    border: none;
    color: var(--wa-text-secondary);
    font-size: 18px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

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

/* -------------------------------------------------------------
   CONTACTS / CHATS LIST SCREEN
   ------------------------------------------------------------- */
.search-bar-wrap {
    padding: 8px 14px;
    background-color: var(--wa-bg-panel);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--wa-input-bg);
    border-radius: 8px;
    padding: 6px 12px;
    gap: 10px;
}

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

.search-box input::placeholder {
    color: var(--wa-text-muted);
}

.chat-list-scroll {
    flex: 1 1 0%;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.15s;
}

.chat-item:hover {
    background-color: rgba(255, 255, 255, 0.04);
}

.avatar-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2b3942, #182229);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: #e9edef;
    position: relative;
    flex-shrink: 0;
    margin-right: 14px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.online-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 11px;
    height: 11px;
    background-color: var(--wa-green);
    border-radius: 50%;
    border: 2px solid var(--wa-bg-panel);
}

.chat-info {
    flex: 1;
    min-width: 0;
}

.chat-info-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.chat-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--wa-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-time {
    font-size: 11px;
    color: var(--wa-text-secondary);
}

.chat-info-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-preview {
    font-size: 13px;
    color: var(--wa-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
}

.unread-badge {
    background: var(--wa-green);
    color: #0c1317;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 12px;
}

/* Floating Action Button for Add User */
.fab-add-user {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--wa-green);
    color: #0c1317;
    border: none;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 168, 132, 0.4);
    transition: transform 0.2s;
    z-index: 10;
}

.fab-add-user:hover {
    transform: scale(1.06);
}

/* -------------------------------------------------------------
   CONVERSATION / CHAT ROOM SCREEN
   ------------------------------------------------------------- */
.chat-room-header {
    min-height: 60px;
    height: auto;
    background-color: var(--wa-bg-panel);
    padding: max(8px, env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 0px)) 8px max(10px, env(safe-area-inset-left, 0px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--wa-border);
    flex-shrink: 0;
    z-index: 10;
}

.header-user-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex: 1;
    min-width: 0;
}

.header-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #005c4b, #008069);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.header-user-meta {
    overflow: hidden;
}

.header-user-meta h4 {
    font-size: 15px;
    color: var(--wa-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-user-meta p {
    font-size: 11px;
    color: var(--wa-text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.security-badge-btn {
    background: rgba(0, 168, 132, 0.15);
    border: 1px solid rgba(0, 168, 132, 0.3);
    color: var(--wa-green);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* -------------------------------------------------------------
   TOR ONION CIRCUIT BAR (Authentic Tor Relay Routing)
   ------------------------------------------------------------- */
.tor-circuit-bar {
    background: #111b21;
    border-bottom: 1px solid rgba(0, 168, 132, 0.25);
    padding: 6px 12px 7px 12px;
    flex-shrink: 0;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
    -webkit-user-select: none;
}

.tor-circuit-bar:hover {
    background: #152229;
}

.circuit-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.circuit-title-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--wa-text-primary);
}

.circuit-onion-icon {
    font-size: 14px;
}

.circuit-title-text {
    color: #e9edef;
    letter-spacing: 0.2px;
}

.circuit-live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 168, 132, 0.15);
    color: var(--wa-green);
    border: 1px solid rgba(0, 168, 132, 0.3);
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background-color: var(--wa-green);
    border-radius: 50%;
    display: inline-block;
    animation: greenPulse 1.5s infinite;
}

@keyframes greenPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

.circuit-rotate-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--wa-text-secondary);
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.circuit-rotate-btn:hover {
    background: rgba(0, 168, 132, 0.2);
    color: var(--wa-green);
    border-color: var(--wa-green);
}

.circuit-hops-scroller {
    display: flex;
    align-items: center;
    gap: 5px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 2px;
}

.circuit-hops-scroller::-webkit-scrollbar {
    display: none;
}

.circuit-hop-item {
    display: flex;
    flex-direction: column;
    background: #182229;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 3px 7px;
    font-size: 10px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: transform 0.2s, border-color 0.2s;
}

.circuit-hop-item:hover {
    border-color: var(--wa-green);
}

.circuit-hop-item .hop-role {
    font-size: 8px;
    text-transform: uppercase;
    color: var(--wa-text-muted);
    font-weight: 700;
    letter-spacing: 0.4px;
    line-height: 1.1;
}

.circuit-hop-item .hop-val {
    font-size: 10px;
    font-weight: 600;
    color: var(--wa-text-primary);
    line-height: 1.2;
}

.circuit-hop-item.hop-origin {
    border-color: rgba(37, 211, 102, 0.4);
    background: rgba(37, 211, 102, 0.08);
}
.circuit-hop-item.hop-origin .hop-val {
    color: var(--wa-green);
}

.circuit-hop-item.hop-guard {
    border-left: 2px solid #34b7f1;
}

.circuit-hop-item.hop-middle {
    border-left: 2px solid #a855f7;
}

.circuit-hop-item.hop-exit {
    border-left: 2px solid #eab308;
}

.circuit-hop-item.hop-dest {
    border-color: rgba(0, 168, 132, 0.4);
    background: rgba(0, 168, 132, 0.08);
}

.circuit-arrow {
    color: var(--wa-text-muted);
    font-size: 10px;
    flex-shrink: 0;
    opacity: 0.6;
}

.circuit-hop-item.pulsing {
    animation: hopPulse 0.45s ease-out;
}

@keyframes hopPulse {
    0% { transform: scale(1); border-color: var(--wa-green); box-shadow: 0 0 6px var(--wa-green); }
    50% { transform: scale(1.08); border-color: #25d366; box-shadow: 0 0 12px #25d366; }
    100% { transform: scale(1); }
}

/* Tor Circuit Modal Diagram (Tor Browser Style) */
.tor-circuit-diagram {
    background: #111b21;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.tor-diagram-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
}

.tor-step-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1f2c34;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tor-step-info {
    flex: 1;
}

.tor-step-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--wa-text-primary);
    margin-bottom: 2px;
}

.tor-step-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    margin-bottom: 3px;
}

.tor-step-badge.green {
    background: rgba(37, 211, 102, 0.15);
    color: #25d366;
    border: 1px solid rgba(37, 211, 102, 0.3);
}

.tor-step-badge.blue {
    background: rgba(52, 183, 241, 0.15);
    color: #34b7f1;
    border: 1px solid rgba(52, 183, 241, 0.3);
}

.tor-step-badge.purple {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.tor-step-badge.orange {
    background: rgba(234, 179, 8, 0.15);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.tor-step-sub {
    font-size: 11px;
    color: var(--wa-text-secondary);
    line-height: 1.35;
}

.tor-diagram-line {
    width: 2px;
    height: 18px;
    background: rgba(255, 255, 255, 0.15);
    margin: 2px 0 2px 15px;
}

.circuit-refresh-modal-btn {
    width: 100%;
    padding: 10px;
    background: rgba(0, 168, 132, 0.18);
    border: 1px solid var(--wa-green);
    color: var(--wa-green);
    font-size: 13px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 12px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.circuit-refresh-modal-btn:hover {
    background: var(--wa-green);
    color: #0c1317;
}

/* Chat Messages Area with WhatsApp Doodle pattern vibe */
.chat-messages-area {
    flex: 1 1 0%;
    min-height: 0;
    background-color: var(--wa-bg-chat);
    background-image: radial-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 20px 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ephemeral-notice-banner {
    background: rgba(32, 44, 51, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #ffd279;
    font-size: 11px;
    text-align: center;
    padding: 8px 12px;
    border-radius: 8px;
    margin: 4px auto 12px;
    max-width: 90%;
    line-height: 1.4;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Message Bubble */
.msg-bubble-wrap {
    display: flex;
    flex-direction: column;
    max-width: 82%;
    animation: msgAppear 0.2s ease-out;
}

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

.msg-bubble-wrap.outgoing {
    align-self: flex-end;
}

.msg-bubble-wrap.incoming {
    align-self: flex-start;
}

.msg-bubble {
    padding: 8px 12px 6px 12px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.4;
    color: var(--wa-text-primary);
    position: relative;
    word-break: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.msg-bubble-wrap.outgoing .msg-bubble {
    background-color: var(--wa-bubble-out);
    border-top-right-radius: 2px;
}

.msg-bubble-wrap.incoming .msg-bubble {
    background-color: var(--wa-bubble-in);
    border-top-left-radius: 2px;
}

.msg-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
}

.msg-ticks {
    color: #53bdeb;
    font-size: 12px;
}

/* Voice Message Bubble Styling */
.voice-bubble {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 210px;
    padding: 4px 0;
}

.voice-play-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s;
}

.voice-play-btn:hover {
    transform: scale(1.08);
}

.voice-waveform-bars {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 2.5px;
    height: 24px;
}

.waveform-bar {
    flex: 1;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
    height: 8px;
    transition: height 0.15s, background 0.15s;
}

.voice-bubble.playing .waveform-bar {
    background: var(--wa-green);
    animation: barJump 0.8s infinite alternate ease-in-out;
}

.waveform-bar:nth-child(2) { animation-delay: 0.1s; }
.waveform-bar:nth-child(3) { animation-delay: 0.25s; }
.waveform-bar:nth-child(4) { animation-delay: 0.4s; }
.waveform-bar:nth-child(5) { animation-delay: 0.2s; }

@keyframes barJump {
    0% { height: 6px; }
    100% { height: 22px; }
}

.voice-duration {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    font-variant-numeric: tabular-nums;
}

/* Disappearing message burn animation */
.msg-bubble-wrap.burning {
    animation: burnDisintegrate 0.8s forwards;
}

@keyframes burnDisintegrate {
    0% { transform: scale(1); filter: drop-shadow(0 0 4px #ea4335); opacity: 1; }
    50% { transform: scale(0.95) translateY(-4px); filter: drop-shadow(0 0 12px #ea4335); opacity: 0.7; }
    100% { transform: scale(0.6) translateY(-16px); filter: blur(8px); opacity: 0; }
}

/* -------------------------------------------------------------
   CHAT BOTTOM INPUT BAR
   ------------------------------------------------------------- */
.chat-bottom-bar {
    min-height: 62px;
    height: auto;
    background-color: var(--wa-bg-panel);
    padding: 8px max(10px, env(safe-area-inset-right, 0px)) max(8px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    border-top: 1px solid var(--wa-border);
    flex-shrink: 0;
}

.input-field-wrap {
    flex: 1;
    background-color: var(--wa-input-bg);
    border-radius: 24px;
    display: flex;
    align-items: center;
    padding: 6px 14px;
    gap: 8px;
}

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

.input-field-wrap input::placeholder {
    color: var(--wa-text-muted);
}

.action-circle-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--wa-green);
    border: none;
    color: #0c1317;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.1s;
}

.action-circle-btn:hover {
    background: var(--wa-green-hover);
}

.action-circle-btn:active {
    transform: scale(0.94);
}

.action-circle-btn.mic-btn.recording {
    background: var(--wa-danger);
    color: #fff;
    box-shadow: 0 0 16px var(--wa-danger-glow);
    animation: micPulse 1.2s infinite;
}

@keyframes micPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Recording Overlay Tray */
.recording-tray {
    position: absolute;
    inset: 0;
    background-color: var(--wa-bg-panel);
    display: none;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    z-index: 20;
}

.recording-tray.active {
    display: flex;
}

.rec-pulsing-dot {
    width: 12px;
    height: 12px;
    background-color: var(--wa-danger);
    border-radius: 50%;
    animation: blinkDot 0.8s infinite alternate;
}

@keyframes blinkDot {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

.rec-timer {
    font-size: 15px;
    font-weight: 600;
    color: var(--wa-text-primary);
    font-variant-numeric: tabular-nums;
}

.rec-slider-hint {
    flex: 1;
    font-size: 12px;
    color: var(--wa-text-secondary);
    text-align: center;
    animation: slideHint 1.5s infinite;
}

@keyframes slideHint {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-8px); }
}

.cancel-rec-btn {
    background: none;
    border: none;
    color: var(--wa-danger);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 10px;
}

/* -------------------------------------------------------------
   MODALS (Add Contact & 10-Layer Security Inspector)
   ------------------------------------------------------------- */
.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 200;
}

.modal-overlay.active {
    display: flex;
}

.modal-sheet {
    width: 100%;
    max-width: 380px;
    max-height: 85vh;
    max-height: 85dvh;
    display: flex;
    flex-direction: column;
    background: var(--wa-bg-panel);
    border: 1px solid var(--wa-border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.9);
}

.modal-header {
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--wa-border);
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-body {
    padding: 16px 18px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

/* 10-Layer Inspection Step Card */
.crypto-layer-step {
    background: #182229;
    border-left: 3px solid var(--wa-green);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 8px;
    font-size: 12px;
}

.crypto-layer-step .step-top {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    color: var(--wa-text-primary);
    margin-bottom: 2px;
}

.crypto-layer-step .step-desc {
    font-size: 11px;
    color: var(--wa-text-secondary);
}

/* Search results in Add Contact modal */
.search-res-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.add-contact-btn {
    background: var(--wa-green);
    color: #0c1317;
    border: none;
    padding: 6px 12px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.add-contact-btn.added {
    background: #202c33;
    color: var(--wa-text-muted);
    cursor: default;
}

/* -------------------------------------------------------------
   ANTI-SCREENSHOT & SCREEN-RECORDING BLACKOUT SHIELD
   ------------------------------------------------------------- */
.privacy-blackout-shield {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background-color: #000000 !important;
    z-index: 2147483647 !important; /* Maximum 32-bit signed integer z-index */
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #ffffff;
    text-align: center;
    padding: 24px;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.privacy-blackout-shield.active {
    display: flex !important;
}

.shield-lock-icon {
    font-size: 54px;
    margin-bottom: 16px;
    filter: drop-shadow(0 0 16px rgba(0, 168, 132, 0.4));
}

.shield-title {
    font-size: 20px;
    font-weight: 700;
    color: #ea4335;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.shield-desc {
    font-size: 13px;
    color: #8696a0;
    max-width: 320px;
    line-height: 1.5;
}

.shield-tap-hint {
    margin-top: 24px;
    font-size: 12px;
    color: var(--wa-green);
    background: rgba(0, 168, 132, 0.12);
    border: 1px solid rgba(0, 168, 132, 0.3);
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    letter-spacing: 0.5px;
}

/* Mobile & Touch Anti-Selection / Anti-Callout */
body, .app-container {
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
}

input, textarea {
    -webkit-user-select: text !important;
    user-select: text !important;
}

/* Anti-Print & PDF Export Block */
@media print {
    html, body, .app-container {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        background: #000000 !important;
    }
    .privacy-blackout-shield {
        display: flex !important;
        background: #000000 !important;
    }
}

/* -------------------------------------------------------------
   IN-APP NOTIFICATION TOAST & PENDING SMS BANNER
   ------------------------------------------------------------- */
.incoming-notification-toast {
    position: absolute;
    top: 36px;
    left: 12px;
    right: 12px;
    background: #1f2c34;
    border: 1px solid var(--wa-green);
    border-radius: 12px;
    padding: 10px 14px;
    display: none;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 15px rgba(0, 168, 132, 0.3);
    z-index: 500;
    cursor: pointer;
    animation: toastSlideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.incoming-notification-toast.active {
    display: flex !important;
}

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

.toast-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--wa-green-dark), var(--wa-green));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-header-line {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.toast-title {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toast-bell-ring {
    animation: bellShake 1s infinite;
    display: inline-block;
    font-size: 12px;
}

@keyframes bellShake {
    0%, 100% { transform: rotate(0); }
    20%, 60% { transform: rotate(15deg); }
    40%, 80% { transform: rotate(-15deg); }
}

.toast-body {
    font-size: 12px;
    color: var(--wa-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toast-badge {
    background: var(--wa-green);
    color: #0c1317;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

.toast-close-btn {
    background: none;
    border: none;
    color: var(--wa-text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.toast-close-btn:hover {
    color: #fff;
}

/* Chat List Pending SMS Banner */
.pending-sms-banner {
    background: linear-gradient(90deg, rgba(0, 168, 132, 0.18), rgba(0, 92, 75, 0.12));
    border-bottom: 1px solid rgba(0, 168, 132, 0.3);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #e9edef;
    animation: fadeIn 0.3s ease;
}

.pending-banner-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pending-bell-pulse {
    font-size: 14px;
    animation: bellShake 1.2s infinite;
}

.pending-pill-badge {
    background: var(--wa-green);
    color: #0c1317;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 10px;
}


