/* * Kalum Notifications System Styles
 * Requires FontAwesome for icons.
 */

/* Notification Container */
#notification-area {
    position: fixed;
    /* UPDATED: Added env(safe-area-inset-top) for PWA notch/status bar support */
    top: calc(20px + env(safe-area-inset-top, 0px));
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 9999;
    pointer-events: none;
    width: 100%;
    max-width: 400px;
    perspective: 1000px;
    font-family: 'Vazirmatn', 'Inter', sans-serif; /* Farsi-first font cascade */
}

@media (max-width: 640px) {
    #notification-area {
        /* UPDATED: Added env(safe-area-inset-top) for mobile PWA support */
        top: calc(10px + env(safe-area-inset-top, 0px));
        right: 50%;
        transform: translateX(50%);
        width: 90%;
    }
}

/* Kalum Signature Notification Box */
.notify-box {
    position: relative;
    pointer-events: auto;
background: rgba(0, 0, 0, 0.75); 
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.25rem;
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    transform-style: preserve-3d;
    will-change: transform, opacity;
    transform: translateZ(0);
    transition: transform 0.1s ease-out;
}

/* Farsi-specific styles */
.notify-farsi {
    direction: rtl;
    text-align: right;
}

.notify-farsi .notify-content-wrapper {
    flex-direction: row-reverse;
}

.notify-farsi .notify-icon {
    margin-left: 0;
    margin-right: 0;
}

.notify-farsi .notify-text {
    padding-right: 0;
    padding-left: 1.5rem;
}

.notify-farsi .notify-title,
.notify-farsi .notify-message {
    font-family: 'Vazirmatn', 'Inter', sans-serif;
    text-align: right;
}

.notify-farsi .notify-close {
    right: auto;
    left: 1rem;
}

.notify-farsi .notify-close:hover {
    transform: rotate(-90deg);
}

/* Animated Entrance */
.notify-enter {
    animation: springIn 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Animated Exit */
.notify-exit {
    animation: slideOutRight 0.5s cubic-bezier(0.55, 0.085, 0.68, 0.53) forwards;
}

/* Dynamic Aura Glow Background */
.notify-aura {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    opacity: 0.15;
    background: radial-gradient(circle at center, var(--theme-color) 0%, transparent 60%);
    animation: rotateAura 10s linear infinite;
    z-index: 0;
    pointer-events: none;
}

/* Shine sweep effect */
.notify-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: skewX(-20deg);
    animation: shine 4s ease-in-out infinite;
    z-index: 1;
    pointer-events: none;
}

.notify-content-wrapper {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
}

/* Icon Styling */
.notify-icon {
    flex-shrink: 0;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--theme-color);
    box-shadow: 0 0 15px rgba(var(--theme-rgb), 0.3), inset 0 0 10px rgba(var(--theme-rgb), 0.2);
    animation: popIcon 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.2s both,
               pulseGlow 2s infinite 1s;
}

.notify-text {
    flex-grow: 1;
    padding-right: 1.5rem;
}

.notify-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.25rem;
    letter-spacing: 0.02em;
}

.notify-message {
    font-size: 0.85rem;
    color: #d1d5db;
    line-height: 1.4;
    margin: 0;
}

/* Close Button */
.notify-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    z-index: 3;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 0;
}

.notify-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

/* Progress Bar Timer */
.notify-progress-bg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    z-index: 2;
}

.notify-progress-bar {
    height: 100%;
    background: var(--theme-color);
    width: 100%;
    box-shadow: 0 0 10px var(--theme-color);
    transform-origin: left;
}

/* Themes */
.theme-success { --theme-color: #10B981; --theme-rgb: 16, 185, 129; }
.theme-error { --theme-color: #EF4444; --theme-rgb: 239, 68, 68; }
.theme-warning { --theme-color: #F57C00; --theme-rgb: 245, 124, 0; }
.theme-info { --theme-color: #3b82f6; --theme-rgb: 59, 130, 246; }

/* Keyframes */
@keyframes springIn {
    0% { transform: translateX(120%) scale(0.8); opacity: 0; }
    60% { transform: translateX(-5%) scale(1.02); opacity: 1; }
    80% { transform: translateX(2%) scale(0.98); }
    100% { transform: translateX(0) scale(1); opacity: 1; }
}

@keyframes slideOutRight {
    0% { transform: translateX(0); opacity: 1; }
    40% { transform: translateX(-5%); opacity: 1; }
    100% { transform: translateX(120%); opacity: 0; }
}

@keyframes rotateAura {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes shine {
    0% { left: -100%; }
    20% { left: 200%; }
    100% { left: 200%; }
}

@keyframes popIcon {
    0% { transform: scale(0); opacity: 0; }
    70% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 15px rgba(var(--theme-rgb), 0.3), inset 0 0 10px rgba(var(--theme-rgb), 0.2); }
    50% { box-shadow: 0 0 25px rgba(var(--theme-rgb), 0.6), inset 0 0 15px rgba(var(--theme-rgb), 0.4); }
    100% { box-shadow: 0 0 15px rgba(var(--theme-rgb), 0.3), inset 0 0 10px rgba(var(--theme-rgb), 0.2); }
}