/* ======================================
   LAYOUT & SCROLLBAR FIXES
   ====================================== */

/* Fix the double scrollbar issue by creating a proper layout */
html,
body {
    height: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body.g-sidenav-show {
    overflow: auto;
    /* Changed from hidden to auto to prevent content being covered */
}

/* Main content area improvements */
.main-content {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    min-height: calc(100vh - 120px) !important;
    position: relative !important;
}

/* Container improvements for better content flow */
.container-fluid {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    padding-bottom: 2rem !important;
    /* Add bottom padding for better spacing */
}

/* Row and column improvements */
.container-fluid .row {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
}

.container-fluid .row .col-12 {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
}

/* Ad header fixes */
.ad-header {
    position: relative;
    z-index: 1000;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ad-header .container-fluid {
    height: auto !important;
    /* Override any inline height styles */
    max-height: 120px !important;
    /* Limit maximum height */
    padding: 0.5rem 1rem !important;
    overflow: hidden !important;
}

/* Sidebar fixes */
.sidenav {
    height: 100vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    z-index: 1020;
    /* Ensure sidebar is above content */
}

.sidenav .navbar-collapse {
    height: calc(100vh - 120px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Main content area fixes */
.main-content {
    position: relative !important;
    z-index: 1010 !important;
    /* Ensure content is visible */
    min-height: 100vh !important;
    overflow-y: visible !important;
    /* Changed to visible to prevent content hiding */
    overflow-x: hidden !important;
    margin-left: 17rem !important;
    padding-top: 0 !important;
    /* Remove any top padding that might hide content */
}

.main-content .container-fluid {
    position: relative !important;
    z-index: 1011 !important;
    min-height: calc(100vh - 140px) !important;
    /* Use min-height instead of height */
    height: auto !important;
    /* Allow natural height */
    overflow-y: visible !important;
    /* Allow content to be visible */
    padding-bottom: 2rem !important;
    margin-top: 0 !important;
    /* Ensure no negative margins */
}

/* Remove max-height constraints that cause double scrollbars */
.max-height-vh-100 {
    max-height: none !important;
    min-height: 100vh !important;
    /* Use min-height instead of height */
}

/* Navbar fixes to ensure it doesn't cover content */
.navbar-main {
    position: relative !important;
    /* Changed from sticky to relative */
    z-index: 1015 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    -webkit-backdrop-filter: blur(10px) !important;
            backdrop-filter: blur(10px) !important;
}

/* Fix navbar container-fluid issues */
.navbar-main .container-fluid {
    min-height: auto !important;
    height: auto !important;
    max-height: none !important;
    overflow-y: visible !important;
    position: relative !important;
    z-index: auto !important;
    padding: 0.5rem 1rem !important;
}

/* Breadcrumb specific fixes */
.breadcrumb {
    position: relative !important;
    z-index: 1020 !important;
    background: transparent !important;
    margin-bottom: 0.5rem !important;
    padding: 0 !important;
}

.breadcrumb-item {
    font-size: 0.875rem !important;
}

/* Navbar navigation fixes */
.navbar-nav {
    position: relative !important;
    z-index: 1016 !important;
}

.navbar-collapse {
    position: relative !important;
    z-index: 1016 !important;
}

/* Custom scrollbar styling for webkit browsers */
.sidenav::-webkit-scrollbar,
.main-content::-webkit-scrollbar,
.container-fluid::-webkit-scrollbar {
    width: 6px;
}

.sidenav::-webkit-scrollbar-track,
.main-content::-webkit-scrollbar-track,
.container-fluid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.sidenav::-webkit-scrollbar-thumb,
.main-content::-webkit-scrollbar-thumb,
.container-fluid::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 10px;
}

.sidenav::-webkit-scrollbar-thumb:hover,
.main-content::-webkit-scrollbar-thumb:hover,
.container-fluid::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.6);
}

/* Mobile responsive adjustments */
@media (max-width: 1199.98px) {
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    body.g-sidenav-show {
        overflow: auto;
    }

    .sidenav {
        transform: translateX(-17rem);
        transition: transform 0.3s ease;
    }

    .g-sidenav-show .sidenav {
        transform: translateX(0);
    }

    /* Mobile ad header adjustments */
    .ad-header .container-fluid {
        max-height: 80px !important;
        /* Smaller on mobile */
        padding: 0.25rem 0.5rem !important;
    }
}

@media (max-width: 767.98px) {
    .main-content .container-fluid {
        padding: 1rem;
        height: auto !important;
        overflow-y: visible !important;
    }

    /* Extra mobile ad header fixes */
    .ad-header .container-fluid {
        max-height: 60px !important;
        padding: 0.25rem !important;
    }
}

/* ======================================
   CONTENT VISIBILITY FIXES
   ====================================== */

/* Ensure all content is visible and properly positioned */
.card,
.row,
.col-12,
.alert,
.btn,
.form-group {
    position: relative !important;
    z-index: 1 !important;
}

/* Fix any potential overlay issues */
.page-header {
    position: relative !important;
    z-index: 1 !important;
    margin-bottom: 2rem;
}

/* Dashboard content fixes */
.dashboard-content {
    position: relative !important;
    z-index: 1 !important;
}

/* Profile content visibility */
.profile-content {
    position: relative !important;
    z-index: 1 !important;
    overflow: visible !important;
    height: auto !important;
}

/* Settings content visibility */
.settings-content {
    position: relative !important;
    z-index: 1 !important;
    overflow: visible !important;
    height: auto !important;
}

/* Inbox content visibility */
.inbox-content {
    position: relative !important;
    z-index: 1 !important;
    overflow: visible !important;
    height: auto !important;
}

/* Tab content visibility fixes */
.tab-content {
    position: relative !important;
    z-index: 1 !important;
    overflow: visible !important;
    height: auto !important;
    min-height: 0 !important;
}

.tab-pane {
    position: relative !important;
    z-index: 1 !important;
    overflow: visible !important;
    height: auto !important;
}

/* Form content visibility */
.form-container,
.form-group,
.input-group {
    position: relative !important;
    z-index: 1 !important;
    overflow: visible !important;
}

/* Card content fixes */
.card-body {
    position: relative !important;
    z-index: 1 !important;
    overflow: visible !important;
    height: auto !important;
}

/* Navigation breadcrumb fixes */
.breadcrumb {
    position: relative !important;
    z-index: 1020 !important;
    background: transparent !important;
    margin-bottom: 1rem !important;
}

/* ======================================
   CHART & CANVAS FIXES
   ====================================== */

/* Chart container styling */
canvas[id*="Chart"],
canvas[id*="chart"] {
    position: relative !important;
    z-index: 1 !important;
    max-width: 100% !important;
    height: auto !important;
}

/* Chart card body specific styling */
.card-body:has(canvas) {
    position: relative !important;
    z-index: 1 !important;
    overflow: visible !important;
    height: auto !important;
    min-height: 300px !important;
}

/* Ensure chart containers don't interfere with layout */
#messageChart {
    display: block !important;
    box-sizing: border-box !important;
    height: auto !important;
    width: 100% !important;
}

/* Chart card styling */
.card:has(canvas) {
    overflow: visible !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Prevent chart animation conflicts */
@media (prefers-reduced-motion: reduce) {

    canvas[id*="Chart"],
    canvas[id*="chart"] {
        -webkit-animation: none !important;
                animation: none !important;
    }
}

/* ======================================
   MODERN INBOX STYLING
   ====================================== */

/* Inbox Header */
.modern-inbox-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px !important;
}

.modern-inbox-header .card-body {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    -webkit-backdrop-filter: blur(10px);
            backdrop-filter: blur(10px);
}

/* ======================================
   COMPREHENSIVE MESSAGE CONTAINER SOLUTION
   ====================================== */

