/* Notification Popups Styles */

.notification-popup {
    position: fixed;
    z-index: 999999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
    max-width: 500px;
    word-wrap: break-word;
    animation: notificationFadeIn 0.3s ease-out;
}

.notification-popup.notification-popup {
    background: #ffffff;
}

.notification-popup.notification-bar {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: none !important;
    padding: 15px 20px;
    text-align: left;
    box-sizing: border-box;
    transform: none !important;
    margin: 0 !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Position Classes for Popups Only */
.notification-popup.notification-popup.position-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.notification-popup.notification-popup.position-top {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.notification-popup.notification-popup.position-bottom {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.notification-popup.notification-popup.position-top-left {
    top: 20px;
    left: 20px;
}

.notification-popup.notification-popup.position-top-right {
    top: 20px;
    right: 20px;
}

.notification-popup.notification-popup.position-bottom-left {
    bottom: 20px;
    left: 20px;
}

.notification-popup.notification-popup.position-bottom-right {
    bottom: 20px;
    right: 20px;
}

/* Bar Positions - Only top and bottom are allowed */
.notification-bar.position-top {
    top: 0 !important;
    bottom: auto !important;
}

.notification-bar.position-bottom {
    bottom: 0 !important;
    top: auto !important;
}

/* Display Mode - Overlap vs Shift Content */
.notification-bar.display-overlap {
    /* Default behavior - overlaps content */
    /* Position type handled by position-type classes below */
}

.notification-bar.display-shift {
    /* Shifts content by adding body margins */
    /* Position type handled by position-type classes below */
}

/* Position Type - Fixed vs Absolute */
.notification-bar.position-type-fixed {
    position: fixed !important;
}

.notification-bar.position-type-absolute {
    position: absolute !important;
}

/* Absolute positioned bars with shift mode need special handling */
.notification-bar.position-type-absolute.display-shift.position-top {
    position: relative !important;
    top: auto !important;
    width: 100% !important;
    margin-bottom: 0;
}

.notification-bar.position-type-absolute.display-shift.position-bottom {
    position: relative !important;
    bottom: auto !important;
    width: 100% !important;
    margin-top: 0;
}

/* Override any invalid positioning for notification bars */
.notification-bar.position-center,
.notification-bar.position-top-left,
.notification-bar.position-top-right,
.notification-bar.position-bottom-left,
.notification-bar.position-bottom-right {
    /* Force notification bars to top position if invalid position is set */
    top: 0 !important;
    bottom: auto !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
}

/* Content Styling */
.notification-content {
    margin: 0 30px;
}

/* Bar-specific content styling */
.notification-bar .notification-content {
    flex: 1;
    margin-right: 15px;
}

.notification-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: inherit;
    text-align: center;
}

.notification-text {
    margin: 0;
    font-size: 14px;
    color: inherit;
}

.notification-text p {
    margin: 0 0 10px 0;
}

.notification-text p:last-child {
    margin-bottom: 0;
}

/* Button Styling */
.notification-button-wrapper {
    margin-top: 15px;
    text-align: center;
}

/* Bar-specific button styling */
.notification-bar .notification-button-wrapper {
    margin-top: 0;
    flex-shrink: 0;
}

.notification-button {
    display: inline-block;
    padding: 8px 16px;
    background-color: #0073aa;
    color: #ffffff !important;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    border: none;
    cursor: pointer;
}

.notification-button:hover {
    background-color: #005a87;
    color: #ffffff !important;
    text-decoration: none;
}

.notification-button:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Close Button */
.notification-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Bar-specific close button positioning */
.notification-bar .notification-close {
    position: static;
    margin-left: 15px;
    flex-shrink: 0;
}

.notification-close:hover {
    opacity: 1;
}

.notification-close:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Animations */
@keyframes notificationFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.notification-popup.position-top {
    animation: notificationSlideDown 0.3s ease-out;
}

@keyframes notificationSlideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.notification-popup.position-bottom {
    animation: notificationSlideUp 0.3s ease-out;
}

@keyframes notificationSlideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.notification-bar {
    animation: notificationBarSlide 0.3s ease-out;
}

.notification-bar.position-top {
    animation: notificationBarSlideDown 0.3s ease-out;
}

@keyframes notificationBarSlideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

.notification-bar.position-bottom {
    animation: notificationBarSlideUp 0.3s ease-out;
}

@keyframes notificationBarSlideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .notification-popup:not(.notification-bar) {
        left: 10px !important;
        right: 10px !important;
        max-width: none;
        transform: none !important;
    }
    
    /* Ensure notification bars stay full width on mobile */
    .notification-popup.notification-bar {
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        transform: none !important;
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 12px 15px;
    }
    
    /* Mobile bar content styling */
    .notification-bar .notification-content {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    /* Mobile bar button styling */
    .notification-bar .notification-button-wrapper {
        margin-top: 10px;
        text-align: center;
    }
    
    /* Mobile bar close button */
    .notification-bar .notification-close {
        position: absolute;
        top: 8px;
        right: 10px;
        margin-left: 0;
    }
    
    .notification-backdrop .notification-popup {
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        transform: none !important;
        position: relative;
        margin: 10px;
        max-width: calc(100vw - 20px);
    }
    
    .notification-popup.notification-popup.position-center {
        top: 50%;
        transform: translateY(-50%) !important;
    }
    
    .notification-backdrop .notification-popup.position-center {
        top: auto !important;
        transform: none !important;
    }
    
    .notification-popup.notification-popup.position-top {
        top: 10px;
        transform: none !important;
    }
    
    .notification-popup.notification-popup.position-bottom {
        bottom: 10px;
        transform: none !important;
    }
    
    .notification-popup.notification-popup.position-top-left,
    .notification-popup.notification-popup.position-top-right {
        top: 10px;
        left: 10px !important;
        right: 10px !important;
    }
    
    .notification-popup.notification-popup.position-bottom-left,
    .notification-popup.notification-popup.position-bottom-right {
        bottom: 10px;
        left: 10px !important;
        right: 10px !important;
    }
}

/* Common Color Schemes */
.notification-popup.scheme-success {
    background-color: #d4edda !important;
    color: #155724 !important;
    border-color: #c3e6cb !important;
}

.notification-popup.scheme-warning {
    background-color: #fff3cd !important;
    color: #856404 !important;
    border-color: #ffeaa7 !important;
}

.notification-popup.scheme-error {
    background-color: #f8d7da !important;
    color: #721c24 !important;
    border-color: #f5c6cb !important;
}

.notification-popup.scheme-info {
    background-color: #d1ecf1 !important;
    color: #0c5460 !important;
    border-color: #bee5eb !important;
}

/* Hide notification */
.notification-popup.notification-hidden {
    display: none;
}

/* Backdrop for popups */
.notification-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999998;
    animation: notificationBackdropFadeIn 0.3s ease-out;
}

/* Center backdrop uses flexbox centering */
.notification-backdrop.backdrop-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Popups inside backdrops */
.notification-backdrop .notification-popup {
    z-index: 999999;
}

/* Center popups inside backdrops use relative positioning */
.notification-backdrop.backdrop-center .notification-popup {
    position: relative;
    margin: 20px;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
}

/* Non-center popups inside backdrops keep fixed positioning */
.notification-backdrop:not(.backdrop-center) .notification-popup {
    position: fixed;
}

@keyframes notificationBackdropFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}