/* ========================================
   GLOBAL MESSAGING OVERLAY STYLES
   ======================================== */

/* Global messaging trigger button (Floating Action Button) */
.global-messaging-trigger {
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    z-index: 1030;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.global-messaging-trigger:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.global-messaging-trigger:active {
    transform: scale(0.95);
}

/* Badge for unread count */
.global-messaging-trigger .badge {
    font-size: 0.65rem;
    padding: 0.25rem 0.4rem;
    min-width: 20px;
}

/* Global messaging overlay container */
.global-messaging-overlay {
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    z-index: 1040;
    background-color: var(--bs-body-bg);
    border-left: 1px solid var(--bs-border-color);
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1);
    animation: slideInRight 0.3s ease-out;
}

/* Dark mode shadow adjustment */
[data-bs-theme="dark"] .global-messaging-overlay {
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.3);
}

/* Slide-in animation */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Backdrop for mobile (dims the rest of the page) */
.global-messaging-backdrop {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1035;
    animation: fadeIn 0.3s ease-out;
}

[data-bs-theme="dark"] .global-messaging-backdrop {
    background-color: rgba(0, 0, 0, 0.7);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Mobile Responsive Styles */
@media (max-width: 767.98px) {
    /* Full-screen overlay on mobile */
    .global-messaging-overlay {
        width: 100%;
        left: 0;
    }
    
    /* Larger trigger button on mobile */
    .global-messaging-trigger {
        bottom: 16px;
        right: 16px;
        width: 64px;
        height: 64px;
    }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
    .global-messaging-overlay {
        width: 380px;
    }
}

/* Large desktop adjustments */
@media (min-width: 1440px) {
    .global-messaging-overlay {
        width: 460px;
    }
}

/* Ensure overlay doesn't interfere with existing modals */
.modal {
    z-index: 1050; /* Higher than messaging overlay */
}

.modal-backdrop {
    z-index: 1049; /* Between messaging and modal */
}

/* Accessibility: Focus states */
.global-messaging-trigger:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .global-messaging-overlay,
    .global-messaging-trigger,
    .global-messaging-backdrop {
        display: none !important;
    }
}