/* Reset and clean approach for message container */
.modern-messages-container {
    border-radius: 15px;
    background: #fff;
    border: 1px solid #e9ecef;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    min-height: auto !important;
}

.modern-messages-container .card-body {
    padding: 1.5rem !important;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    min-height: auto !important;
    display: block !important;
    position: relative !important;
}

/* Messages container - completely clean approach */
#messagesContainer {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    min-height: auto !important;
    display: block !important;
    position: relative !important;
    width: 100% !important;
    clear: both !important;
}

/* Remove ALL scrollbar styling globally for inbox */
.modern-messages-container,
.modern-messages-container *,
.modern-messages-container .card,
.modern-messages-container .card-body,
#messagesContainer,
#messagesContainer * {
    scrollbar-width: none !important;
    /* Firefox */
    -ms-overflow-style: none !important;
    /* IE and Edge */
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
}

/* Webkit scrollbar removal */
.modern-messages-container::-webkit-scrollbar,
.modern-messages-container *::-webkit-scrollbar,
#messagesContainer::-webkit-scrollbar,
#messagesContainer *::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Force natural document flow */
.container-fluid .row .col-12 .modern-messages-container,
.container-fluid .row .col-12 .modern-messages-container .card-body,
.container-fluid .row .col-12 #messagesContainer {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    display: block !important;
}

/* Messages list container for clean organization */
.messages-list {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    min-height: auto !important;
    display: block !important;
    position: relative !important;
    width: 100% !important;
    clear: both !important;
}

/* ======================================
   ENHANCED MESSAGE CARD STYLING
   ====================================== */

/* Individual message cards - clean production styling */
.message-card {
    border: 1px solid #e9ecef;
    border-radius: 15px;
    margin-bottom: 1.5rem !important;
    transition: all 0.3s ease;
    background: #fff;
    position: relative;
    display: block !important;
    width: 100% !important;
    overflow: visible !important;
    min-height: 120px !important;
    max-height: none !important;
    height: auto !important;
    clear: both !important;
    z-index: 1 !important;
    box-sizing: border-box !important;
    page-break-inside: avoid;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Clean production container styling */
.modern-messages-container {
    background: #fff !important;
    border: 1px solid #e9ecef !important;
    border-radius: 15px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    min-height: auto !important;
    padding: 0 !important;
}

.modern-messages-container .card-body {
    background: #fff !important;
    border: none !important;
    min-height: auto !important;
    padding: 1.5rem !important;
}

#messagesContainer {
    background: transparent !important;
    border: none !important;
    min-height: auto !important;
    padding: 0 !important;
}

.messages-list {
    background: transparent !important;
    border: none !important;
    min-height: auto !important;
    padding: 0 !important;
}

/* Pagination Styling */
.pagination {
    margin-bottom: 0;
}

.pagination .page-link {
    border-radius: 8px;
    margin: 0 2px;
    border: 1px solid #e9ecef;
    color: #495057;
}

.pagination .page-link:hover {
    background-color: #f8f9fa;
    border-color: #ddd;
}

.pagination .page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    background-color: #fff;
    border-color: #ddd;
}

/* Load More Button */
#loadMoreBtn {
    border-radius: 25px;
    padding: 8px 24px;
    font-weight: 500;
}

/* Message Container Improvements */
#messagesContainer {
    min-height: 200px;
    /* Ensure minimum space for messages */
}

/* Fix for proper message display */
.modern-messages-container .card-body {
    padding: 1rem !important;
    /* Override the p-0 to ensure proper spacing */
}

/* Message Preview Text */
.message-preview {
    line-height: 1.5;
    max-height: 3.6em;
    /* Limit to about 2-3 lines */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    word-wrap: break-word;
}

/* Message Card Content */
.message-content {
    min-height: 80px;
    /* Ensure consistent card heights */
}

.message-actions {
    margin-top: auto;
    /* Push actions to bottom of card */
}

/* Card spacing improvements */
.message-card-body {
    display: flex;
    flex-direction: column;
    min-height: 120px;
    /* Minimum card height for consistency */
    padding: 1.25rem;
    /* Consistent padding for message cards */
}

/* ======================================
   ENHANCED MESSAGE CARD STYLING
   ====================================== */

/* Individual message cards - ensure proper display */
.message-card {
    border: 1px solid #e9ecef;
    border-radius: 15px;
    margin-bottom: 1.5rem !important;
    /* Ensure clear spacing between cards */
    transition: all 0.3s ease;
    background: #fff;
    position: relative;
    display: block !important;
    /* Force block display */
    width: 100% !important;
    /* Full width */
    overflow: visible !important;
    /* Ensure content is visible */
    min-height: 120px !important;
    /* Minimum height for consistency */
    max-height: none !important;
    /* No height restrictions */
    height: auto !important;
    /* Natural height */
    clear: both !important;
    /* Clear any floats */
}

.message-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.message-card.unread-message {
    border-left: 4px solid #ffd700;
    background: linear-gradient(90deg, #fffbf0 0%, #fff 50%);
}

.message-card-body {
    padding: 1.25rem !important;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    display: block !important;
    position: relative !important;
    width: 100% !important;
}

/* Ensure proper spacing and flow for card content */
.message-card .d-flex {
    display: flex !important;
    align-items: flex-start !important;
    width: 100% !important;
    overflow: visible !important;
}

.message-content {
    flex: 1 !important;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
}

.message-preview {
    color: #6c757d;
    line-height: 1.5;
    font-size: 0.95rem;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    word-wrap: break-word !important;
    white-space: normal !important;
}

.message-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
    overflow: visible !important;
}

.message-actions .btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
    border-width: 1px;
    min-width: 70px;
    text-align: center;
}

/* Enhanced button styling for better visibility */
.message-actions .btn-outline-primary {
    color: #0d6efd !important;
    border-color: #0d6efd !important;
    background-color: rgba(13, 110, 253, 0.1) !important;
    text-decoration: none !important;
}

.message-actions .btn-outline-primary:hover,
.message-actions .btn-outline-primary:focus {
    color: #fff !important;
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    text-decoration: none !important;
}

.message-actions .btn-outline-success {
    color: #198754 !important;
    border-color: #198754 !important;
    background-color: rgba(25, 135, 84, 0.1) !important;
    text-decoration: none !important;
}

.message-actions .btn-outline-success:hover,
.message-actions .btn-outline-success:focus {
    color: #fff !important;
    background-color: #198754 !important;
    border-color: #198754 !important;
    text-decoration: none !important;
}

.message-actions .btn-outline-danger {
    color: #dc3545 !important;
    border-color: #dc3545 !important;
    background-color: rgba(220, 53, 69, 0.1) !important;
    text-decoration: none !important;
}

.message-actions .btn-outline-danger:hover,
.message-actions .btn-outline-danger:focus {
    color: #fff !important;
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    text-decoration: none !important;
}

/* Icon fallbacks for better UX */
.btn i.fas::before,
.btn i.fa::before {
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", "FontAwesome", sans-serif;
    font-weight: 900;
}

/* Fallback text for buttons if icons don't load */
.btn[class*="fa-eye"]::after {
    content: attr(data-fallback, "View");
}

.btn[class*="fa-check"]::after {
    content: attr(data-fallback, "Mark Read");
}

.btn[class*="fa-trash"]::after {
    content: attr(data-fallback, "Delete");
}

/* Ensure buttons are visible even without icons */
.message-actions .btn {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    position: relative !important;
    z-index: 100 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    border: 1px solid !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Force button container visibility */
.message-actions {
    position: relative !important;
    z-index: 99 !important;
    display: flex !important;
    gap: 0.5rem !important;
    flex-wrap: wrap !important;
    margin-top: 0.75rem !important;
    overflow: visible !important;
    pointer-events: auto !important;
}

/* Message card components */
.message-checkbox input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(45deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
    /* Prevent avatar from shrinking */
}

/* Message Share Card for Image Generation */
.message-share-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 2rem;
    color: white;
    font-family: 'Arial', sans-serif;
    position: relative;
    overflow: hidden;
}

