/* messaging.css - CORRECTED VERSION */

/* Messages Page - Proper layout within main app */
#messagesPage {
    position: fixed;
    top: 60px; /* Below main navbar */
    left: 0;
    right: 0;
    bottom: 60px; /* Above tabbar */
    background: white;
    z-index: 1000;
    overflow-y: auto;
    padding: 0;
}

#messagesPage.hidden {
    display: none !important;
}

/* Messages Page Navbar */
#messagesPage .navbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    z-index: 10;
}

#messagesPage .page-content {
    position: absolute;
    top: 60px; /* Below messages navbar */
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    padding: 15px;
}

/* Conversation Page - Proper layout */
#conversationPage {
    position: fixed;
    top: 60px; /* Below main navbar */
    left: 0;
    right: 0;
    bottom: 80px; /* Above tabbar */
    background: #f5f5f5;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    padding: 0;
}

#conversationPage.hidden {
    display: none !important;
}

/* Conversation Page Navbar */
#conversationPage .navbar {
    flex-shrink: 0;
    height: 0px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    z-index: 10;
}



/* Ensure messages don't hide behind input */
.message:last-child {
    margin-bottom: 0px; /* Space for input area */
}

/* Messages Container */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f5f5f5;
    padding-bottom: 0px; /* Space for scrolling above input */
}

/* Modern Message Input Area - Dynamic with keyboard */
.message-input-area {
    background: white;
    border-top: 1px solid #e0e0e0;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    flex-shrink: 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

/* Message Input */
.message-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 24px;
    margin-right: 10px;
    font-size: 16px;
    outline: none;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.message-input:focus {
    border-color: #2196F3;
    background: white;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
}

/* Modern Send Button */
.send-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.send-button:active {
    transform: scale(0.95);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
}

/* Enhanced FAB for New Conversation */
.fab {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    z-index: 1002;
    transition: all 0.3s ease;
}

.fab:active {
    transform: scale(0.95) translateY(2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.fab .f7-icons {
    font-size: 24px;
    font-weight: bold;
}

/* Enhanced Pencil/Edit Icon in Navbar */
#messagesPage .navbar .right .link.icon-only {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 8px;
    color: white !important;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

#messagesPage .navbar .right .link.icon-only:active {
    transform: scale(0.95);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
}

/* Enhanced Back Button */
#messagesPage .navbar .left .link.back,
#conversationPage .navbar .left .link.back {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 8px;
    color: #333 !important;
    transition: all 0.3s ease;
}

#messagesPage .navbar .left .link.back:active,
#conversationPage .navbar .left .link.back:active {
    transform: scale(0.95);
    background: rgba(0, 0, 0, 0.15);
}

/* Conversation Item Styling */
.conversation-item {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
}

.conversation-item:hover {
    background-color: #f8f9fa;
}

.conversation-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 20px;
    margin-right: 15px;
    flex-shrink: 0;
}

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

.conversation-name {
    font-weight: bold;
    font-size: 16px;
    color: #333;
    margin-bottom: 5px;
}

.conversation-preview {
    font-size: 14px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-time {
    font-size: 12px;
    color: #999;
    text-align: right;
    margin-bottom: 5px;
}

/* Message Styles */
.message {
    margin: 10px 0;
    display: flex;
    max-width: 80%;
}

.message-sent {
    margin-left: auto;
    justify-content: flex-end;
}

.message-received {
    margin-right: auto;
    justify-content: flex-start;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 100%;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.message-sent .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 5px;
}

.message-received .message-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 5px;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 5px;
    text-align: right;
}

/* User Search Results */
.user-search-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
}

.user-search-item:hover {
    background-color: #f8f9fa;
}

.user-search-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 12px;
    flex-shrink: 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #8e8e93;
}

.empty-state .f7-icons {
    font-size: 64px;
    color: #ccc;
    margin-bottom: 15px;
}

/* Ripple effect for FAB */
.fab-ripple {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: ripple 2s infinite;
}

