/* ============================================
   Pingstr - Messages Page Styles
   Premium Modern Design v2
   ============================================ */

/* Messages Page Layout */
.messages-page {
    padding: 0;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Animated background gradient */
.messages-page::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 10% 90%, rgba(254, 44, 85, 0.06) 0%, transparent 40%),
                radial-gradient(circle at 90% 10%, rgba(37, 244, 238, 0.04) 0%, transparent 40%),
                radial-gradient(circle at 50% 50%, rgba(138, 43, 226, 0.03) 0%, transparent 30%);
    animation: bgFloatMessages 25s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes bgFloatMessages {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(1%, 1%) rotate(0.5deg); }
    66% { transform: translate(-0.5%, 0.5%) rotate(-0.5deg); }
}

.messages-container {
    display: flex;
    height: 100%;
    background: transparent;
}

/* Conversations Panel - Glassmorphism */
.conversations-panel {
    width: 360px;
    min-width: 300px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(25, 25, 28, 0.95) 0%, rgba(18, 18, 20, 0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.conversations-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(135deg, rgba(254, 44, 85, 0.03) 0%, transparent 50%);
}

.conversations-header-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.conversations-header h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    background: linear-gradient(135deg, #fff 0%, #fff 60%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.messages-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    opacity: 0.7;
}

.new-message-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary) 0%, #ff5577 100%);
    border: none;
    border-radius: 14px;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(254, 44, 85, 0.3);
}

.new-message-btn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 6px 25px rgba(254, 44, 85, 0.4);
}

/* Conversations Search - Premium */
.conversations-search {
    padding: 16px 20px;
    position: relative;
}

.conversations-search i {
    position: absolute;
    left: 36px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    transition: color 0.2s ease;
}

.conversations-search input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
}

.conversations-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(254, 44, 85, 0.05);
    box-shadow: 0 0 0 3px rgba(254, 44, 85, 0.1);
}

.conversations-search input:focus + i,
.conversations-search:focus-within i {
    color: var(--primary);
}

.conversations-search input::placeholder {
    color: var(--text-muted);
}

/* Conversations List */
.conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

/* Custom scrollbar for conversations */
.conversations-list::-webkit-scrollbar {
    width: 6px;
}

.conversations-list::-webkit-scrollbar-track {
    background: transparent;
}

.conversations-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

.conversations-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Custom scrollbar for messages area */
.messages-area::-webkit-scrollbar {
    width: 6px;
}

.messages-area::-webkit-scrollbar-track {
    background: transparent;
}

.messages-area::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

.messages-area::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.12);
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.conversation-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
    opacity: 0;
    transform: scaleY(0);
    transition: all 0.2s ease;
}

.conversation-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.conversation-item.active {
    background: rgba(254, 44, 85, 0.08);
}

.conversation-item.active::before {
    opacity: 1;
    transform: scaleY(1);
}

.conversation-item.unread {
    background: linear-gradient(90deg, rgba(254, 44, 85, 0.1) 0%, transparent 100%);
}

.conversation-avatar {
    position: relative;
    flex-shrink: 0;
}

.conversation-avatar img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.08);
    transition: border-color 0.2s ease;
}

.conversation-item:hover .conversation-avatar img {
    border-color: rgba(254, 44, 85, 0.3);
}

.online-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border: 3px solid var(--bg-secondary);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.conversation-name .verified {
    color: var(--secondary);
    font-size: 14px;
}

.conversation-name .verified.official {
    color: var(--primary);
}

.conversation-preview {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-item.unread .conversation-preview {
    color: var(--text-primary);
    font-weight: 500;
}

.conversation-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.conversation-time {
    font-size: 12px;
    color: var(--text-muted);
    opacity: 0.8;
}

.unread-badge {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: linear-gradient(135deg, var(--primary) 0%, #ff5577 100%);
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: white;
    box-shadow: 0 2px 8px rgba(254, 44, 85, 0.4);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Empty Conversations - Premium */
.conversations-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    text-align: center;
    color: var(--text-muted);
}

.conversations-empty i {
    font-size: 52px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, rgba(254, 44, 85, 0.4) 0%, rgba(37, 244, 238, 0.3) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.conversations-empty h4 {
    font-size: 17px;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-weight: 600;
}

/* Chat Panel - Premium */
.chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(18, 18, 20, 0.6) 0%, rgba(12, 12, 14, 0.8) 100%);
    height: 100%;
    max-height: 100vh;
    overflow: hidden;
}

/* Chat Empty State - Premium Design */
.chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Floating decorative bubbles */
.chat-empty-decoration {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.floating-bubble {
    position: absolute;
    border-radius: 50%;
    opacity: 0.4;
}

.floating-bubble.bubble-1 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(254, 44, 85, 0.15) 0%, transparent 70%);
    top: 10%;
    left: 15%;
    animation: floatBubble1 8s ease-in-out infinite;
}

