/* ==========================================================================
   ChatWed - Instagram Direct Messages (DM) Theme + WhatsApp Hybrid Tools
   Pure AMOLED Black Design System
   ========================================================================== */

:root {
    --ig-bg: #000000;
    --ig-card: #121212;
    --ig-surface: #1a1a1a;
    --ig-input: #1e1e1e;
    --ig-border: #262626;
    --ig-border-subtle: #333333;
    --ig-bubble-in: #262626;
    --ig-bubble-out: linear-gradient(135deg, #7928ca 0%, #4f46e5 50%, #0ea5e9 100%);
    --ig-text: #ffffff;
    --ig-text-secondary: #8e8e8e;
    --ig-blue: #0095f6;
    --ig-blue-hover: #1877f2;
    --ig-heart: #ff3040;
    --ig-gradient: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    --wa-seen-blue: #53bdeb;
    --wa-check-grey: #8696a0;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html, body {
    width: 100%;
    height: 100%;
    height: 100dvh;
    font-family: var(--font-family);
    background-color: var(--ig-bg);
    color: var(--ig-text);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ==========================================================================
   Main Application Wrapper & Screen Containers
   ========================================================================== */

.app-wrapper {
    width: 100%;
    height: 100%;
    background-color: var(--ig-bg);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Desktop Responsive Expansion: Modern Centered DM Portal */
@media (min-width: 768px) {
    .app-wrapper {
        max-width: 940px;
        width: 95vw;
        height: 94vh;
        max-height: 960px;
        border-radius: 22px;
        border: 1px solid var(--ig-border);
        box-shadow: 0 25px 65px rgba(0, 0, 0, 0.85);
        background: var(--ig-bg);
    }
}

.screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 0;
    left: 0;
    background-color: var(--ig-bg);
    z-index: 10;
    transition: opacity 0.2s ease;
}

.screen.hidden, .hidden {
    display: none !important;
}

/* ==========================================================================
   1. Authentic Instagram DM Login Screen
   ========================================================================== */

.login-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px;
    background: radial-gradient(circle at 50% 20%, rgba(121, 40, 202, 0.08) 0%, transparent 60%), #000000;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--ig-card);
    border: 1px solid var(--ig-border);
    border-radius: 24px;
    padding: 36px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px;
}

.brand-icon {
    font-size: 52px;
    margin-bottom: 8px;
    display: inline-block;
}

.brand-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: var(--ig-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}

.brand-subtext {
    font-size: 13.5px;
    color: var(--ig-text-secondary);
    margin-bottom: 12px;
}

.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 600;
    padding: 5px 12px;
    background: rgba(0, 149, 246, 0.1);
    border: 1px solid rgba(0, 149, 246, 0.25);
    color: var(--ig-blue);
    border-radius: 20px;
}

.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    text-align: left;
    gap: 6px;
}

.form-label {
    font-size: 12.5px;
    font-weight: 600;
    color: #b0b0b0;
    margin-left: 2px;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.field-icon {
    position: absolute;
    left: 14px;
    font-size: 16px;
    pointer-events: none;
    color: var(--ig-text-secondary);
}

.form-control {
    width: 100%;
    height: 48px;
    padding: 0 44px 0 42px;
    background: var(--ig-input);
    border: 1px solid var(--ig-border-subtle);
    border-radius: 12px;
    color: #ffffff;
    font-size: 14.5px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.form-control:focus {
    border-color: var(--ig-blue);
    box-shadow: 0 0 0 3px rgba(0, 149, 246, 0.25);
    background: #242424;
}

.form-control::placeholder {
    color: #666666;
}

.toggle-pass-btn {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: var(--ig-text-secondary);
    padding: 4px;
}

.quick-login-pills {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
    margin-bottom: 4px;
}

.quick-label {
    font-size: 12px;
    color: var(--ig-text-secondary);
}

.quick-pill {
    background: #242424;
    border: 1px solid #383838;
    color: #f0f0f0;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.quick-pill:hover {
    background: var(--ig-blue);
    border-color: var(--ig-blue);
    color: #ffffff;
    transform: translateY(-1px);
}

.primary-btn.login-btn {
    width: 100%;
    height: 48px;
    background: var(--ig-blue);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 149, 246, 0.3);
}

.primary-btn.login-btn:hover {
    background: var(--ig-blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 149, 246, 0.45);
}

.primary-btn.login-btn:active {
    transform: scale(0.99);
}

.login-footer-actions {
    margin-top: 14px;
    text-align: center;
}

.link-btn-change-pass {
    background: transparent;
    border: 1px solid rgba(0, 149, 246, 0.25);
    color: var(--ig-blue);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.link-btn-change-pass:hover {
    color: #38bdf8;
    background: rgba(0, 149, 246, 0.12);
    border-color: rgba(0, 149, 246, 0.5);
    transform: translateY(-1px);
}

.login-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    text-align: center;
}

/* ==========================================================================
   2. Instagram Direct Chat Header
   ========================================================================== */

.chat-header {
    padding: 12px 18px;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--ig-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 20;
    height: 66px;
    flex-shrink: 0;
}

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

.back-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 26px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.partner-avatar-wrapper {
    position: relative;
    cursor: pointer;
}

.partner-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--ig-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: #fff;
    padding: 2.5px;
    box-shadow: 0 0 12px rgba(220, 39, 67, 0.35);
}