@keyframes ripple {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

/* Safe area adjustments */
@supports (padding: max(0px)) {
    #messagesPage {
        top: max(60px, calc(60px + env(safe-area-inset-top)));
        bottom: max(60px, calc(60px + env(safe-area-inset-bottom)));
    }
    
    #conversationPage {
        top: max(60px, calc(60px + env(safe-area-inset-top)));
        bottom: env(safe-area-inset-bottom);
    }
    
    .fab {
        bottom: max(80px, calc(80px + env(safe-area-inset-bottom)));
    }
}

/* Keyboard handling - will be adjusted by JavaScript */
.keyboard-open #conversationPage {
    padding-bottom: 300px; /* Estimated keyboard height */
}

.keyboard-open .message-input-area {
    position: relative;
    bottom: auto;
}
/* ==================== MODERN USER SEARCH SECTION ==================== */

/* User Search Section */
#userSearchSection {
    background: white;
    border-bottom: 1px solid #f0f0f0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    padding: 15px 0;
    animation: slideDown 0.3s ease;
}

#userSearchSection.hidden {
    display: none !important;
}

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

/* Search Bar Container */
.searchbar {
    position: relative;
    margin: 0 15px 15px 15px;
    border-radius: 25px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.searchbar:focus-within {
    background: white;
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

/* Modern Search Input */
#userSearchInput {
    width: 100%;
    padding: 14px 50px 14px 45px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
    outline: none;
    background: transparent;
    color: #333;
    transition: all 0.3s ease;
}

#userSearchInput::placeholder {
    color: #999;
    font-weight: 400;
}

#userSearchInput:focus {
    background: transparent;
}

/* Search Icon */
.searchbar .search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-size: 18px;
    pointer-events: none;
    transition: all 0.3s ease;
}

.searchbar:focus-within .search-icon {
    color: #764ba2;
    transform: translateY(-50%) scale(1.1);
}

/* Clear Search Button (optional - you can add this to HTML later) */
.searchbar .clear-search {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: none;
}

.searchbar .clear-search:hover {
    background: #f0f0f0;
    color: #ff3b30;
}

.searchbar .clear-search:active {
    transform: translateY(-50%) scale(0.9);
}

/* Show clear button when input has value */
#userSearchInput:not(:placeholder-shown) + .search-icon + .clear-search {
    display: block;
}

/* Search Results Container */
.search-results-container {
    max-height: 400px;
    overflow-y: auto;
    margin: 0 15px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
    animation: fadeIn 0.3s ease;
}

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

/* Individual Search Result Items */
.user-search-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f8f8f8;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.user-search-item:last-child {
    border-bottom: none;
}

.user-search-item:hover {
    background: linear-gradient(90deg, 
        rgba(102, 126, 234, 0.05) 0%, 
        rgba(118, 75, 162, 0.05) 100%);
    transform: translateX(5px);
}

.user-search-item:active {
    transform: translateX(5px) scale(0.98);
}