.floating-bubble.bubble-2 {
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(37, 244, 238, 0.12) 0%, transparent 70%);
    bottom: 20%;
    right: 20%;
    animation: floatBubble2 10s ease-in-out infinite;
}

.floating-bubble.bubble-3 {
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(138, 43, 226, 0.1) 0%, transparent 70%);
    top: 40%;
    right: 30%;
    animation: floatBubble3 12s ease-in-out infinite;
}

@keyframes floatBubble1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -20px) scale(1.1); }
}

@keyframes floatBubble2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-20px, 30px) scale(0.9); }
}

@keyframes floatBubble3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(15px, 15px) scale(1.15); }
}

.chat-empty-icon {
    width: 120px;
    height: 120px;
    background: linear-gradient(145deg, rgba(40, 40, 45, 0.8) 0%, rgba(25, 25, 30, 0.9) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
    position: relative;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.chat-empty-icon::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #25f4ee, transparent);
    opacity: 0.5;
    z-index: -1;
    animation: iconGlow 3s ease-in-out infinite;
}

@keyframes iconGlow {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.02); }
}

.chat-empty-icon i {
    font-size: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, #25f4ee 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.chat-empty h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    background: linear-gradient(135deg, #fff 0%, #fff 70%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.chat-empty p {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 32px;
    max-width: 300px;
}

/* Feature items */
.empty-features {
    display: flex;
    gap: 24px;
    margin-bottom: 32px;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.feature-item i {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    font-size: 16px;
    color: var(--primary);
    transition: all 0.3s ease;
}

.feature-item:hover i {
    background: rgba(254, 44, 85, 0.15);
    transform: translateY(-3px);
}

.feature-item span {
    font-size: 12px;
    color: var(--text-muted);
}

.start-chat-btn {
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--primary) 0%, #ff5577 100%);
    border: none;
    border-radius: 50px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 30px rgba(254, 44, 85, 0.3);
    position: relative;
    overflow: hidden;
}

.start-chat-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.start-chat-btn:hover::before {
    left: 100%;
}

.start-chat-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 40px rgba(254, 44, 85, 0.4);
}

/* Active Chat */
.active-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100vh;
    overflow: hidden;
}

/* Chat Header - Premium */
.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(180deg, rgba(25, 25, 28, 0.95) 0%, rgba(20, 20, 23, 0.9) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    flex-shrink: 0;
    z-index: 10;
}

.back-btn {
    display: none;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: rgba(254, 44, 85, 0.15);
    color: var(--primary);
}

.chat-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 12px;
    transition: background 0.2s ease;
}

.chat-user-info:hover {
    background: rgba(255, 255, 255, 0.04);
}

.chat-user-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.chat-user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-user-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.chat-user-status {
    font-size: 13px;
    color: #22c55e;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-user-status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chat-user-status.offline {
    color: var(--text-muted);
}

.chat-user-status.offline::before {
    background: var(--text-muted);
    animation: none;
}

.chat-actions {
    display: flex;
    gap: 6px;
}

.chat-action-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.04);
    border: none;
    color: var(--text-secondary);
    font-size: 17px;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-action-btn:hover {
    background: rgba(254, 44, 85, 0.12);
    color: var(--primary);
    transform: scale(1.05);
}

/* Messages Area - Premium */
.messages-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: linear-gradient(180deg, rgba(15, 15, 18, 0.5) 0%, rgba(10, 10, 12, 0.7) 100%);
    min-height: 0; /* Important for flex scroll */
    scroll-behavior: smooth;
}

