/* Specific Styles for Private Messaging Interface (100% Full Bleed Edge-to-Edge, Zero Gap) */
        html, body.messages-page {
            height: 100vh !important;
            height: 100dvh !important;
            width: 100vw !important;
            margin: 0 !important;
            padding: 0 !important;
            overflow: hidden !important;
            background-color: var(--bg-dark);
        }

        body.messages-page .main-header {
            height: 60px !important;
            padding: 0 !important;
            display: flex;
            align-items: center;
        }

        body.messages-page .main-header .nav-container {
            height: 100%;
        }

        .dm-main-section {
            position: fixed !important;
            top: 60px !important;
            left: 0 !important;
            right: 0 !important;
            bottom: 0 !important;
            width: 100vw !important;
            height: calc(100vh - 60px) !important;
            height: calc(100dvh - 60px) !important;
            margin: 0 !important;
            padding: 0 !important;
            padding-bottom: env(safe-area-inset-bottom, 0px) !important;
            box-sizing: border-box !important;
            overflow: hidden !important;
            display: flex;
            flex-direction: column;
            z-index: 1;
        }

        .dm-app-container {
            display: grid;
            grid-template-columns: 360px 1fr;
            height: 100% !important;
            width: 100% !important;
            max-width: 100% !important;
            background: rgba(12, 12, 26, 0.95);
            border-top: 1px solid var(--glass-border);
            border-bottom: none !important;
            border-left: none !important;
            border-right: none !important;
            border-radius: 0 !important;
            margin: 0 !important;
            overflow: hidden;
            backdrop-filter: blur(30px);
            box-shadow: none !important;
            transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
            will-change: transform;
        }

        /* Left Conversations Sidebar */
        .dm-sidebar {
            background: rgba(10, 10, 24, 0.75);
            border-right: 1px solid var(--glass-border);
            display: flex;
            flex-direction: column;
            height: 100%;
            min-height: 0;
            overflow: hidden;
        }

        .dm-sidebar-header {
            padding: 1.25rem 1.5rem;
            border-bottom: 1px solid var(--glass-border);
            display: flex;
            flex-direction: column;
            gap: 1rem;
            flex-shrink: 0;
        }

        .dm-sidebar-title {
            font-family: var(--font-heading);
            font-size: 1.25rem;
            font-weight: 850;
            color: #fff;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .dm-search-input {
            width: 100%;
            padding: 10px 16px;
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid var(--glass-border);
            border-radius: 12px;
            color: #fff;
            font-size: 0.88rem;
            outline: none;
            transition: var(--transition-smooth);
        }

        .dm-search-input:focus {
            border-color: #00f5d4;
            box-shadow: 0 0 12px rgba(0, 245, 212, 0.2);
        }

        .dm-users-list {
            flex: 1;
            min-height: 0;
            overflow-y: auto;
            padding: 10px;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .dm-user-item {
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 12px 14px;
            border-radius: 14px;
            cursor: pointer;
            transition: var(--transition-smooth);
            border: 1px solid transparent;
        }

        .dm-user-item:hover {
            background: rgba(255, 255, 255, 0.04);
            border-color: rgba(255, 255, 255, 0.06);
            transform: translateX(4px);
        }

        .dm-user-item.active {
            background: linear-gradient(135deg, rgba(181, 23, 158, 0.25), rgba(63, 55, 201, 0.25));
            border-color: rgba(181, 23, 158, 0.45);
        }

        .dm-avatar-wrapper {
            position: relative;
            width: 44px;
            height: 44px;
            flex-shrink: 0;
        }

        .dm-avatar-img {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            object-fit: cover;
            border: 2px solid rgba(255, 255, 255, 0.1);
        }

        .dm-status-dot {
            position: absolute;
            bottom: 0;
            right: 0;
            width: 12px;
            height: 12px;
            border-radius: 50%;
            border: 2px solid #0a0a18;
        }

        .dm-status-dot.online {
            background: #00f5d4;
            box-shadow: 0 0 8px #00f5d4;
        }

        .dm-status-dot.offline {
            background: #555566;
        }

        .dm-user-info {
            flex: 1;
            min-width: 0;
        }

        .dm-user-name-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 2px;
        }

        .dm-user-name {
            font-weight: 800;
            font-size: 0.92rem;
            color: #fff;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .dm-last-time {
            font-size: 0.72rem;
            color: var(--text-muted);
        }

        .dm-user-snippet {
            font-size: 0.8rem;
            color: var(--text-muted);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .dm-unread-badge {
            background: #ff007f;
            color: #fff;
            font-size: 0.72rem;
            font-weight: 850;
            padding: 2px 8px;
            border-radius: 20px;
            box-shadow: 0 0 10px rgba(255, 0, 127, 0.5);
        }

        /* Right Chat Pane */
        .dm-chat-pane {
            display: flex;
            flex-direction: column;
            height: 100%;
            min-height: 0;
            overflow: hidden;
            background: rgba(16, 16, 32, 0.4);
        }

        .dm-chat-header {
            padding: 1.25rem 2rem;
            border-bottom: 1px solid var(--glass-border);
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: rgba(10, 10, 24, 0.5);
            flex-shrink: 0;
        }

        .dm-chat-header-user {
            display: flex;
            align-items: center;
            gap: 14px;
        }

        .dm-mobile-back-btn {
            display: none;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid var(--glass-border);
            color: #fff;
            width: 44px;
            height: 44px;
            min-width: 44px;
            min-height: 44px;
            border-radius: 12px;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            padding: 0;
            margin-right: 8px;
            transition: var(--transition-fast);
            flex-shrink: 0;
        }

        .dm-mobile-back-btn:hover, .dm-mobile-back-btn:active {
            background: rgba(0, 245, 212, 0.15);
            border-color: #00f5d4;
            color: #00f5d4;
        }

        .dm-messages-body {
            flex: 1;
            min-height: 0;
            overflow-y: auto;
            padding: 1.5rem 2rem;
            display: flex;
            flex-direction: column;
            gap: 1.25rem;
        }

        .dm-empty-state {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100%;
            color: var(--text-muted);
            text-align: center;
            gap: 1rem;
        }

        /* Message Bubbles */
        .dm-message-row {
            display: flex;
            gap: 12px;
            max-width: 80%;
        }

        .dm-message-row.sent {
            align-self: flex-end;
            flex-direction: row-reverse;
        }

        .dm-message-row.received {
            align-self: flex-start;
        }

        .dm-msg-bubble {
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid var(--glass-border);
            border-radius: 18px;
            padding: 12px 18px;
            color: #fff;
            font-size: 0.92rem;
            line-height: 1.5;
            position: relative;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        }

        .dm-message-row.sent .dm-msg-bubble {
            background: linear-gradient(135deg, rgba(181, 23, 158, 0.38), rgba(63, 55, 201, 0.38));
            border-color: rgba(181, 23, 158, 0.5);
            border-bottom-right-radius: 4px;
        }

        .dm-message-row.received .dm-msg-bubble {
            border-bottom-left-radius: 4px;
        }

        .dm-msg-time {
            font-size: 0.7rem;
            color: rgba(255, 255, 255, 0.5);
            margin-top: 4px;
            text-align: right;
        }

        .dm-msg-media {
            margin-top: 6px;
            margin-bottom: 4px;
            border-radius: 14px;
            overflow: hidden;
            max-width: 280px;
            max-height: 220px;
            cursor: pointer;
            border: 1px solid rgba(255, 255, 255, 0.12);
            background: rgba(0, 0, 0, 0.4);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: transform 0.25s ease;
        }

        .dm-msg-media:hover {
            transform: scale(1.02);
            border-color: #00f5d4;
        }

        .dm-msg-media img, .dm-msg-media video {
            max-width: 100%;
            max-height: 220px;
            object-fit: contain;
            display: block;
            border-radius: 12px;
        }

        .dm-msg-file-attachment {
            display: flex;
            align-items: center;
            gap: 10px;
            background: rgba(0, 0, 0, 0.3);
            border: 1px solid var(--glass-border);
            padding: 10px 14px;
            border-radius: 12px;
            margin-top: 8px;
            text-decoration: none;
            color: #00f5d4;
            font-weight: 700;
            font-size: 0.85rem;
        }

        /* Input Section */
        .dm-input-area {
            padding: 1.25rem 2rem;
            border-top: 1px solid var(--glass-border);
            background: rgba(10, 10, 24, 0.6);
            display: flex;
            flex-direction: column;
            gap: 10px;
            flex-shrink: 0;
        }

        .dm-pending-attachments {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }

        .dm-pending-item {
            position: relative;
            background: rgba(0,0,0,0.4);
            border: 1px solid #00f5d4;
            padding: 6px 12px;
            border-radius: 10px;
            font-size: 0.8rem;
            color: #fff;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .dm-pending-remove {
            color: #ff4a75;
            cursor: pointer;
            font-weight: 900;
        }

        .dm-input-row {
            display: flex;
            align-items: center;
            gap: 12px;
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid var(--glass-border);
            border-radius: 16px;
            padding: 6px 12px 6px 16px;
            transition: var(--transition-smooth);
        }

        .dm-input-row:focus-within {
            border-color: rgba(0, 245, 212, 0.5);
            box-shadow: 0 0 20px rgba(0, 245, 212, 0.15);
            background: rgba(255, 255, 255, 0.05);
        }

        .dm-text-input, .dm-message-input {
            flex: 1;
            background: transparent;
            border: none;
            outline: none;
            color: #fff;
            font-family: inherit;
            font-size: 16px !important; /* iOS anti-zoom font size */
            padding: 8px 0;
            resize: none;
            max-height: 140px;
            min-height: 24px;
            line-height: 1.4;
            overflow-y: auto;
            box-sizing: border-box;
        }

        /* 3-Dot Live Typing Indicator */
        .dm-typing-row {
            align-self: flex-start;
            align-items: center;
            margin-top: 4px;
            margin-bottom: 8px;
        }

        .dm-typing-avatar {
            width: 32px;
            height: 32px;
        }

        .dm-typing-bubble {
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid var(--glass-border);
            border-radius: 18px;
            border-bottom-left-radius: 4px;
            padding: 10px 16px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .dm-typing-dots {
            display: flex;
            align-items: center;
            gap: 5px;
            height: 12px;
        }

        .dm-typing-dots .dm-dot {
            width: 7px;
            height: 7px;
            background-color: rgba(255, 255, 255, 0.7);
            border-radius: 50%;
            display: inline-block;
            animation: dmTypingBounce 1.4s infinite ease-in-out both;
        }

        .dm-typing-dots .dm-dot:nth-child(1) {
            animation-delay: -0.32s;
        }

        .dm-typing-dots .dm-dot:nth-child(2) {
            animation-delay: -0.16s;
        }

        @keyframes dmTypingBounce {
            0%, 80%, 100% {
                transform: scale(0.6);
                opacity: 0.4;
            }
            40% {
                transform: scale(1);
                opacity: 1;
                background-color: #00f5d4;
            }
        }

        .dm-btn-icon {
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid var(--glass-border);
            color: #fff;
            width: 44px;
            height: 44px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: var(--transition-smooth);
            font-size: 1.1rem;
            flex-shrink: 0;
        }

        .dm-btn-icon:hover {
            background: rgba(255, 255, 255, 0.1);
            border-color: #00f5d4;
            color: #00f5d4;
        }

        .dm-btn-send {
            background: var(--primary-gradient);
            border: none;
            color: #fff;
            padding: 10px 22px;
            border-radius: 12px;
            font-family: var(--font-heading);
            font-weight: 850;
            font-size: 0.95rem;
            cursor: pointer;
            box-shadow: 0 6px 20px rgba(181, 23, 158, 0.4);
            transition: var(--transition-smooth);
            display: flex;
            align-items: center;
            gap: 8px;
            flex-shrink: 0;
        }

        .dm-btn-send:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 25px rgba(181, 23, 158, 0.6);
        }

        @media (max-width: 1100px) {
            .dm-app-container {
                grid-template-columns: 290px 1fr;
            }
        }

        @media (max-width: 950px) {
            .dm-main-section {
                top: 56px !important;
                height: calc(100vh - 56px) !important;
                height: calc(100dvh - 56px) !important;
                padding: 0 !important;
                overflow: hidden !important;
                width: 100% !important;
                max-width: 100% !important;
            }
            .dm-app-container {
                display: flex !important;
                grid-template-columns: none !important;
                width: 200% !important;
                max-width: 200% !important;
                height: 100% !important;
                border-radius: 0 !important;
                transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1) !important;
                transform: translate3d(0, 0, 0) !important;
            }
            .dm-app-container.show-chat-list {
                transform: translate3d(0, 0, 0) !important;
            }
            .dm-app-container.show-chat-active {
                transform: translate3d(-50%, 0, 0) !important;
            }
            .dm-sidebar {
                width: 50% !important;
                min-width: 50% !important;
                max-width: 50% !important;
                flex: 0 0 50% !important;
            }
            .dm-chat-pane {
                width: 50% !important;
                min-width: 50% !important;
                max-width: 50% !important;
                flex: 0 0 50% !important;
            }
            .dm-sidebar.hidden-mobile,
            .dm-chat-pane.hidden-mobile {
                display: flex !important;
            }
            .dm-mobile-back-btn {
                display: inline-flex !important;
                min-width: 44px !important;
                min-height: 44px !important;
                touch-action: manipulation !important;
            }
            .dm-search-input {
                font-size: 16px !important;
            }
            .dm-msg-bubble {
                overflow-wrap: anywhere !important;
                word-break: break-word !important;
            }
            .dm-chat-header {
                padding: 1rem 1.25rem;
            }
            .dm-messages-body {
                padding: 1rem 1.25rem;
                -webkit-overflow-scrolling: touch;
                overscroll-behavior-y: contain;
            }
            .dm-input-area {
                padding: 1rem 1.25rem;
                padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
            }
        }

        @media (max-width: 480px) {
            .dm-chat-header {
                padding: 0.75rem 0.85rem;
            }
            .dm-messages-body {
                padding: 0.75rem 0.85rem;
            }
            .dm-input-area {
                padding: 0.75rem 0.85rem;
                padding-bottom: max(0.85rem, env(safe-area-inset-bottom, 0px));
            }
            .dm-msg-bubble {
                max-width: 90%;
                font-size: 0.9rem;
            }
            .dm-btn-send {
                min-width: 44px !important;
                width: 44px !important;
                height: 44px !important;
                padding: 0 !important;
                display: inline-flex !important;
                align-items: center !important;
                justify-content: center !important;
                border-radius: 12px !important;
                touch-action: manipulation !important;
            }
            .dm-btn-send span {
                display: none !important;
            }
        }

/* Skeleton Loaders PulseChat */
@keyframes shimmerPulse {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-shimmer {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.09) 50%, rgba(255, 255, 255, 0.03) 75%) !important;
    background-size: 200% 100% !important;
    animation: shimmerPulse 1.8s infinite ease-in-out !important;
    border-radius: 8px;
}

.skeleton-conv-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
    margin-bottom: 8px;
}

.skeleton-msg-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    width: 60%;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.03);
}
