/* ============================================
   Floating Notification System
   ============================================ */

/* Notification Container - Fixed position at top-right */
.floating-notifications-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    max-width: 400px;
    pointer-events: none;
}

[dir="rtl"] .floating-notifications-container {
    right: auto;
    left: 20px;
}

/* Individual Floating Notification */
.floating-notification {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-xl);
    pointer-events: auto;
    min-width: 350px;
    max-width: 400px;
    backdrop-filter: blur(10px);
    animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    overflow: hidden;
}

[dir="rtl"] .floating-notification {
    animation: slideInLeft 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Slide in animations */
@keyframes slideInRight {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Slide out animations */
@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-120%);
        opacity: 0;
    }
}

.floating-notification.dismissing {
    animation: slideOutRight 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

[dir="rtl"] .floating-notification.dismissing {
    animation: slideOutLeft 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

/* Progress bar for auto-dismiss */
.floating-notification::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--btn-primary-bg);
    width: 100%;
    animation: progressBar 5s linear forwards;
}

@keyframes progressBar {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* Notification Header */
.floating-notification-header {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

/* Notification Icon */
.floating-notification-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.25rem;
}

.floating-notification-icon.admin_message {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info-color);
}

.floating-notification-icon.system {
    background: var(--overlay-light);
    color: var(--text-primary);
}

.floating-notification-icon.security {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error-color);
}

.floating-notification-icon.success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success-color);
}

.floating-notification-icon.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
}

/* Notification Content */
.floating-notification-content {
    flex: 1;
    min-width: 0;
}

.floating-notification-title {
    font-size: 0.9375rem;
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    line-height: 1.4;
}

.floating-notification-message {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: var(--spacing-sm);
}

.floating-notification-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* Close Button */
.floating-notification-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    background: var(--overlay-light);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    opacity: 0.6;
}

[dir="rtl"] .floating-notification-close {
    right: auto;
    left: var(--spacing-md);
}

.floating-notification-close:hover {
    background: var(--overlay-medium);
    opacity: 1;
    transform: scale(1.1);
}

/* Hover effects */
.floating-notification:hover::before {
    animation-play-state: paused;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .floating-notifications-container {
        top: 60px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    [dir="rtl"] .floating-notifications-container {
        left: 10px;
        right: 10px;
    }
    
    .floating-notification {
        min-width: auto;
        max-width: none;
        width: 100%;
    }
}

/* Sound wave animation (optional visual feedback) */
.floating-notification.playing-sound .floating-notification-icon {
    animation: soundWave 0.6s ease-in-out;
}

@keyframes soundWave {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 20px currentColor;
    }
}
