/* M2M Notifications Styles */

.m2m-notification {
    position: fixed;
    z-index: 9999;
    background: #ffffff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    width: 90%;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.m2m-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.m2m-notification.hide {
    opacity: 0;
    transform: translateY(-20px);
}

/* Mobile Styles - Top of screen */
@media (max-width: 768px) {
    .m2m-notification {
        top: 20px;
        left: 50%;
        transform: translateX(-50%) translateY(-20px);
        margin: 0 auto;
    }
    
    .m2m-notification.show {
        transform: translateX(-50%) translateY(0);
    }
    
    .m2m-notification.hide {
        transform: translateX(-50%) translateY(-20px);
    }
}

/* Desktop Styles - Bottom left corner */
@media (min-width: 769px) {
    .m2m-notification {
        bottom: 20px;
        left: 20px;
        transform: translateY(20px);
    }
    
    .m2m-notification.show {
        transform: translateY(0);
    }
    
    .m2m-notification.hide {
        transform: translateY(20px);
    }
}

.m2m-notification-content {
    display: flex;
    align-items: center;
    padding: 15px;
    gap: 15px;
    position: relative;
}

.m2m-notification-image {
    flex-shrink: 0;
}

.m2m-notification-image img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

.m2m-notification-text {
    flex: 1;
    min-width: 0;
}

.m2m-notification-title {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.2;
}

.m2m-notification-subtitle {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.m2m-notification-action {
    flex-shrink: 0;
}

.m2m-notification-button {
    display: inline-block;
    background: var(--e-global-color-primary, #0073aa);
    color: #ffffff;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.m2m-notification-button:hover {
    background: var(--e-global-color-primary-hover, #005a87);
    color: #ffffff;
    text-decoration: none;
}

.m2m-notification-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #999;
    padding: 4px;
    line-height: 1;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.m2m-notification-close:hover {
    background: #f0f0f0;
    color: #666;
}

.m2m-notification-close:focus {
    outline: 2px solid var(--e-global-color-primary, #0073aa);
    outline-offset: 2px;
}

/* Screen reader text */
.screen-reader-text {
    position: absolute;
    margin: -1px;
    padding: 0;
    height: 1px;
    width: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Animation for mobile show/hide */
@media (max-width: 768px) {
    .m2m-notification {
        animation: slideInFromTop 0.3s ease forwards;
    }
    
    .m2m-notification.hide {
        animation: slideOutToTop 0.3s ease forwards;
    }
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes slideOutToTop {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-100%);
    }
}

/* Animation for desktop show/hide */
@media (min-width: 769px) {
    .m2m-notification {
        animation: slideInFromBottom 0.3s ease forwards;
    }
    
    .m2m-notification.hide {
        animation: slideOutToBottom 0.3s ease forwards;
    }
}

@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOutToBottom {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(100%);
    }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .m2m-notification {
        width: 95%;
        max-width: none;
    }
    
    .m2m-notification-content {
        padding: 12px;
        gap: 12px;
    }
    
    .m2m-notification-image img {
        width: 50px;
        height: 50px;
    }
    
    .m2m-notification-title {
        font-size: 15px;
    }
    
    .m2m-notification-subtitle {
        font-size: 13px;
    }
    
    .m2m-notification-button {
        padding: 6px 12px;
        font-size: 13px;
    }
}