.partner-avatar span {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #181818;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: absolute;
    bottom: 0;
    right: 0;
    border: 2px solid var(--ig-bg);
}

.status-dot.online {
    background-color: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.status-dot.offline {
    background-color: #555555;
}

.partner-details h3 {
    font-size: 15.5px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 5px;
}

.partner-presence-text {
    font-size: 12px;
    color: var(--ig-text-secondary);
}

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

.header-icon-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    cursor: pointer;
    transition: background 0.15s;
}

.header-icon-btn:hover {
    background: #1c1c1c;
}

/* ==========================================================================
   3. Instagram Chat Message Stream
   ========================================================================== */

.message-list {
    flex: 1;
    overflow-y: auto;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #000000;
    scroll-behavior: smooth;
}

/* Custom Sleek Scrollbar */
.message-list::-webkit-scrollbar {
    width: 5px;
}
.message-list::-webkit-scrollbar-thumb {
    background: #262626;
    border-radius: 4px;
}

.message-bubble {
    max-width: 72%;
    padding: 11px 16px;
    border-radius: 20px;
    position: relative;
    word-break: break-word;
    font-size: 14.5px;
    line-height: 1.45;
    animation: bubbleSlideIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

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

/* Instagram Signature Outgoing Gradient */
.msg-outgoing {
    align-self: flex-end;
    background: var(--ig-bubble-out);
    color: #ffffff;
    border-bottom-right-radius: 5px;
}

/* Matte Slate Incoming Bubble */
.msg-incoming {
    align-self: flex-start;
    background: var(--ig-bubble-in);
    color: #f5f5f5;
    border-bottom-left-radius: 5px;
    border: 1px solid #303030;
}

.msg-text {
    font-size: 14.5px;
}

.msg-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    font-size: 10.5px;
    opacity: 0.8;
}

.msg-outgoing .msg-footer {
    color: rgba(255, 255, 255, 0.85);
}

.msg-incoming .msg-footer {
    color: var(--ig-text-secondary);
}

.msg-status {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
}

.seen-check {
    color: var(--wa-check-grey);
    font-weight: 700;
}

.msg-status.seen .seen-check {
    color: var(--wa-seen-blue);
}

.msg-status.seen .seen-time {
    color: var(--wa-seen-blue);
    font-size: 10px;
}

/* Floating Reaction Picker Bar */
.reaction-bar {
    position: absolute;
    bottom: -32px;
    right: 8px;
    background: #1e1e1e;
    border: 1px solid #333333;
    border-radius: 20px;
    padding: 3px 6px;
    display: flex;
    gap: 4px;
    z-index: 15;
    box-shadow: 0 4px 14px rgba(0,0,0,0.6);
}

.reaction-btn {
    background: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.15s;
    padding: 2px 4px;
}

.reaction-btn:hover {
    transform: scale(1.3);
}

.msg-reaction-badge {
    position: absolute;
    bottom: -8px;
    right: 12px;
    background: #1e1e1e;
    border: 1px solid #383838;
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

/* WhatsApp Style Voice Note Waveform */
.voice-note-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    min-width: 190px;
}

.voice-play-btn {
    background: #ffffff;
    color: #000000;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

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

.waveform-bar {
    width: 3px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
    transition: height 0.2s;
}

.waveform-bar.playing {
    background: #ffffff;
    animation: waveBounce 0.6s infinite alternate ease-in-out;
}

@keyframes waveBounce {
    from { height: 6px; }
    to { height: 22px; }
}

.voice-duration {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
}

/* Typing Indicator Bubble */
.typing-bubble {
    align-self: flex-start;
    background: var(--ig-bubble-in);
    padding: 8px 14px;
    border-radius: 16px;
    font-size: 12px;
    color: var(--ig-text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #303030;
}

.typing-dot {
    width: 5px;
    height: 5px;
    background: var(--ig-blue);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-4px); }
}