.message-share-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.message-share-card .message-header {
    position: relative;
    z-index: 2;
}

.message-share-card .message-avatar {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    -webkit-backdrop-filter: blur(10px);
            backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.message-bubble {
    background: rgba(255, 255, 255, 0.15);
    -webkit-backdrop-filter: blur(10px);
            backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 1.5rem;
    margin: 1rem 0;
    position: relative;
    z-index: 2;
}

.message-bubble p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 0;
}

.message-footer {
    position: relative;
    z-index: 2;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 1rem;
    margin-top: 1rem;
}

/* Floating Action Buttons */
.floating-actions {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.fab-container {
    position: relative;
}

.fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.fab-main {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    font-size: 1.5rem;
}

.fab-main.active {
    transform: rotate(45deg);
}

.fab-action {
    background: white;
    color: #667eea;
    opacity: 0;
    transform: scale(0);
    position: absolute;
    right: 0;
}

.fab-action.show {
    opacity: 1;
    transform: scale(1);
}

.fab-action:nth-child(2) {
    bottom: 70px;
    transition-delay: 0.1s;
}

.fab-action:nth-child(3) {
    bottom: 130px;
    transition-delay: 0.2s;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* Filter Section */
.form-select-sm {
    border-radius: 8px;
    border: 1px solid #e9ecef;
    font-size: 0.9rem;
}

.form-select-sm:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Button Groups */
.btn-group .btn {
    border-radius: 8px !important;
}

.btn-group .btn:first-child {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.btn-group .btn:last-child {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

/* Modal Enhancements */
.modal {
    z-index: 999999 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    pointer-events: auto !important;
}

.modal.show {
    display: flex !important;
    pointer-events: auto !important;
    z-index: 999999 !important;
}

.modal-backdrop {
    display: none !important;
    pointer-events: none !important;
}

.modal-dialog {
    position: relative !important;
    z-index: 1000000 !important;
    margin: 1rem auto !important;
    max-width: 90% !important;
    max-height: 90vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: auto !important;
}

.modal-dialog.modal-dialog-centered {
    display: flex !important;
    align-items: center !important;
    min-height: calc(100vh - 2rem) !important;
    pointer-events: auto !important;
    z-index: 1000000 !important;
}

.modal-content {
    border-radius: 15px;
    overflow: hidden;
    position: relative !important;
    z-index: 1000001 !important;
    pointer-events: auto !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2) !important;
    border: none !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    background: #ffffff !important;
}

.modal-header.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    position: relative !important;
    z-index: 10002 !important;
    color: #ffffff !important;
}

.modal-header h5 {
    color: #ffffff !important;
    font-weight: 600 !important;
}

.modal-body {
    position: relative !important;
    z-index: 10002 !important;
    background: #ffffff !important;
    padding: 2rem !important;
}

.modal-footer {
    background: #f8f9fa !important;
    position: relative !important;
    z-index: 10002 !important;
    border-top: 1px solid #dee2e6 !important;
}

/* Message Content Card Styling */
.message-share-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border-radius: 12px !important;
    padding: 1.5rem !important;
    border: 1px solid #dee2e6 !important;
}

.message-share-card .message-header {
    margin-bottom: 1.5rem !important;
}

.message-share-card .message-avatar {
    width: 50px !important;
    height: 50px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #ffffff !important;
    font-size: 1.2rem !important;
}

.message-share-card .message-content {
    margin: 1.5rem 0 !important;
}

.message-share-card .message-bubble {
    background: #ffffff !important;
    border-radius: 12px !important;
    padding: 1.5rem !important;
    border: 1px solid #e9ecef !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

.message-share-card .message-bubble p {
    color: #212529 !important;
    font-size: 1.1rem !important;
    line-height: 1.6 !important;
    margin: 0 !important;
}

/* Enhanced Button Styling for Message Cards */
.message-actions {
    display: flex !important;
    gap: 0.5rem !important;
    flex-wrap: wrap !important;
    margin-top: 1rem !important;
    position: relative !important;
    z-index: 100 !important;
}

.message-actions .btn {
    position: relative !important;
    z-index: 101 !important;
    pointer-events: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    font-size: 0.875rem !important;
    padding: 0.375rem 0.75rem !important;
    border-width: 1px !important;
    border-style: solid !important;
    border-radius: 0.375rem !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: all 0.15s ease-in-out !important;
    background-color: transparent !important;
    color: inherit !important;
}

.message-actions .btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
}

.message-actions .btn-outline-primary {
    color: #0d6efd !important;
    border-color: #0d6efd !important;
    background-color: transparent !important;
}

.message-actions .btn-outline-primary:hover {
    color: #fff !important;
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
}

.message-actions .btn-outline-success {
    color: #198754 !important;
    border-color: #198754 !important;
    background-color: transparent !important;
}

.message-actions .btn-outline-success:hover {
    color: #fff !important;
    background-color: #198754 !important;
    border-color: #198754 !important;
}

.message-actions .btn-outline-danger {
    color: #dc3545 !important;
    border-color: #dc3545 !important;
    background-color: transparent !important;
}

.message-actions .btn-outline-danger:hover {
    color: #fff !important;
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
}

.message-actions .btn i {
    margin-right: 0.25rem !important;
}

/* Message Card Enhancements */
.message-card {
    background: #ffffff !important;
    border: 1px solid #e9ecef !important;
    border-radius: 12px !important;
    margin-bottom: 1rem !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
    position: relative !important;
    z-index: 1 !important;
}

.message-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-2px) !important;
}

.message-card-body {
    padding: 1.5rem !important;
    position: relative !important;
    z-index: 2 !important;
}

.message-card.unread-message {
    border-left: 4px solid #ffc107 !important;
    background: linear-gradient(to right, #fff9e6, #ffffff) !important;
}

/* Force button visibility and clickability */
.message-actions .btn,
.message-actions button,
button.view-message,
button.mark-read,
button.delete-message {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 1000 !important;
    position: relative !important;
    min-height: 32px !important;
    min-width: 60px !important;
}

/* Clean Message Action Buttons */
.message-actions .btn {
    position: relative !important;
    z-index: 100 !important;
    pointer-events: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    font-size: 0.875rem !important;
    padding: 0.375rem 0.75rem !important;
    border-width: 1px !important;
    border-style: solid !important;
    border-radius: 0.375rem !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: all 0.15s ease-in-out !important;
}

.message-actions .btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
}

.message-actions .btn-outline-primary {
    color: #0d6efd !important;
    border-color: #0d6efd !important;
    background-color: transparent !important;
}

.message-actions .btn-outline-primary:hover {
    color: #fff !important;
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
}

.message-actions .btn-outline-success {
    color: #198754 !important;
    border-color: #198754 !important;
    background-color: transparent !important;
}

.message-actions .btn-outline-success:hover {
    color: #fff !important;
    background-color: #198754 !important;
    border-color: #198754 !important;
}

.message-actions .btn-outline-danger {
    color: #dc3545 !important;
    border-color: #dc3545 !important;
    background-color: transparent !important;
}

.message-actions .btn-outline-danger:hover {
    color: #fff !important;
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
}

.message-actions .btn i {
    margin-right: 0.25rem !important;
}