/* User Avatar in Search Results */
.user-search-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
    margin-right: 15px;
    flex-shrink: 0;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.user-search-item:hover .user-search-avatar {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

/* User Info in Search Results */
.user-search-info {
    flex: 1;
    min-width: 0;
}

.user-search-name {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-search-status {
    font-size: 11px;
    color: #28a745;
    background: rgba(40, 167, 69, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.user-search-status.offline {
    color: #6c757d;
    background: rgba(108, 117, 125, 0.1);
}

.user-search-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}

.user-search-status.offline::before {
    background: #6c757d;
}

.user-search-bio {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Message Button on Search Results */
.user-search-message-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff7e5f 0%, #feb47b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-left: 10px;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(255, 126, 95, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.user-search-message-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 126, 95, 0.4);
}

.user-search-message-btn:active {
    transform: scale(0.95);
}

.user-search-message-btn .f7-icons {
    font-size: 16px;
}

/* No Results State */
.no-results-found {
    text-align: center;
    padding: 40px 20px;
    color: #8e8e93;
}

.no-results-found .f7-icons {
    font-size: 48px;
    color: #e0e0e0;
    margin-bottom: 15px;
}

.no-results-found h4 {
    margin-bottom: 10px;
    color: #666;
    font-size: 16px;
    font-weight: 600;
}

.no-results-found p {
    font-size: 14px;
    color: #999;
    line-height: 1.4;
}

/* Loading State */
.search-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
}

.search-loading-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Search Results Header */
.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 12px 12px 0 0;
}

.search-results-header h4 {
    margin: 0;
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

.search-results-count {
    color: #667eea;
    font-size: 12px;
    font-weight: 600;
    background: rgba(102, 126, 234, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
}

/* Scrollbar Styling for Search Results */
.search-results-container::-webkit-scrollbar {
    width: 6px;
}

.search-results-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.search-results-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.search-results-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Recent Searches Section (Optional Enhancement) */
.recent-searches {
    margin: 15px 15px 0 15px;
}

.recent-searches-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.recent-searches-header h5 {
    margin: 0;
    color: #666;
    font-size: 13px;
    font-weight: 600;
}

.clear-recent {
    color: #667eea;
    font-size: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.clear-recent:hover {
    background: rgba(102, 126, 234, 0.1);
}

.recent-search-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.recent-search-item:hover {
    background: #e9ecef;
    transform: translateX(3px);
}

.recent-search-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    margin-right: 10px;
}

.recent-search-name {
    flex: 1;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.recent-search-time {
    font-size: 11px;
    color: #999;
    margin-left: 10px;
}

/* Responsive Design */
@media (max-width: 480px) {
    #userSearchSection {
        padding: 10px 0;
    }
    
    .searchbar {
        margin: 0 10px 10px 10px;
    }
    
    #userSearchInput {
        padding: 12px 45px 12px 40px;
        font-size: 14px;
    }
    
    .searchbar .search-icon {
        left: 12px;
        font-size: 16px;
    }
    
    .user-search-item {
        padding: 12px;
    }
    
    .user-search-avatar {
        width: 40px;
        height: 40px;
        font-size: 16px;
        margin-right: 12px;
    }
    
    .user-search-name {
        font-size: 15px;
    }
    
    .search-results-container {
        max-height: 350px;
        margin: 0 10px;
    }
}

/* Animation for individual search results */
.user-search-item {
    animation: slideInRight 0.3s ease forwards;
    opacity: 0;
    transform: translateX(10px);
}

.user-search-item:nth-child(1) { animation-delay: 0.05s; }
.user-search-item:nth-child(2) { animation-delay: 0.1s; }
.user-search-item:nth-child(3) { animation-delay: 0.15s; }
.user-search-item:nth-child(4) { animation-delay: 0.2s; }
.user-search-item:nth-child(5) { animation-delay: 0.25s; }

@keyframes slideInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Focus State Enhancement */
#userSearchInput:focus {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

/* Loading Text */
.search-loading-text {
    text-align: center;
    color: #667eea;
    font-size: 14px;
    font-weight: 500;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Error State */
.search-error {
    text-align: center;
    padding: 30px 20px;
    color: #ff3b30;
}

.search-error .f7-icons {
    font-size: 40px;
    margin-bottom: 10px;
}

.search-error h4 {
    margin-bottom: 8px;
    color: #ff3b30;
}

.search-error p {
    color: #666;
    font-size: 13px;
}
/* Add to the end of messaging.css */

/* ==================== DELETE FUNCTIONALITY STYLES ==================== */

.message-bubble {
    position: relative; /* This is crucial for absolute positioning */
}

.message-delete {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ff3b30;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 2px 6px rgba(255, 59, 48, 0.3);
    transition: all 0.2s ease;
    font-size: 12px;
    opacity: 0;
    transform: scale(0.8);
}

/* Show delete button on hover for desktop */
.message-sent:hover .message-delete {
    opacity: 1;
    transform: scale(1);
}

/* Show delete button on tap for mobile */
.message-sent .message-bubble:active .message-delete,
.message-sent .message-bubble:focus-within .message-delete {
    opacity: 1;
    transform: scale(1);
}

.message-delete:hover {
    background: #ff1a1a;
    transform: scale(1.1) !important;
    box-shadow: 0 3px 8px rgba(255, 59, 48, 0.4);
}

.message-delete:active {
    transform: scale(0.95) !important;
}

/* Make sure conversation items are properly structured */
.conversation-item {
    position: relative;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    overflow: hidden; /* Prevent overlay from spilling out */
}

.conversation-delete-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 59, 48, 0.95);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
    cursor: pointer;
    pointer-events: none;
}

.conversation-item.hold-active .conversation-delete-overlay {
    opacity: 1;
    pointer-events: auto;
}
/* ==================== DELETE CONFIRMATION & TOAST STYLES ==================== */

/* Delete Confirmation Dialog */
.delete-confirmation {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 12000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.delete-confirmation.active {
    opacity: 1;
    visibility: visible;
}

.delete-confirmation-box {
    background: white;
    border-radius: 16px;
    padding: 24px;
    max-width: 320px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.delete-confirmation.active .delete-confirmation-box {
    transform: translateY(0);
}

.delete-confirmation-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #ff3b30 0%, #ff1a1a 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
    font-size: 24px;
}

.delete-confirmation-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.delete-confirmation-message {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
    margin-bottom: 24px;
}

.delete-confirmation-buttons {
    display: flex;
    gap: 12px;
}

.delete-confirmation-buttons button {
    flex: 1;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delete-cancel-btn {
    background: #f0f0f0;
    color: #333;
}

.delete-cancel-btn:hover {
    background: #e0e0e0;
}

.delete-cancel-btn:active {
    transform: scale(0.98);
}

.delete-confirm-btn {
    background: linear-gradient(135deg, #ff3b30 0%, #ff1a1a 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 59, 48, 0.3);
}

.delete-confirm-btn:hover {
    box-shadow: 0 6px 16px rgba(255, 59, 48, 0.4);
}

.delete-confirm-btn:active {
    transform: scale(0.98);
}

/* Delete Toast */
.delete-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 11000;
    opacity: 0;
    transition: all 0.3s ease;
}

.delete-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.delete-toast.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.delete-toast.error {
    background: linear-gradient(135deg, #ff3b30 0%, #dc3545 100%);
}

.delete-toast.info {
    background: linear-gradient(135deg, #007bff 0%, #6610f2 100%);
}

/* Press & Hold Hint */
.press-hold-hint {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    z-index: 11000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.press-hold-hint.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.press-hold-icon {
    font-size: 40px;
    margin-bottom: 10px;
    color: #fff;
}

.press-hold-hint h4 {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 600;
}

.press-hold-hint p {
    margin: 0;
    font-size: 14px;
    opacity: 0.8;
}

/* Conversation Delete Overlay */
.conversation-delete-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #ff3b30 0%, #ff1a1a 100%);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 5;
    cursor: pointer;
    border-radius: 12px;
}

.conversation-item.hold-active .conversation-delete-overlay {
    opacity: 1;
    visibility: visible;
}

.conversation-delete-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.conversation-delete-text {
    font-size: 14px;
    font-weight: 500;
}

/* Deleting animation */
.message.deleting,
.conversation-item.deleting {
    animation: deletingAnimation 0.3s ease forwards;
}

@keyframes deletingAnimation {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-100%);
        height: 0;
        margin: 0;
        padding: 0;
        border: none;
    }
}
/* Add to messaging.css */

/* Messages page should take full viewport */
#messagesPage {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: white !important;
    z-index: 1001 !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Messages content area */
.messages-content {
    height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

/* Conversations list area */
.conversations-view {
    flex: 1 !important;
    overflow-y: auto !important;
    padding-bottom: 80px !important; /* Space for tab bar */
}

/* Fix conversation item styling */
.conversation-item {
    background: white !important;
    margin: 0 !important;
    padding: 15px !important;
    border-bottom: 1px solid #f0f0f0 !important;
    cursor: pointer !important;
    position: relative !important;
}

.conversation-item:hover {
    background-color: #f8f9fa !important;
}

/* Ensure no background bleed-through */
#messagesPage::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: -1;
}