/* ==========================================================================
   4. Instagram Direct Pill Input Bar
   ========================================================================== */

.chat-input-bar {
    padding: 12px 18px;
    background: var(--ig-bg);
    border-top: 1px solid var(--ig-border);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 20;
    flex-shrink: 0;
}

.ig-camera-btn {
    background: transparent;
    color: #ffffff;
    border: none;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    flex-shrink: 0;
    transition: transform 0.15s;
}

.ig-camera-btn:hover {
    transform: scale(1.15);
}

.chat-input-wrapper {
    flex: 1;
    background: var(--ig-surface);
    border-radius: 26px;
    display: flex;
    align-items: center;
    padding: 4px 14px;
    border: 1px solid var(--ig-border-subtle);
    transition: border-color 0.2s;
}

.chat-input-wrapper:focus-within {
    border-color: #555555;
}

.emoji-trigger-btn, .input-action-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 19px;
    cursor: pointer;
    padding: 4px 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s;
}

.emoji-trigger-btn:hover, .input-action-btn:hover {
    transform: scale(1.15);
}

.chat-text-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 14.5px;
    outline: none;
    padding: 8px 6px;
}

.chat-text-input::placeholder {
    color: #737373;
}

.heart-btn {
    color: var(--ig-heart);
    font-size: 22px;
}

.chat-send-btn {
    background: var(--ig-blue);
    color: #ffffff;
    font-weight: 700;
    font-size: 16px;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.15s, opacity 0.15s;
}

.chat-send-btn:hover {
    transform: scale(1.08);
    opacity: 0.95;
}

/* Voice Note Live Recording Overlay */
.voice-recording-hud {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: #141414;
    border-top: 1px solid var(--ig-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    z-index: 25;
}

.recording-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ef4444;
    font-weight: 600;
    font-size: 14px;
}

.recording-pulse-dot {
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
    animation: recPulse 1s infinite alternate;
}

@keyframes recPulse {
    from { opacity: 0.4; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1.1); }
}

.recording-cancel-btn {
    background: transparent;
    border: 1px solid #444;
    color: #ffffff;
    border-radius: 16px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
}

.recording-send-btn {
    background: var(--ig-blue);
    color: #ffffff;
    border: none;
    border-radius: 16px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

/* ==========================================================================
   5. Modals & Overlays (Camera, Face ID, Password Change, Lightbox)
   ========================================================================== */

/* Fullscreen Media Lightbox */
.lightbox-modal {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.94);
    backdrop-filter: blur(14px);
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #ffffff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* In-App Camera Viewfinder */
.camera-modal {
    position: absolute;
    inset: 0;
    background: #000000;
    z-index: 120;
    display: flex;
    flex-direction: column;
}

.camera-video, .camera-preview-img, .camera-preview-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-top-bar {
    position: absolute;
    top: 18px;
    left: 18px;
    right: 18px;
    display: flex;
    justify-content: space-between;
    z-index: 125;
}

.icon-btn {
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #ffffff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    backdrop-filter: blur(8px);
}

.camera-controls {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 125;
}

.snap-shutter-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 4px solid #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.1s;
}

.snap-shutter-btn:active {
    transform: scale(0.92);
}

.inner-circle {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--ig-gradient);
}

.camera-send-controls {
    position: absolute;
    bottom: 24px;
    left: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 125;
}

.caption-input {
    width: 100%;
    height: 44px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #444444;
    border-radius: 22px;
    color: #ffffff;
    padding: 0 16px;
    font-size: 14px;
    outline: none;
    backdrop-filter: blur(10px);
}

.send-snap-btn {
    height: 44px;
    border: none;
    border-radius: 22px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

/* First-Time Face ID Enrollment Modal */
.enrollment-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.94);
    backdrop-filter: blur(16px);
    z-index: 210;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.enrollment-card {
    background: var(--ig-card);
    border: 1px solid var(--ig-border);
    border-radius: 24px;
    padding: 30px 24px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

.enroll-viewfinder {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 3px solid var(--ig-blue);
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 149, 246, 0.3);
}

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

