/* Unified Notification System - Alpine.js Based */

/* Notice/Alert for static page messages */
.notice {
    padding: var(--pico-spacing);
    border: var(--pico-border-width) solid var(--pico-muted-border-color);
    background: var(--pico-secondary-background);
    border-radius: var(--pico-border-radius);
    text-align: center;
    margin-top: 2rem;
}

.notice strong {
    display: block;
    margin-bottom: 0.25rem;
}

/* Alpine.js Notification System */
.notification {
    margin-bottom: calc(var(--pico-spacing) * 0.5);
    padding: calc(var(--pico-spacing) * 0.75);
    border-radius: var(--pico-border-radius);
    box-shadow: var(--pico-box-shadow);
    display: flex;
    align-items: center;
    opacity: 0;
    transform: translateX(100%);
    transition: all var(--pico-transition);
    background-color: var(--pico-background-color);
    border: var(--pico-border-width) solid var(--pico-muted-border-color);
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-success {
    background-color: #d1fae5; /* Keep - no direct Pico light green */
    border-color: var(--pico-form-element-valid-border-color);
    color: var(--pico-ins-color);
}

.notification-error {
    background-color: #fee2e2; /* Keep - no direct Pico light red */
    border-color: var(--pico-form-element-invalid-border-color);
    color: var(--pico-del-color);
}

.notification-info {
    background-color: #dbeafe; /* Keep - no direct Pico light blue */
    border-color: var(--pico-primary-focus);
    color: var(--pico-primary);
}

.notification-warning {
    background-color: var(--pico-mark-background-color);
    border-color: var(--pico-mark-background-color);
    color: var(--pico-mark-color);
}

.notification-message {
    margin-right: calc(var(--pico-spacing) * 0.5);
    white-space: normal; /* Allow natural wrapping */
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.25em;
    cursor: pointer;
    color: inherit;
    padding: 0;
    line-height: 1;
    opacity: 0.7;
}

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

/* Overlay for blocking notifications */
.notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 9998;
    opacity: 0;
    transition: opacity var(--pico-transition);
}

.notification-overlay.show {
    opacity: 1;
}

/* Enhanced styling for blocking notifications */
.notification-blocking {
    z-index: 9999;
    box-shadow: var(--pico-box-shadow);
    /* Border width same as regular notifications for consistent height */
}

/* Action buttons (OK and Cancel) */
.notification-ok-button,
.notification-cancel-button {
    background: none;
    border: var(--pico-border-width) solid currentColor;
    border-radius: var(--pico-border-radius);
    padding: calc(var(--pico-spacing) * 0.25) calc(var(--pico-spacing) * 0.75);
    cursor: pointer;
    color: inherit;
    font-size: 0.875em;
    transition: all var(--pico-transition);
    white-space: nowrap;
}

/* Primary action button (OK) - fills on hover */
.notification-ok-button:hover {
    background-color: currentColor;
    color: var(--pico-background-color);
}

/* Secondary action button (Cancel) - subtle hover */
.notification-cancel-button {
    opacity: 0.8;
}

.notification-cancel-button:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.05);
}

/* Context-specific OK button colors */
.notification-error .notification-ok-button:hover {
    background-color: var(--pico-del-color);
    color: var(--pico-background-color);
}

.notification-warning .notification-ok-button:hover {
    background-color: var(--pico-mark-color);
    color: var(--pico-background-color);
}

/* Enhanced notification content layout */
.notification-content {
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: space-between;
}

.notification-actions {
    display: flex;
    align-items: center;
    gap: calc(var(--pico-spacing) * 0.25);
    flex-shrink: 0;
}

/* Accessibility enhancements */
.notification[role="alert"] {
    /* Screen reader support via aria-live is handled in HTML */
}

.notification:focus-within {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    /* Mobile breakpoint */
    .tier-notifications {
        left: var(--pico-spacing);
        right: var(--pico-spacing);
        max-width: none;
    }

    .notification-content {
        flex-direction: column;
        align-items: stretch;
        gap: calc(var(--pico-spacing) * 0.5);
    }

    .notification-actions {
        margin-left: 0;
        justify-content: flex-end;
    }
}