.message {
    display: flex;
    gap: 10px;
    max-width: 70%;
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.sent {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message.received {
    align-self: flex-start;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.message.sent .message-avatar {
    display: none;
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 20px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    position: relative;
}

.message.sent .message-bubble {
    background: linear-gradient(135deg, var(--primary) 0%, #ff5577 100%);
    color: white;
    border-bottom-right-radius: 6px;
    box-shadow: 0 4px 15px rgba(254, 44, 85, 0.25);
}

.message.received .message-bubble {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border-bottom-left-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.message-time {
    font-size: 11px;
    color: var(--text-muted);
    padding: 0 8px;
    opacity: 0.8;
}

.message.sent .message-time {
    text-align: right;
}

/* Date Separator - Premium */
.date-separator {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 0;
}

.date-separator::before,
.date-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
}

.date-separator span {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 20px;
}

/* Message Input - Premium (Fixed at Bottom) */
.message-input-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(180deg, rgba(25, 25, 28, 0.98) 0%, rgba(20, 20, 23, 1) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-shrink: 0;
    z-index: 10;
}

.attach-btn,
.emoji-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.04);
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attach-btn:hover,
.emoji-btn:hover {
    color: var(--primary);
    background: rgba(254, 44, 85, 0.12);
    transform: scale(1.05);
}

.message-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 24px;
    padding: 0 12px 0 18px;
    transition: all 0.3s ease;
}

.message-input-wrapper:focus-within {
    border-color: var(--primary);
    background: rgba(254, 44, 85, 0.05);
    box-shadow: 0 0 0 3px rgba(254, 44, 85, 0.1);
}

.message-input {
    flex: 1;
    padding: 14px 0;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
}

.message-input:focus {
    outline: none;
}

.message-input::placeholder {
    color: var(--text-muted);
}

.send-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary) 0%, #ff5577 100%);
    border: none;
    border-radius: 14px;
    color: white;
    font-size: 17px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(254, 44, 85, 0.3);
}

.send-btn:hover:not(:disabled) {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 6px 25px rgba(254, 44, 85, 0.4);
}

.send-btn:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

/* Typing Indicator - Premium */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    font-size: 13px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    width: fit-content;
}

.typing-dots {
    display: flex;
    gap: 5px;
}

.typing-dots span {
    width: 7px;
    height: 7px;
    background: linear-gradient(135deg, var(--primary) 0%, #ff5577 100%);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }
    30% { transform: translateY(-5px); opacity: 1; }
}

/* New Message Modal - Premium */
.new-message-content {
    max-width: 420px;
    width: 100%;
}

.new-message-content.premium-modal {
    background: linear-gradient(180deg, rgba(28, 28, 32, 0.98) 0%, rgba(18, 18, 22, 0.99) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 24px;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(254, 44, 85, 0.08);
    overflow: hidden;
}

.premium-modal .modal-header {
    padding: 28px 24px 20px;
    text-align: center;
    position: relative;
    background: linear-gradient(135deg, rgba(254, 44, 85, 0.05) 0%, transparent 50%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-header-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary) 0%, #ff5577 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 8px 25px rgba(254, 44, 85, 0.3);
}

.modal-header-icon i {
    font-size: 24px;
    color: white;
}

.premium-modal .modal-header h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #fff 0%, #fff 70%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

.premium-modal .close-modal {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.premium-modal .close-modal:hover {
    background: rgba(254, 44, 85, 0.15);
    color: var(--primary);
}

.user-search-container {
    position: relative;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.search-input-wrapper {
    position: relative;
}

.user-search-container .search-input-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    transition: color 0.2s ease;
}

.user-search-container input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.3s ease;
}

.user-search-container input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(254, 44, 85, 0.05);
    box-shadow: 0 0 0 3px rgba(254, 44, 85, 0.1);
}

.user-search-container input:focus + i,
.user-search-container:focus-within .search-input-wrapper i {
    color: var(--primary);
}

.user-search-results {
    max-height: 320px;
    overflow-y: auto;
    padding: 8px 0;
}

.search-hint-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    text-align: center;
}

.search-hint-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.search-hint-icon i {
    font-size: 24px;
    color: var(--text-muted);
}

.search-hint {
    text-align: center;
    color: var(--text-muted);
    padding: 0;
    font-size: 14px;
}

.user-search-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.user-search-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
    opacity: 0;
    transform: scaleY(0);
    transition: all 0.2s ease;
}

.user-search-item:hover {
    background: rgba(254, 44, 85, 0.08);
}

.user-search-item:hover::before {
    opacity: 1;
    transform: scaleY(1);
}

.user-search-item img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.08);
    transition: border-color 0.2s ease;
}