.enroll-progress-bar-wrapper {
    width: 100%;
    height: 6px;
    background: #262626;
    border-radius: 3px;
    overflow: hidden;
}

.enroll-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--ig-gradient);
    transition: width 0.3s ease;
}

.save-password-btn {
    width: 100%;
    height: 46px;
    background: var(--ig-blue);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}

.save-password-btn:hover {
    background: var(--ig-blue-hover);
}

/* Two-Factor Password Change Security Modal */
.security-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
    overflow-y: auto;
}

.security-card, .password-change-card {
    background: #141414;
    border: 1px solid #282828;
    border-radius: 24px;
    padding: 24px 20px;
    max-width: 420px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.95);
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-sizing: border-box;
}

.security-card-header {
    text-align: center;
}

.security-card-header h2 {
    font-size: 19px;
    margin: 4px 0;
    color: #ffffff;
}

.security-card-icon {
    font-size: 32px;
    margin-bottom: 2px;
}

.security-card-subtitle {
    font-size: 12px;
    color: var(--ig-text-secondary);
    margin: 4px 0 0 0;
    line-height: 1.4;
}

.password-face-box {
    position: relative;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto;
    border: 3px solid #333333;
}

.password-face-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.face-scan-hud {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.face-scan-status {
    position: absolute;
    bottom: 8px;
    font-size: 11px;
    background: rgba(0, 0, 0, 0.7);
    padding: 2px 8px;
    border-radius: 10px;
    color: #ffffff;
}

.security-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.security-label {
    font-size: 12px;
    font-weight: 600;
    color: #aaaaaa;
}

.security-code-input, .password-input-field {
    width: 100%;
    height: 44px;
    background: var(--ig-input);
    border: 1px solid var(--ig-border-subtle);
    border-radius: 10px;
    color: #ffffff;
    font-size: 14px;
    padding: 0 14px;
    outline: none;
    transition: border-color 0.2s;
}

.security-code-input:focus, .password-input-field:focus {
    border-color: var(--ig-blue);
}

.security-code-input {
    letter-spacing: 4px;
    font-size: 17px;
    font-weight: 700;
    text-align: center;
}

.security-card-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}

.cancel-modal-btn {
    background: transparent;
    border: none;
    color: var(--ig-text-secondary);
    font-size: 13px;
    cursor: pointer;
    padding: 8px;
}

.cancel-modal-btn:hover {
    color: #ffffff;
}

/* Emoji Keyboard Picker Drawer */
.emoji-keyboard-drawer {
    position: absolute;
    bottom: 74px;
    left: 14px;
    right: 14px;
    background: #181818;
    border: 1px solid var(--ig-border);
    border-radius: 18px;
    padding: 12px;
    z-index: 30;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 280px;
}

.emoji-tabs-bar {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid #282828;
    padding-bottom: 6px;
    overflow-x: auto;
}

.emoji-tab {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
}

.emoji-tab.active {
    background: #2a2a2a;
}

.emoji-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
    gap: 4px;
    overflow-y: auto;
    max-height: 200px;
    padding: 4px;
}

.emoji-item {
    background: transparent;
    border: none;
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: transform 0.1s, background 0.1s;
}

.emoji-item:hover {
    background: #2a2a2a;
    transform: scale(1.2);
}

/* ==========================================================================
   WebRTC Audio & Video Calling UI (AMOLED Dark Glassmorphism)
   ========================================================================== */

/* Incoming Call Overlay */
.incoming-call-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeInCall 0.25s ease-out;
}

@keyframes fadeInCall {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

.incoming-call-card {
    background: #121212;
    border: 1px solid #262626;
    border-radius: 28px;
    padding: 36px 28px;
    max-width: 360px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.95);
}

.caller-avatar-pulse-wrapper {
    position: relative;
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.incoming-caller-avatar {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    background: var(--ig-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 700;
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(220, 39, 67, 0.4);
    z-index: 2;
}

.caller-pulse-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid #0095f6;
    animation: callerPulse 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
    opacity: 0;
}

.caller-pulse-ring.ring-2 {
    animation-delay: 0.6s;
    border-color: #e1306c;
}

@keyframes callerPulse {
    0% { transform: scale(0.8); opacity: 0.8; }
    50% { opacity: 0.4; }
    100% { transform: scale(1.6); opacity: 0; }
}

.incoming-caller-name {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 6px 0;
}

.incoming-call-sublabel {
    font-size: 14px;
    color: var(--ig-text-secondary);
    margin: 0 0 16px 0;
}

.call-security-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.incoming-call-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    width: 100%;
}

