/* 
 * Modern Popup Notification System
 * High-end SaaS / App-like notifications
 */

:root {
    --popup-bg: #ffffff;
    --popup-text: #1a1a2e;
    --popup-shadow: 0 10px 40px -10px rgba(0,0,0,0.15), 0 4px 10px rgba(0,0,0,0.05);
    --popup-border-radius: 14px;
    --popup-transition: 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    --popup-accent: #0f4c81; /* Default accent (can be overridden) */
    --popup-z-index: 9999;
}

/* Dark theme support (optional class) */
.popup-theme-dark {
    --popup-bg: #1a1a2e;
    --popup-text: #ffffff;
    --popup-shadow: 0 10px 40px -10px rgba(0,0,0,0.5), 0 4px 10px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.05);
}

/* Base containers for stacking */
.notification-container {
    position: fixed;
    z-index: var(--popup-z-index);
    display: flex;
    flex-direction: column;
    gap: 16px;
    pointer-events: none; /* Let clicks pass through container */
}

.notification-container-bottom {
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    align-items: center;
}

.notification-container-right {
    top: 24px;
    right: 24px;
    align-items: flex-end;
}

.notification-container-left {
    bottom: 24px;
    left: 24px;
    align-items: flex-start;
}

/* Popup Base Styling */
.popup-notification {
    background: var(--popup-bg);
    color: var(--popup-text);
    border-radius: var(--popup-border-radius);
    box-shadow: var(--popup-shadow);
    padding: 18px 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    width: max-content;
    max-width: 400px;
    pointer-events: auto; /* Enable clicks on popup */
    position: relative;
    overflow: hidden;
    opacity: 0;
    transition: all var(--popup-transition);
}

/* Add subtle hover effect */
.popup-notification:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 45px -10px rgba(0,0,0,0.2), 0 6px 15px rgba(0,0,0,0.1);
}

.popup-theme-dark:hover {
    box-shadow: 0 15px 45px -10px rgba(0,0,0,0.6), 0 6px 15px rgba(0,0,0,0.3);
}

/* Entrance Animations depending on origin */
.popup-notification[data-position="bottom"] {
    transform: translateY(40px) scale(0.95);
}

.popup-notification[data-position="right"] {
    transform: translateX(40px) scale(0.95);
}

.popup-notification[data-position="left"] {
    transform: translateX(-40px) scale(0.95);
}

/* Active State for all positions */
.popup-notification.popup-visible {
    opacity: 1;
    transform: translate(0, 0) scale(1);
}

/* Outgoing animation state */
.popup-notification.popup-hiding {
    opacity: 0;
    transform: scale(0.9);
}

/* Inner Layout Elements */
.popup-icon {
    font-size: 24px;
    color: var(--popup-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 2px;
}

.popup-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
}

.popup-title {
    font-family: 'Inter', sans-serif, system-ui;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
}

.popup-message {
    font-family: 'Inter', sans-serif, system-ui;
    font-size: 14px;
    opacity: 0.85;
    margin: 0;
    line-height: 1.5;
}

.popup-actions {
    margin-top: 10px;
    display: flex;
    gap: 12px;
}

.popup-btn {
    background: var(--popup-accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    text-decoration: none;
}

.popup-btn:hover {
    opacity: 0.9;
}

/* Close Button */
.popup-close {
    background: transparent;
    border: none;
    color: currentColor;
    opacity: 0.4;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s, transform 0.2s;
    border-radius: 50%;
}

.popup-close:hover {
    opacity: 0.8;
    transform: scale(1.1);
    background: rgba(128,128,128,0.1);
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .notification-container-bottom {
        width: calc(100% - 32px);
        bottom: 16px;
    }
    .popup-notification[data-position="bottom"] {
        width: 100%;
        max-width: 100%;
    }

    .notification-container-right,
    .notification-container-left {
        width: calc(100% - 32px);
        left: 16px;
        right: 16px;
    }
    
    .popup-notification {
        width: 100%;
        max-width: 100%;
    }
}