/* Professional Modal Buttons */
#viewMessageModal .btn,
#viewMessageModal button,
#downloadImageBtn,
#markAsReadBtn,
#deleteMessageBtn,
.modal-footer .btn {
    pointer-events: auto !important;
    z-index: 1000002 !important;
    position: relative !important;
    cursor: pointer !important;
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Professional close button */
.btn-close,
.modal-header .btn-close {
    pointer-events: auto !important;
    z-index: 1000003 !important;
    position: relative !important;
    cursor: pointer !important;
    opacity: 1 !important;
}

/* Ensure modal content is always on top */
.modal-header,
.modal-body,
.modal-footer {
    z-index: 1000001 !important;
    position: relative !important;
    pointer-events: auto !important;
}

/* Enhanced Button Styling for Message Cards */
.message-actions {
    display: flex !important;
    gap: 0.5rem !important;
    flex-wrap: wrap !important;
    margin-top: 1rem !important;
    position: relative !important;
    z-index: 100 !important;
}

.message-actions .btn {
    position: relative !important;
    z-index: 101 !important;
    pointer-events: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    font-size: 0.875rem !important;
    padding: 0.375rem 0.75rem !important;
    border-width: 1px !important;
    border-style: solid !important;
    border-radius: 0.375rem !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: all 0.15s ease-in-out !important;
}

.message-actions .btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
}

.message-actions .btn-outline-primary {
    color: #0d6efd !important;
    border-color: #0d6efd !important;
    background-color: transparent !important;
}

.message-actions .btn-outline-primary:hover {
    color: #fff !important;
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
}

.message-actions .btn-outline-success {
    color: #198754 !important;
    border-color: #198754 !important;
    background-color: transparent !important;
}

.message-actions .btn-outline-success:hover {
    color: #fff !important;
    background-color: #198754 !important;
    border-color: #198754 !important;
}

.message-actions .btn-outline-danger {
    color: #dc3545 !important;
    border-color: #dc3545 !important;
    background-color: transparent !important;
}

.message-actions .btn-outline-danger:hover {
    color: #fff !important;
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
}

.message-actions .btn i {
    margin-right: 0.25rem !important;
}

/* Message Card Enhancements */
.message-card {
    background: #ffffff !important;
    border: 1px solid #e9ecef !important;
    border-radius: 12px !important;
    margin-bottom: 1rem !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

.message-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-2px) !important;
}

.message-card-body {
    padding: 1.5rem !important;
}

.message-card.unread-message {
    border-left: 4px solid #ffc107 !important;
    background: linear-gradient(to right, #fff9e6, #ffffff) !important;
}

/* Specific fixes for viewMessageModal */
#viewMessageModal {
    z-index: 999999 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
}

#viewMessageModal.show {
    display: flex !important;
}

#viewMessageModal .modal-dialog {
    margin: 0 auto !important;
    transform: none !important;
    position: relative !important;
    z-index: 10000 !important;
}

#viewMessageModal .modal-content {
    position: relative !important;
    z-index: 10001 !important;
    border: none !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3) !important;
}

/* Override any conflicting z-index from sidenav or other elements */
.sidenav,
.navbar,
.main-content,
.ad-header {
    z-index: 1020 !important;
}

/* Ensure modal is above everything */
.modal,
.modal-backdrop {
    z-index: 9999 !important;
}

/* Loading Spinner */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Empty State */
#noMessages i {
    opacity: 0.6;
}

/* ======================================
   MOBILE RESPONSIVE ENHANCEMENTS
   ====================================== */

@media (max-width: 768px) {
    .message-card {
        margin: 0.25rem;
    }

    .message-card-body {
        padding: 0.75rem;
    }

    .message-avatar {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .message-actions {
        justify-content: start;
    }

    .message-actions .btn {
        font-size: 0.75rem;
        padding: 0.2rem 0.6rem;
    }

    .modal-dialog {
        margin: 0.5rem;
    }

    .message-share-card {
        padding: 1.5rem;
        font-size: 0.9rem;
    }

    .modal-footer .btn {
        font-size: 0.85rem;
        padding: 0.5rem;
    }

    .fab {
        width: 48px;
        height: 48px;
        font-size: 1rem;
    }

    .fab-main {
        font-size: 1.3rem;
    }
}

@media (max-width: 576px) {
    .modern-inbox-header .row>div {
        text-align: center;
    }

    .modern-inbox-header .row>div:first-child {
        margin-bottom: 1rem;
    }

    .message-card-body {
        padding: 0.5rem;
    }

    .message-preview {
        font-size: 0.9rem;
    }

    .floating-actions {
        bottom: 1rem;
        right: 1rem;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .message-card {
        border: 2px solid #000;
    }

    .message-card.unread-message {
        border-left: 6px solid #000;
    }

    .fab {
        border: 2px solid #000;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    .message-card,
    .fab,
    .message-actions .btn {
        transition: none;
    }

    .message-card:hover,
    .fab:hover {
        transform: none;
    }
}

/* Print styles */
@media print {

    .floating-actions,
    .message-actions,
    .modal,
    .fab-container {
        display: none !important;
    }

    .message-card {
        -moz-column-break-inside: avoid;
             break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* ======================================
   ACCESSIBILITY IMPROVEMENTS
   ====================================== */

.message-select:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.fab:focus,
.message-actions .btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Screen reader only text */
.sr-only-inbox {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ======================================
   PERFORMANCE OPTIMIZATIONS
   ====================================== */

.modern-messages-container {
    will-change: scroll-position;
}

.message-card {
    will-change: transform;
}

.fab {
    will-change: transform;
}

/* ======================================
   CONTENT VISIBILITY FIXES
   ====================================== */

/* Ensure all content is visible and properly positioned */
.card,
.row,
.col-12,
.alert,
.btn,
.form-group {
    position: relative !important;
    z-index: 1 !important;
}

/* Fix any potential overlay issues */
.page-header {
    position: relative !important;
    z-index: 1 !important;
    margin-bottom: 2rem;
}

/* Dashboard content fixes */
.dashboard-content {
    position: relative !important;
    z-index: 1 !important;
}

/* Profile content visibility */
.profile-content {
    position: relative !important;
    z-index: 1 !important;
    overflow: visible !important;
    height: auto !important;
}

/* Settings content visibility */
.settings-content {
    position: relative !important;
    z-index: 1 !important;
    overflow: visible !important;
    height: auto !important;
}

/* Inbox content visibility */
.inbox-content {
    position: relative !important;
    z-index: 1 !important;
    overflow: visible !important;
    height: auto !important;
}

/* Tab content visibility fixes */
.tab-content {
    position: relative !important;
    z-index: 1 !important;
    overflow: visible !important;
    height: auto !important;
    min-height: 0 !important;
}

.tab-pane {
    position: relative !important;
    z-index: 1 !important;
    overflow: visible !important;
    height: auto !important;
}

/* Form content visibility */
.form-container,
.form-group,
.input-group {
    position: relative !important;
    z-index: 1 !important;
    overflow: visible !important;
}

/* Card content fixes */
.card-body {
    position: relative !important;
    z-index: 1 !important;
    overflow: visible !important;
    height: auto !important;
}

/* Navigation breadcrumb fixes */
.breadcrumb {
    position: relative !important;
    z-index: 1020 !important;
    background: transparent !important;
    margin-bottom: 1rem !important;
}

/* ======================================
   DASHBOARD UX ENHANCEMENTS
   ====================================== */

/* Welcome Banner */
.gradient-welcome-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 1rem !important;
    overflow: hidden;
}

.welcome-content h2 {
    font-size: 1.75rem;
    line-height: 1.4;
}

.welcome-illustration {
    -webkit-animation: float 3s ease-in-out infinite;
            animation: float 3s ease-in-out infinite;
}

@-webkit-keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Modern Stat Cards */
.modern-stat-card {
    border: none !important;
    border-radius: 1rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: blur(10px);
            backdrop-filter: blur(10px);
}

.modern-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

.modern-stat-card .icon {
    transition: all 0.3s ease;
}

.modern-stat-card:hover .icon {
    transform: scale(1.1) rotate(5deg);
}

/* Counter Animation */
.counter {
    display: inline-block;
    transition: all 0.3s ease;
}

/* Modern Link Card */
.modern-link-card {
    border-radius: 1rem !important;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.95), rgba(248, 249, 250, 0.95));
    -webkit-backdrop-filter: blur(10px);
            backdrop-filter: blur(10px);
}

.modern-input-group {
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.modern-input-group .input-group-text,
.modern-input-group .form-control {
    border: none;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.75rem 1rem;
}

.modern-input-group .form-control:focus {
    box-shadow: none;
    background: white;
}

.qr-placeholder {
    border: 2px dashed #dee2e6;
    transition: all 0.3s ease;
}

.qr-placeholder:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05) !important;
}

/* Quick Actions Card */
.quick-actions-card {
    border-radius: 1rem !important;
}

.quick-actions-card .btn {
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.quick-actions-card .btn:hover {
    transform: translateX(5px);
}

/* Modern Messages Card */
.modern-messages-card {
    border-radius: 1rem !important;
}

.message-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 0;
    transition: all 0.3s ease;
}

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

.message-item:hover {
    background: rgba(102, 126, 234, 0.02);
    border-radius: 0.5rem;
    padding-left: 1rem;
    padding-right: 1rem;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(45deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-right: 1rem;
    flex-shrink: 0;
}

.message-content {
    min-width: 0;
}

.message-text {
    line-height: 1.5;
    color: #344767;
}

.message-actions {
    opacity: 1 !important;
    transition: opacity 0.3s ease;
}

.message-item:hover .message-actions {
    opacity: 1;
}

.message-actions .btn {
    padding: 0.25rem 0.5rem;
    margin-left: 0.25rem;
}

/* Empty State */
.empty-state {
    color: #6c757d;
}

.empty-state-icon {
    opacity: 0.5;
}

/* Modern Chart Card */
.modern-chart-card {
    border-radius: 1rem !important;
}

.chart-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

/* Modern Actions Card */
.modern-actions-card {
    border-radius: 1rem !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 250, 0.95) 100%);
}

.action-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.action-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: rgba(102, 126, 234, 0.2);
    background: white !important;
}

