/* Notification Banners for In-App Notifications */

#notification-banner-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    /* Keep banners under the universal loading overlay (z-index: 9999) */
    z-index: 9000;
    max-width: 600px;
    width: calc(100% - 32px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.notification-banner {
    background: white;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    padding: 16px;
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: flex-start;
    pointer-events: auto;
    position: relative;
    animation: slideInDown 0.28s cubic-bezier(.2,.9,.2,1);
    border-right: 4px solid; /* moved from left to right for RTL */
    border-left: none !important;
    direction: rtl;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notification-banner__image {
    width: 96px;
    height: 96px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

/* When a banner includes a large poster image, switch layout to vertical
   and display the image at the top of the text area in a big, full-width style */
.notification-banner.notification-has-image {
    flex-direction: column;
    align-items: stretch;
}

.notification-banner.notification-has-image .notification-banner__content {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
}

.notification-banner.notification-has-image .notification-banner__image {
    width: 100%;
    height: auto;
    max-height: 280px;
    border-radius: 8px;
    object-fit: cover;
    margin-bottom: 8px;
}

/* Image wrapper - image displayed under the title */
.notification-banner__image-wrap {
    position: relative;
    width: 100%;
    display: block;
}

/* Ensure the close button sits above the image */
.notification-banner__close {
    position: absolute;
    left: 8px;
    top: 8px;
    background: transparent;
    border: none;
    font-size: 16px;
    color: #64748b;
    cursor: pointer;
    padding: 4px 6px;
    z-index: 5;
}
.notification-banner__close:hover { color: #111827; }

/* When a banner includes an image poster, show the message under the image */
.notification-banner.notification-has-image .notification-banner__message {
    display: block;
    margin-top: 8px;
}

.notification-banner--info {
    border-right-color: #3b82f6;
    background: #eff6ff;
}

.notification-banner--success {
    border-right-color: #10b981;
    background: #d1fae5;
}

.notification-banner--warning {
    border-right-color: #f59e0b;
    background: #fef3c7;
}

.notification-banner--error {
    border-right-color: #ef4444;
    background: #fee2e2;
}

.notification-banner__content {
    flex: 1;
    display: flex;
    gap: 12px;
    align-items: center;
}

.notification-banner__icon {
    font-size: 24px;
    flex-shrink: 0;
}

.notification-banner__text {
    flex: 1;
}

.notification-banner__title {
    display: block;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #0f172a;
}

.notification-banner__message {
    font-size: 14px;
    color: #374151;
    margin: 0;
    line-height: 1.45;
}

.notification-banner__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification-banner__link {
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.notification-banner__link:hover {
    background: rgba(59, 130, 246, 0.2);
}

.notification-banner__dismiss {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1;
}

.notification-banner__dismiss:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #1e293b;
}

.notification-banner__close {
    position: absolute;
    left: 8px;
    top: 8px;
    background: transparent;
    border: none;
    font-size: 16px;
    color: #64748b;
    cursor: pointer;
    padding: 4px 6px;
}
.notification-banner__close:hover { color: #111827; }

/* Notification Permission Prompt */
.notification-prompt {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 16px;
    animation: fadeIn 0.3s ease-out;
}

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

.notification-prompt__content {
    background: white;
    border-radius: 16px;
    padding: 24px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.notification-prompt__content h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #1e293b;
    text-align: center;
}

.notification-prompt__content p {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 20px 0;
    text-align: center;
    line-height: 1.6;
}

.notification-prompt__actions {
    display: flex;
    gap: 12px;
}

.notification-prompt__actions .btn {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.notification-prompt__actions .btn--primary {
    background: #3b82f6;
    color: white;
}

.notification-prompt__actions .btn--primary:hover {
    background: #2563eb;
}

.notification-prompt__actions .btn--secondary {
    background: #f1f5f9;
    color: #64748b;
}

.notification-prompt__actions .btn--secondary:hover {
    background: #e2e8f0;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    #notification-banner-container {
        top: 60px;
        width: calc(100% - 16px);
    }

    .notification-banner {
        padding: 12px;
        font-size: 14px;
    }

    .notification-banner__title {
        font-size: 14px;
    }

    .notification-banner__message {
        font-size: 13px;
    }

    .notification-banner__icon {
        font-size: 20px;
    }
}
