/*
 * Croplod Notification System
 * Modern, RTL, dark/light mode
 */

/* Container */
.croplod-notifications {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 700;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 420px;
    width: calc(100% - 32px);
}

/* Notification item */
.croplod-notification {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 12px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--card-shadow-elevated);
    pointer-events: auto;
    animation: croplod-notif-in 0.35s cubic-bezier(0.21, 1.02, 0.73, 1);
    direction: rtl;
    font-family: var(--font-family);
    overflow: hidden;
}

[data-theme="dark"] .croplod-notification {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* Animations */
@keyframes croplod-notif-in {
    from { opacity: 0; transform: translateY(-12px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes croplod-notif-out {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(-12px) scale(0.96); }
}

/* Icon */
.croplod-notification-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 4px;
}

.croplod-notification-icon svg {
    width: 14px;
    height: 14px;
}

/* Text */
.croplod-notification-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.5;
}

/* Close button */
.croplod-notification-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color 150ms ease;
}

.croplod-notification-close:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.croplod-notification-close svg {
    width: 14px;
    height: 14px;
}

/* Progress bar */
.croplod-notification-progress {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.croplod-notification-progress-bar {
    height: 100%;
    border-radius: inherit;
    transition: width linear;
}

/* === Notification Types === */

/* Success */
.croplod-notification--success {
    border-right: 3px solid var(--color-success-500);
}

.croplod-notification--success .croplod-notification-icon {
    background-color: var(--icon-bg-success);
    color: var(--color-success-500);
}

.croplod-notification--success .croplod-notification-progress-bar {
    background-color: var(--color-success-500);
}

/* Error */
.croplod-notification--error {
    border-right: 3px solid var(--color-error-500);
}

.croplod-notification--error .croplod-notification-icon {
    background-color: var(--icon-bg-error);
    color: var(--color-error-500);
}

.croplod-notification--error .croplod-notification-progress-bar {
    background-color: var(--color-error-500);
}

/* Warning */
.croplod-notification--warning {
    border-right: 3px solid var(--color-warning-500);
}

.croplod-notification--warning .croplod-notification-icon {
    background-color: var(--icon-bg-warning);
    color: var(--color-warning-500);
}

.croplod-notification--warning .croplod-notification-progress-bar {
    background-color: var(--color-warning-500);
}

/* Info */
.croplod-notification--info {
    border-right: 3px solid var(--color-primary-500);
}

.croplod-notification--info .croplod-notification-icon {
    background-color: var(--icon-bg-primary);
    color: var(--color-primary-500);
}

.croplod-notification--info .croplod-notification-progress-bar {
    background-color: var(--color-primary-500);
}

/* === Mobile === */
@media (max-width: 639px) {
    .croplod-notifications {
        top: 16px;
        max-width: calc(100% - 24px);
    }

    .croplod-notification {
        padding: 12px 14px;
        border-radius: 10px;
    }

    .croplod-notification-text {
        font-size: 13px;
    }
}