.action-icon {
    transition: all 0.3s ease;
}

.action-item:hover .action-icon i {
    transform: scale(1.1);
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    -webkit-animation: fadeInUp 0.6s ease-out forwards;
            animation: fadeInUp 0.6s ease-out forwards;
}

@-webkit-keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    -webkit-animation: fadeInUp 0.6s ease-out;
            animation: fadeInUp 0.6s ease-out;
}

/* Notification Toast */
.notification-toast {
    border-radius: 0.75rem;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

@-webkit-keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

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

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

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

@-webkit-keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .welcome-content h2 {
        font-size: 1.5rem;
    }

    .modern-stat-card:hover {
        transform: none;
    }

    .action-item:hover {
        transform: none;
    }

    .message-actions {
        opacity: 1;
    }

    .modern-input-group .form-control {
        font-size: 0.875rem;
    }
}

@media (max-width: 576px) {
    .welcome-content h2 {
        font-size: 1.25rem;
    }

    .modern-actions-card .row>div {
        margin-bottom: 1rem;
    }

    .action-item {
        padding: 1.5rem !important;
    }
}

/* ======================================
   PROFILE UX ENHANCEMENTS
   ====================================== */

/* Profile and settings pages specific fixes */
.page-header {
    margin-bottom: 2rem;
}

.card {
    margin-bottom: 1.5rem;
}

/* Form optimizations */
.form-group {
    margin-bottom: 1.5rem;
}

.tab-content {
    overflow: visible !important;
    height: auto !important;
}

/* Remove any conflicting height constraints on cards */
.card-body {
    overflow: visible !important;
    height: auto !important;
}

/* Navigation fixes */
.navbar-main {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1020 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    -webkit-backdrop-filter: blur(10px) !important;
            backdrop-filter: blur(10px) !important;
}

/* Footer adjustments */
.footer {
    margin-top: auto;
    position: relative;
}

/* Social Icons Styling */
.social-icons-container {
    gap: 1rem;
}

.social-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    transition: all 0.3s ease;
    text-decoration: none;
    background: rgba(108, 117, 125, 0.1);
}

.social-icon:hover {
    transform: translateY(-3px);
    background-color: rgba(0, 123, 255, 0.15);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
}

.social-icon span {
    font-size: 1.4rem !important;
}

/* Ensure flex container works properly */
.social-icons-container {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
}

/* Prevent social icons from breaking lines unnecessarily */
.social-icons-container .social-icon {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Force display inline-block as backup */
.footer a[class*="social-icon"],
.footer .social-icon {
    display: inline-block !important;
}

/* Alternative approach for mobile */
@media (max-width: 768px) {
    .social-icons-container {
        gap: 0.75rem;
    }

    .social-icon {
        width: 40px;
        height: 40px;
    }

    .social-icon span {
        font-size: 1.2rem !important;
    }
}

/* ======================================
   PROFESSIONAL ENHANCEMENTS
   ====================================== */

/* Smooth transitions for better UX */
.main-content,
.sidenav {
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Enhanced focus states for accessibility */
.nav-link:focus,
.btn:focus,
.form-control:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
}

/* Loading states */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    -webkit-animation: loading-sweep 1.5s infinite;
            animation: loading-sweep 1.5s infinite;
}