.call-action-circle-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.call-action-circle-btn .btn-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    transition: transform 0.15s, box-shadow 0.15s;
}

.call-action-circle-btn .btn-text {
    font-size: 13px;
    font-weight: 600;
    color: #dedede;
}

.decline-call-btn .btn-icon {
    background: #dc2626;
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

.decline-call-btn:hover .btn-icon {
    transform: scale(1.08);
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.6);
}

.accept-call-btn .btn-icon {
    background: #16a34a;
    box-shadow: 0 6px 20px rgba(22, 163, 74, 0.4);
    animation: answerPulse 1.8s infinite;
}

@keyframes answerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); box-shadow: 0 8px 28px rgba(22, 163, 74, 0.7); }
}

.accept-call-btn:hover .btn-icon {
    transform: scale(1.1);
}

/* Active Fullscreen Call Screen */
.active-call-fullscreen {
    position: fixed;
    inset: 0;
    background: #000000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.remote-call-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.local-call-pip-video {
    position: absolute;
    top: 80px;
    right: 20px;
    width: 110px;
    height: 160px;
    object-fit: cover;
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    z-index: 10;
    background: #1a1a1a;
    transition: all 0.2s ease;
}

/* Header bar over active call */
.active-call-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    z-index: 15;
}

.active-call-partner-info h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

.active-call-timer {
    font-size: 13px;
    color: #a0a0a0;
    margin-top: 3px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.active-call-badge {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 4px 10px;
    color: #10b981;
    font-size: 11.5px;
    font-weight: 600;
}

/* Audio Call Center HUD */
.call-audio-hud {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    background: radial-gradient(circle at center, #181818 0%, #000000 100%);
}

.audio-avatar-concentric {
    position: relative;
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
}

.audio-avatar-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--ig-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    font-weight: 700;
    color: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    z-index: 3;
}

.audio-concentric-ring {
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid rgba(0, 149, 246, 0.35);
    animation: concentricRingPulse 3s cubic-bezier(0.1, 0.8, 0.3, 1) infinite;
}

.audio-concentric-ring.c-ring-1 {
    width: 125px;
    height: 125px;
    animation-delay: 0s;
}

.audio-concentric-ring.c-ring-2 {
    width: 155px;
    height: 155px;
    animation-delay: 0.8s;
    border-color: rgba(225, 48, 108, 0.35);
}

.audio-concentric-ring.c-ring-3 {
    width: 185px;
    height: 185px;
    animation-delay: 1.6s;
    border-color: rgba(121, 40, 202, 0.3);
}

@keyframes concentricRingPulse {
    0% { transform: scale(0.9); opacity: 0.8; }
    50% { opacity: 0.35; }
    100% { transform: scale(1.35); opacity: 0; }
}

.call-waveform-bars {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 36px;
}

.wave-bar {
    width: 4px;
    background: #0095f6;
    border-radius: 4px;
    animation: waveBounce 1.2s ease-in-out infinite;
}

.wave-bar.w-1 { height: 12px; animation-delay: 0.1s; }
.wave-bar.w-2 { height: 22px; animation-delay: 0.25s; }
.wave-bar.w-3 { height: 32px; animation-delay: 0.4s; background: #e1306c; }
.wave-bar.w-4 { height: 20px; animation-delay: 0.15s; background: #e1306c; }
.wave-bar.w-5 { height: 14px; animation-delay: 0.3s; }

@keyframes waveBounce {
    0%, 100% { transform: scaleY(0.4); opacity: 0.5; }
    50% { transform: scaleY(1); opacity: 1; }
}

/* Bottom Control Dock */
.active-call-dock {
    position: absolute;
    bottom: 34px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 18px;
    background: rgba(24, 24, 24, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 10px 22px;
    border-radius: 40px;
    z-index: 20;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.85);
}

.call-dock-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #2a2a2a;
    border: 1px solid #3d3d3d;
    color: #ffffff;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.call-dock-btn:hover {
    background: #383838;
    transform: translateY(-2px);
}

.call-dock-btn.active-control {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
}

.call-dock-btn.end-call-btn {
    background: #dc2626;
    border-color: #ef4444;
    transform: rotate(135deg);
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.5);
}

.call-dock-btn.end-call-btn:hover {
    background: #b91c1c;
    transform: rotate(135deg) scale(1.08);
    box-shadow: 0 6px 22px rgba(220, 38, 38, 0.7);
}