.user-search-item:hover img {
    border-color: rgba(254, 44, 85, 0.3);
}

.user-search-item-info {
    flex: 1;
}

.user-search-item-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.user-search-item-name .verified {
    color: var(--secondary);
    font-size: 14px;
}

.user-search-item-name .verified.official {
    color: var(--primary);
}

.user-search-item-username {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Loading Spinner - Premium */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.06);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 20px rgba(254, 44, 85, 0.2);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile Responsiveness - Premium */
@media (max-width: 768px) {
    .messages-container {
        position: relative;
    }
    
    .conversations-panel {
        position: absolute;
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        z-index: 10;
        transform: translateX(0);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .conversations-panel.hidden {
        transform: translateX(-100%);
    }
    
    .chat-panel {
        position: absolute;
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 11;
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .chat-panel.active {
        transform: translateX(0);
    }
    
    .back-btn {
        display: flex;
    }
    
    .message {
        max-width: 85%;
    }
    
    .messages-page {
        padding-bottom: var(--mobile-nav-height);
    }
    
    .empty-features {
        flex-direction: column;
        gap: 16px;
    }
    
    .feature-item {
        flex-direction: row;
        gap: 12px;
    }
    
    .chat-empty h3 {
        font-size: 24px;
    }
    
    .floating-bubble {
        display: none;
    }
    
    .conversations-header h2 {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .conversation-avatar img {
        width: 50px;
        height: 50px;
    }
    
    .chat-actions {
        gap: 4px;
    }
    
    .chat-action-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
        border-radius: 10px;
    }
    
    .new-message-btn {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }
    
    .emoji-picker {
        width: 300px;
        right: -60px;
    }
    
    .attachment-menu {
        left: -10px;
    }
}

/* ============================================
   Emoji Picker & Attachment Menu - Premium
   ============================================ */

/* Emoji Picker */
.emoji-picker {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    width: 340px;
    background: linear-gradient(180deg, rgba(28, 28, 32, 0.98) 0%, rgba(20, 20, 24, 0.99) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(254, 44, 85, 0.05);
    z-index: 1000;
    margin-bottom: 12px;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.emoji-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 10px;
    gap: 4px;
    background: rgba(255, 255, 255, 0.02);
}

.emoji-tab {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.emoji-tab:hover {
    background: rgba(255, 255, 255, 0.06);
}

.emoji-tab.active {
    background: rgba(254, 44, 85, 0.15);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    padding: 14px;
    max-height: 220px;
    overflow-y: auto;
    background: transparent;
}

.emoji-grid::-webkit-scrollbar {
    width: 6px;
}

.emoji-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}

.emoji-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.emoji-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

.emoji-item {
    padding: 8px;
    background: transparent;
    border: none;
    border-radius: 10px;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-item:hover {
    background: rgba(254, 44, 85, 0.15);
    transform: scale(1.25);
}

/* Attachment Menu - Premium */
.attachment-menu {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    background: linear-gradient(180deg, rgba(28, 28, 32, 0.98) 0%, rgba(20, 20, 24, 0.99) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(254, 44, 85, 0.05);
    z-index: 1000;
    margin-bottom: 12px;
    padding: 14px;
    flex-direction: row;
    gap: 10px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.attachment-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 75px;
}

.attachment-option:hover {
    background: rgba(254, 44, 85, 0.12);
    border-color: rgba(254, 44, 85, 0.2);
    transform: translateY(-3px);
}

.attachment-option i {
    font-size: 28px;
    background: linear-gradient(135deg, var(--primary) 0%, #ff5577 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.attachment-option span {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ============================================
   Media Messages (Video & Image)
   ============================================ */

.message-media {
    margin: 0;
    padding: 0;
}

.message-media video,
.message-media img {
    display: block;
    max-width: 280px;
    max-height: 400px;
    border-radius: 12px;
    object-fit: cover;
}

.message-media img {
    cursor: pointer;
    transition: transform 0.2s;
}

.message-media img:hover {
    transform: scale(1.02);
}

.message-media video {
    background: #000;
}

/* Adjust bubble spacing for media */
.message .message-content .message-media {
    margin-bottom: 4px;
}

/* Sent media messages */
.message.sent .message-media video,
.message.sent .message-media img {
    border: 2px solid var(--primary, #ff2d55);
}

/* Received media messages */
.message.received .message-media video,
.message.received .message-media img {
    border: 2px solid #333;
}