@-webkit-keyframes loading-sweep {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

@keyframes loading-sweep {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* Professional shadow system */
.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Modern button styling */
.btn {
    font-weight: 600;
    letter-spacing: 0.025em;
    transition: all 0.15s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

/* Enhanced table responsiveness */
.table-responsive {
    border-radius: 0.75rem;
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

/* Modern alert styling */
.alert {
    border: none;
    border-radius: 0.75rem;
    font-weight: 500;
}

/* ======================================
   ACCESSIBILITY IMPROVEMENTS
   ====================================== */

/* High contrast mode support */
@media (prefers-contrast: high) {

    .nav-link,
    .btn {
        border: 1px solid currentColor;
    }

    .card {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        -webkit-animation-duration: 0.01ms !important;
                animation-duration: 0.01ms !important;
        -webkit-animation-iteration-count: 1 !important;
                animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Screen reader only text */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ======================================
   UTILITY CLASSES
   ====================================== */

/* Spacing utilities for consistent layout */
.section-padding {
    padding: 2rem 0;
}

.content-spacing {
    margin-bottom: 2rem;
}

.no-scroll {
    overflow: hidden !important;
}

/* Container adjustments for single scroll */
.single-scroll-container {
    height: calc(100vh - 140px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 1rem;
}

/* Form container optimizations */
.form-container {
    max-width: 100%;
    overflow: visible;
}

.form-container .row {
    margin-bottom: 1.5rem;
}

/* Card enhancements for better spacing */
.enhanced-card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    overflow: visible;
}

.enhanced-card .card-body {
    padding: 2rem;
    overflow: visible;
}

/* Tab content optimizations */
.tab-content-optimized {
    overflow: visible !important;
    height: auto !important;
    min-height: 0 !important;
}

.tab-content-optimized .tab-pane {
    overflow: visible !important;
    height: auto !important;
}

/* Profile page specific fixes */
.profile-content {
    overflow: visible !important;
    height: auto !important;
}

.profile-tabs {
    overflow: visible !important;
}

/* Settings page optimizations */
.settings-container {
    overflow: visible !important;
    height: auto !important;
}

.settings-form {
    overflow: visible !important;
}

/* Alert enhancements */
.alert-modern {
    border: none;
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
}

/* Button group enhancements */
.btn-group-modern .btn {
    border-radius: 0.5rem !important;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.btn-group-modern .btn:last-child {
    margin-right: 0;
}

/* ======================================
   RESPONSIVE LAYOUT ENHANCEMENTS
   ====================================== */

/* Responsive spacing */
@media (max-width: 768px) {
    .section-padding {
        padding: 1rem 0;
    }

    .enhanced-card .card-body {
        padding: 1.5rem;
    }

    .single-scroll-container {
        height: auto;
        overflow: visible;
        padding-right: 0;
    }
}

@media (max-width: 576px) {
    .section-padding {
        padding: 0.75rem 0;
    }

    .enhanced-card .card-body {
        padding: 1rem;
    }

    .content-spacing {
        margin-bottom: 1rem;
    }
}

/* Landscape tablet adjustments */
@media (min-width: 768px) and (max-width: 1199px) and (orientation: landscape) {
    .single-scroll-container {
        height: calc(100vh - 120px);
    }
}

/* ======================================
   PERFORMANCE OPTIMIZATIONS
   ====================================== */

/* GPU acceleration for smooth scrolling */
.main-content,
.sidenav,
.container-fluid {
    transform: translateZ(0);
    will-change: scroll-position;
}

/* Optimize images for performance */
img {
    max-width: 100%;
    height: auto;
}

/* Reduce paint complexity */
.card,
.btn,
.alert {
    contain: layout style paint;
}

/* ======================================
   DARK MODE SUPPORT (Future Enhancement)
   ====================================== */

@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a1a1a;
        --bg-secondary: #2d2d2d;
        --text-primary: #ffffff;
        --text-secondary: #cccccc;
        --border-color: #404040;
    }

    /* Dark mode implementations can be added here */
}

/* ======================================
   PRINT STYLES
   ====================================== */

@media print {

    .sidenav,
    .navbar-main,
    .footer,
    .btn,
    .floating-actions {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }

    .card {
        -moz-column-break-inside: avoid;
             break-inside: avoid;
        page-break-inside: avoid;
    }

    body {
        background: white !important;
        color: black !important;
    }
}

/* ======================================
   FLOATING ACTION BUTTON
   ====================================== */
.floating-action-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.floating-action-btn .btn {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-animation: pulse 2s infinite;
            animation: pulse 2s infinite;
}

@-webkit-keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 215, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 215, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
}

/* ======================================
   ENHANCED ANIMATIONS
   ====================================== */
.animate-fade-in {
    -webkit-animation: fadeInUp 0.8s ease-out forwards;
            animation: fadeInUp 0.8s ease-out forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-in-left {
    -webkit-animation: slideInLeft 0.8s ease-out forwards;
            animation: slideInLeft 0.8s ease-out forwards;
}

@-webkit-keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

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

.animate-slide-in-right {
    -webkit-animation: slideInRight 0.8s ease-out forwards;
            animation: slideInRight 0.8s ease-out forwards;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

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

/* Staggered animations */
.step-card:nth-child(1) {
    -webkit-animation-delay: 0.1s;
            animation-delay: 0.1s;
}

.step-card:nth-child(2) {
    -webkit-animation-delay: 0.2s;
            animation-delay: 0.2s;
}

.step-card:nth-child(3) {
    -webkit-animation-delay: 0.3s;
            animation-delay: 0.3s;
}

.feature-card:nth-child(1) {
    -webkit-animation-delay: 0.1s;
            animation-delay: 0.1s;
}

.feature-card:nth-child(2) {
    -webkit-animation-delay: 0.2s;
            animation-delay: 0.2s;
}

.feature-card:nth-child(3) {
    -webkit-animation-delay: 0.3s;
            animation-delay: 0.3s;
}

.feature-card:nth-child(4) {
    -webkit-animation-delay: 0.4s;
            animation-delay: 0.4s;
}

/* Loading states */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    -webkit-animation: loading 1.5s infinite;
            animation: loading 1.5s infinite;
}

@-webkit-keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Enhanced hover effects */
.hover-lift {
    transition: all 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
}

/* Scroll animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ======================================
   ACCESSIBILITY IMPROVEMENTS
   ====================================== */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Focus states */
.btn:focus,
.form-control:focus,
.nav-link:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode adjustments */
@media (prefers-contrast: high) {

    .step-card,
    .feature-card,
    .message-form-card {
        border: 2px solid #000;
    }

    .btn {
        border: 2px solid #000;
    }
}

/* ======================================
   PRINT OPTIMIZATIONS
   ====================================== */
@media print {

    .floating-action-btn,
    .navbar,
    .btn,
    .hero-section {
        display: none !important;
    }

    .step-card,
    .feature-card {
        -moz-column-break-inside: avoid;
             break-inside: avoid;
        page-break-inside: avoid;
    }

    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}

/* ======================================
   PERFORMANCE OPTIMIZATIONS
   ====================================== */
.will-change-transform {
    will-change: transform;
}

.gpu-accelerated {
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
    perspective: 1000;
}

/* ======================================
   NAVIGATION ENHANCEMENTS
   ====================================== */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 800 !important;
    text-decoration: none;
}

.navbar-brand:hover {
    text-decoration: none;
    color: #ffd700 !important;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 0 0.25rem;
}

.navbar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.btn-warning {
    background: linear-gradient(45deg, #ffd700, #ffed4e) !important;
    border: none !important;
    color: #000 !important;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.4);
    color: #000 !important;
}

/* Navbar toggler styling */
.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    margin: 4px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* Mobile menu improvements */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: rgba(0, 0, 0, 0.9);
        -webkit-backdrop-filter: blur(10px);
                backdrop-filter: blur(10px);
        border-radius: 15px;
        margin-top: 1rem;
        padding: 1rem;
    }

    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        margin: 0.25rem 0;
    }
}

/* ======================================
   MODERN LANDING PAGE & MESSAGE INTERFACE
   ====================================== */

/* ======================================
   HERO SECTION ENHANCEMENTS
   ====================================== */
.hero-section {
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.7) 100%);
    z-index: 1;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.gradient-text {
    background: linear-gradient(45deg, #ffd700, #ffed4e, #fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    font-weight: 300;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.cta-button {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    border: none;
    border-radius: 50px;
    padding: 15px 30px;
    font-weight: 600;
    font-size: 1.1rem;
    color: #000;
    transition: all 0.3s ease;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(255, 215, 0, 0.4);
    color: #000;
}

.cta-button-secondary {
    border: 2px solid #fff;
    border-radius: 50px;
    padding: 13px 28px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.cta-button-secondary:hover {
    background: #fff;
    color: #000;
    transform: translateY(-3px);
}

.stats-section {
    margin-top: 3rem;
}

.stat-item {
    padding: 1rem;
}

.counter {
    font-size: 2.5rem;
    font-weight: 800;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* ======================================
   MODERN CARDS & SECTIONS
   ====================================== */
.modern-card {
    border: none;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(10px);
            backdrop-filter: blur(10px);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.step-card {
    background: #fff;
    border-radius: 15px;
    padding: 2rem 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.step-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.step-number {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.step-icon {
    transition: all 0.3s ease;
}

.step-card:hover .step-icon {
    transform: scale(1.1);
}

/* ======================================
   FEATURES SECTION
   ====================================== */
.features-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.feature-card {
    background: #fff;
    border-radius: 15px;
    padding: 2rem 1.5rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.feature-card:hover::before {
    left: 100%;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.feature-icon-wrapper {
    margin-bottom: 1rem;
}

.feature-icon {
    transition: all 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
}

.cta-section {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 20px;
    padding: 3rem 2rem;
    color: white;
    text-align: center;
}

.cta-section h3 {
    color: white;
    font-weight: 700;
}

.cta-section .btn-primary {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    border: none;
    color: #000;
    font-weight: 600;
}

/* ======================================
   MESSAGE INTERFACE STYLING
   ====================================== */
.message-header {
    margin-bottom: 2rem;
}

.user-avatar-wrapper {
    display: flex;
    justify-content: center;
}

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(45deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.message-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
}

.message-subtitle {
    font-size: 1.1rem;
}

.message-form-card {
    border: none;
    border-radius: 20px;
    background: #fff;
    position: relative;
    overflow: hidden;
}

.message-form-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(45deg, #667eea, #764ba2, #ffd700);
}

.message-textarea {
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 1rem;
    font-size: 1rem;
    line-height: 1.6;
    transition: all 0.3s ease;
    resize: vertical;
    min-height: 150px;
}

.message-textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    outline: none;
}

.send-button {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border: none;
    border-radius: 50px;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.send-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.send-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.signup-encouragement .card {
    border-radius: 15px;
    transition: all 0.3s ease;
}

.signup-encouragement .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

/* Ad Placement Styling */
.ad-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 10px 0;
    text-align: center;
}

.ad-footer {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 20px 0;
    text-align: center;
}

.ad-content {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    transition: all 0.3s ease;
}

.ad-content:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* ======================================
   REGISTRATION MODAL STYLING
   ====================================== */
#registrationModal .modal-content {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

#registrationModal .modal-header {
    border-radius: 15px 15px 0 0;
    border-bottom: none;
    padding: 1.5rem 2rem;
}

#registrationModal .modal-body {
    padding: 2rem;
}

#registrationModal .modal-footer {
    border-top: none;
    border-radius: 0 0 15px 15px;
    padding: 1rem 2rem;
}

#registrationModal .btn-primary {
    background: linear-gradient(45deg, #cb0c9f, #e91e63);
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    font-weight: 600;
    transition: all 0.3s ease;
}

#registrationModal .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(203, 12, 159, 0.3);
}

#registrationModal .btn-outline-secondary {
    border-radius: 25px;
    padding: 12px 24px;
    font-weight: 600;
    transition: all 0.3s ease;
}

#registrationModal .feature-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Animation for modal appearance */
#registrationModal.fade .modal-dialog {
    transition: transform 0.4s ease-out;
    transform: translate(0, -50px);
}

#registrationModal.show .modal-dialog {
    transform: translate(0, 0);
}

.ad-sidebar {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    text-align: center;
    position: -webkit-sticky;
    position: sticky;
    top: 20px;
}

.ad-between-messages td {
    background: #f8f9fa !important;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

/* ======================================
   RESPONSIVE DESIGN
   ====================================== */

/* Mobile First Approach - Small devices (landscape phones, 576px and up) */
@media (max-width: 575.98px) {
    .hero-title {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .cta-button,
    .cta-button-secondary {
        font-size: 1rem;
        padding: 12px 25px;
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .stats-section {
        margin-top: 2rem;
    }

    .counter {
        font-size: 2rem;
    }

    .step-card,
    .feature-card {
        padding: 1.5rem 1rem;
        margin-bottom: 1rem;
    }

    .message-title {
        font-size: 1.5rem;
    }

    .user-avatar {
        width: 60px;
        height: 60px;
    }

    .user-avatar i {
        font-size: 1.5rem;
    }

    .message-form-card .card-body {
        padding: 1.5rem !important;
    }

    .cta-section {
        padding: 2rem 1rem;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .hero-title {
        font-size: 2.2rem;
    }

    .section-title {
        font-size: 2.2rem;
    }

    .step-card,
    .feature-card {
        margin-bottom: 1.5rem;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .hero-title {
        font-size: 2.4rem;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .hero-title {
        font-size: 3rem;
    }

    .section-title {
        font-size: 2.8rem;
    }
}

/* Responsive ad adjustments */
@media (max-width: 768px) {
    .ad-sidebar {
        margin-top: 10px;
        position: static;
    }

    .ad-content {
        padding: 15px;
        margin: 15px 0;
    }

    .page-header {
        margin-left: 1rem !important;
        margin-right: 1rem !important;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {

    .step-card:hover,
    .feature-card:hover,
    .message-form-card:hover {
        transform: none;
    }

    .step-card:active,
    .feature-card:active {
        transform: scale(0.98);
    }

    .cta-button:active,
    .send-button:active {
        transform: scale(0.95);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .gradient-text {
        -webkit-text-fill-color: #ffd700;
        color: #ffd700;
    }

    .section-title {
        -webkit-text-fill-color: #667eea;
        color: #667eea;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    .step-card,
    .feature-card,
    .cta-button,
    .send-button,
    .message-textarea {
        transition: none;
    }

    .step-card:hover,
    .feature-card:hover,
    .cta-button:hover,
    .send-button:hover {
        transform: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .modern-card {
        background: rgba(30, 30, 30, 0.95);
        color: #fff;
    }

    .step-card,
    .feature-card {
        background: #2d2d2d;
        color: #fff;
        border-color: #444;
    }

    .message-form-card {
        background: #2d2d2d;
        color: #fff;
    }

    .message-textarea {
        background: #3d3d3d;
        color: #fff;
        border-color: #555;
    }

    .message-textarea:focus {
        border-color: #667eea;
    }
}

/* ======================================
   UTILITY CLASSES
   ====================================== */
.text-gradient-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-warning {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-custom {
    box-shadow: 0 15px 35px rgba(50, 50, 93, 0.1), 0 5px 15px rgba(0, 0, 0, 0.07);
}

.border-gradient {
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
        linear-gradient(45deg, #667eea, #764ba2) border-box;
}

.animate-fade-in {
    -webkit-animation: fadeIn 0.6s ease-in-out;
            animation: fadeIn 0.6s ease-in-out;
}

@-webkit-keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-up {
    -webkit-animation: slideUp 0.6s ease-out;
            animation: slideUp 0.6s ease-out;
}

@-webkit-keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Print styles */
@media print {

    .hero-section,
    .cta-section,
    .signup-encouragement,
    .ad-content,
    .ad-header,
    .ad-footer {
        display: none;
    }

    .message-form-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Ad content styling */
.ad-header ins,
.ad-footer ins,
.ad-content ins,
.ad-sidebar ins,
.ad-between-messages ins {
    text-decoration: none;
}

/* Google AdSense responsive styling */
.adsbygoogle {
    display: block;
    margin: 0 auto;
}

.ad-sidebar {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 15px;
    padding: 15px;
    margin-top: 20px;
    text-align: center;
    position: -webkit-sticky;
    position: sticky;
    top: 20px;
    transition: all 0.3s ease;
}

.ad-sidebar:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.ad-between-messages td {
    background: #f8f9fa !important;
    border: 1px solid #dee2e6;
    border-radius: 15px;
    transition: all 0.3s ease;
}

.ad-between-messages td:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* ======================================
   PROFILE UX ENHANCEMENTS
   ====================================== */

/* Profile Header */
.profile-header-wrapper {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.profile-header-bg {
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 1.5rem;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1;
}

.profile-header-content {
    position: relative;
    z-index: 2;
    padding: 2rem;
    padding-bottom: 1rem;
}

.profile-avatar-container {
    position: relative;
}

.avatar-upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
    color: white;
    font-size: 1.5rem;
}

.profile-avatar-container:hover .avatar-upload-overlay {
    opacity: 1;
}

.profile-info h3 {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.profile-stats .stat-item {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    padding: 0.5rem;
    -webkit-backdrop-filter: blur(10px);
            backdrop-filter: blur(10px);
}

/* Profile Navigation */
.profile-nav-container {
    margin-top: -1rem;
    position: relative;
    z-index: 3;
}

.profile-nav-card {
    border-radius: 1rem !important;
    -webkit-backdrop-filter: blur(10px);
            backdrop-filter: blur(10px);
}

.modern-nav-pills {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 0.75rem;
    padding: 0.25rem;
}

.modern-nav-pills .nav-link {
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    color: #667eea;
    border: none;
    background: transparent;
}

.modern-nav-pills .nav-link.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.modern-nav-pills .nav-link:hover:not(.active) {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

/* Profile Content */
.modern-tab-content {
    margin-top: 1.5rem;
}

.modern-profile-card {
    border-radius: 1rem !important;
    overflow: hidden;
}

.modern-profile-card .card-header {
    border-radius: 0 !important;
    background: linear-gradient(45deg, #667eea, #764ba2) !important;
}

/* Form Enhancements */
.modern-form {
    position: relative;
}

.form-section {
    background: rgba(248, 249, 250, 0.5);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.section-title {
    color: #344767;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(102, 126, 234, 0.1);
}

.modern-form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: 600;
    color: #344767;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.modern-input {
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    background: white;
}

.modern-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.15);
    background: white;
}

.input-group-text {
    background: #f8f9fa;
    border-color: #e9ecef;
    color: #6c757d;
}

/* Profile Link Display */
.profile-link-display {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border: 1px solid rgba(102, 126, 234, 0.1);
    border-radius: 1rem;
    padding: 1.5rem;
}

.link-preview {
    display: flex;
    align-items: center;
}

.link-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.link-content {
    flex: 1;
}

.link-content h6 {
    color: #344767;
    margin-bottom: 0.25rem;
}

.link-actions .btn {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Stats Grid */
.stats-grid {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.stat-card {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: rgba(248, 249, 250, 0.5);
    border-radius: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stat-card .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.stat-content h5 {
    color: #344767;
    font-weight: 700;
    margin-bottom: 0;
}

.stat-content small {
    color: #6c757d;
    font-size: 0.75rem;
}

/* Form Actions */
.form-actions {
    background: rgba(248, 249, 250, 0.3);
    border-radius: 0.75rem;
    padding: 1rem;
}

.form-info small {
    font-size: 0.8rem;
}

.form-buttons .btn {
    min-width: 120px;
}

/* Alert Enhancements */
.alert-modern {
    border: none;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(40, 167, 69, 0.05) 100%);
    border-left: 4px solid #28a745;
    color: #155724;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .profile-header-content {
        padding: 1rem;
    }

    .profile-info h3 {
        font-size: 1.5rem;
    }

    .form-section {
        padding: 1rem;
    }

    .link-preview {
        flex-direction: column;
        text-align: center;
    }

    .link-icon {
        margin-right: 0;
        margin-bottom: 1rem;
    }

    .form-actions {
        text-align: center;
    }

    .form-actions .d-flex {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 576px) {
    .profile-header-bg {
        height: 150px;
    }

    .modern-nav-pills .nav-link {
        font-size: 0.8rem;
        padding: 0.5rem;
    }

    .stat-card {
        padding: 0.75rem;
    }

    .stat-card .stat-icon {
        width: 35px;
        height: 35px;
    }
}

/* Animation Enhancements */
.profile-avatar-container .avatar {
    transition: transform 0.3s ease;
}

.profile-avatar-container:hover .avatar {
    transform: scale(1.05);
}

.modern-form-group {
    opacity: 0;
    transform: translateY(20px);
    -webkit-animation: fadeInUp 0.6s ease-out forwards;
            animation: fadeInUp 0.6s ease-out forwards;
}

.modern-form-group:nth-child(1) {
    -webkit-animation-delay: 0.1s;
            animation-delay: 0.1s;
}

.modern-form-group:nth-child(2) {
    -webkit-animation-delay: 0.2s;
            animation-delay: 0.2s;
}

.modern-form-group:nth-child(3) {
    -webkit-animation-delay: 0.3s;
            animation-delay: 0.3s;
}

.modern-form-group:nth-child(4) {
    -webkit-animation-delay: 0.4s;
            animation-delay: 0.4s;
}

/* Password Strength Indicator */
.password-strength {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
}

.password-strength.weak {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.password-strength.fair {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.password-strength.good {
    background: rgba(13, 202, 240, 0.1);
    color: #0dcaf0;
}

.password-strength.strong {
    background: rgba(25, 135, 84, 0.1);
    color: #198754;
}

.password-strength.very-strong {
    background: rgba(25, 135, 84, 0.2);
    color: #198754;
    font-weight: 700;
}

/* Form Focus States */
.modern-form-group.focused .form-label {
    color: #667eea;
    transform: translateY(-2px);
}

.modern-input.is-valid {
    border-color: #198754;
    box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.15);
}

.modern-input.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.15);
}

/* Draft Indicator */
.draft-indicator {
    position: absolute;
    right: 0;
    bottom: -1.5rem;
    opacity: 0.7;
    font-style: italic;
}

/* Loading States */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    -webkit-animation: spin 1s linear infinite;
            animation: spin 1s linear infinite;
}

/* Enhanced Tooltips */
.tooltip-custom {
    position: relative;
    cursor: help;
}

.tooltip-custom::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.tooltip-custom:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

/* Success States */
.form-success-feedback {
    color: #198754;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

.form-success-feedback.show {
    display: block;
    -webkit-animation: fadeInUp 0.3s ease-out;
            animation: fadeInUp 0.3s ease-out;
}

/* Enhanced Buttons */
.btn-gradient {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border: none;
    color: white;
    transition: all 0.3s ease;
}

.btn-gradient:hover {
    background: linear-gradient(45deg, #5a6fd8, #6842a0);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    color: white;
}

/* Tab Content Animation */
.tab-pane {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease-out;
}

.tab-pane.show.active {
    opacity: 1;
    transform: translateY(0);
}

/* ======================================
   FINAL SCROLLBAR ELIMINATION - HIGHEST PRIORITY
   ====================================== */

/* Ultra-aggressive scrollbar removal for inbox */
.modern-messages-container,
.modern-messages-container.card,
.modern-messages-container .card-body,
div.modern-messages-container,
div.card.modern-messages-container,
.card.shadow-sm.border-0.modern-messages-container,
#messagesContainer,
div#messagesContainer {
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    max-height: none !important;
    height: auto !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

/* Hide all scrollbars in WebKit browsers */
.modern-messages-container::-webkit-scrollbar,
.modern-messages-container *::-webkit-scrollbar,
.modern-messages-container.card::-webkit-scrollbar,
.modern-messages-container .card-body::-webkit-scrollbar,
div.modern-messages-container::-webkit-scrollbar,
div.card.modern-messages-container::-webkit-scrollbar,
.card.shadow-sm.border-0.modern-messages-container::-webkit-scrollbar,
#messagesContainer::-webkit-scrollbar,
div#messagesContainer::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Remove any Bootstrap or framework imposed scrollbars */
.row .col-12 .card.modern-messages-container,
.container-fluid .row .col-12 .card.modern-messages-container,
body .container-fluid .row .col-12 .card.modern-messages-container {
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
}

/* Final fallback - force no scroll on any element with these classes */
[class*="modern-messages-container"],
[class*="modern-messages-container"] * {
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
}

/* Override any inline styles that might add scrollbars */
.modern-messages-container[style*="overflow"],
.modern-messages-container[style*="max-height"],
.modern-messages-container[style*="height"] {
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
}

/* Ensure card containers in inbox don't scroll */
.card.shadow-sm.border-0[class*="modern-messages"] {
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
}

/* Bootstrap card overrides for inbox */
body .card-body.p-0,
body .modern-messages-container .card-body.p-0,
body .modern-messages-container.card .card-body.p-0 {
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
}

/* Force removal of any computed overflow styles */
.modern-messages-container {
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    max-height: unset !important;
    height: unset !important;
}
