/* Modern Interactive Alert System */
.alert-popup-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    max-width: 500px;
    width: 90%;
    pointer-events: none;
}

.alert-popup {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    padding: 20px 24px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
    pointer-events: auto;
    animation: slideDown 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.alert-popup::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: currentColor;
    opacity: 0.8;
}

.alert-popup:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

/* Alert Types */
.alert-popup-success {
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
    border-right: 4px solid #10b981;
    color: #065f46;
}

.alert-popup-success .alert-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.alert-popup-error,
.alert-popup-danger {
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
    border-right: 4px solid #ef4444;
    color: #991b1b;
}

.alert-popup-error .alert-icon,
.alert-popup-danger .alert-icon {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.alert-popup-warning {
    background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
    border-right: 4px solid #f59e0b;
    color: #92400e;
}

.alert-popup-warning .alert-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.alert-popup-info {
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
    border-right: 4px solid #3b82f6;
    color: #1e40af;
}

.alert-popup-info .alert-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

/* Alert Icon */
.alert-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: iconPulse 2s ease-in-out infinite;
}

/* Alert Content */
.alert-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.alert-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}

.alert-message {
    font-size: 14px;
    margin: 0;
    opacity: 0.9;
    line-height: 1.5;
}

/* Close Button */
.alert-close {
    background: transparent;
    border: none;
    color: currentColor;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    opacity: 0.6;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.05);
    transform: rotate(90deg);
}

/* Progress Bar */
.alert-progress {
    position: absolute;
    bottom: 0;
    right: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    animation: progressBar 5s linear forwards;
    border-radius: 0 0 16px 0;
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes progressBar {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

.alert-popup.hiding {
    animation: slideUp 0.3s ease forwards;
}

/* RTL Support */
[dir="rtl"] .alert-popup::before {
    right: auto;
    left: 0;
}

[dir="rtl"] .alert-popup {
    border-right: none;
    border-left: 4px solid;
}

[dir="rtl"] .alert-progress {
    right: auto;
    left: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .alert-popup-container {
        top: 10px;
        width: 95%;
        max-width: none;
    }
    
    .alert-popup {
        padding: 16px 20px;
        gap: 12px;
    }
    
    .alert-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .alert-title {
        font-size: 15px;
    }
    
    .alert-message {
        font-size: 13px;
    }
}

/* Stack Multiple Alerts */
.alert-popup-container .alert-popup:not(:last-child) {
    margin-bottom: 12px;
}

/* Confirmation Dialog */
.alert-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.alert-confirm-overlay.show {
    opacity: 1;
}

.alert-confirm-overlay.hiding {
    opacity: 0;
}

.alert-confirm-dialog {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 100%;
    padding: 0;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
}

.alert-confirm-dialog.show {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.alert-confirm-dialog.hiding {
    transform: scale(0.9) translateY(20px);
    opacity: 0;
}

.alert-confirm-icon {
    width: 80px;
    height: 80px;
    margin: 30px auto 20px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
    animation: iconPulse 2s ease-in-out infinite;
}

.alert-confirm-content {
    padding: 0 30px 30px;
    text-align: center;
}

.alert-confirm-title {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
}

.alert-confirm-message {
    font-size: 16px;
    color: #6b7280;
    line-height: 1.6;
}

.alert-confirm-actions {
    display: flex;
    gap: 12px;
    padding: 20px 30px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.alert-confirm-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.alert-confirm-cancel {
    background: #f3f4f6;
    color: #6b7280;
}

.alert-confirm-cancel:hover {
    background: #e5e7eb;
    color: #374151;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.alert-confirm-ok {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.alert-confirm-ok:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.alert-confirm-btn i {
    font-size: 18px;
}

/* RTL Support for Confirmation */
[dir="rtl"] .alert-confirm-actions {
    flex-direction: row-reverse;
}

/* Mobile Responsive for Confirmation */
@media (max-width: 768px) {
    .alert-confirm-dialog {
        max-width: 90%;
        margin: 20px;
    }
    
    .alert-confirm-icon {
        width: 60px;
        height: 60px;
        font-size: 30px;
        margin: 20px auto 15px;
    }
    
    .alert-confirm-title {
        font-size: 20px;
    }
    
    .alert-confirm-message {
        font-size: 15px;
    }
    
    .alert-confirm-content {
        padding: 0 20px 20px;
    }
    
    .alert-confirm-actions {
        padding: 15px 20px;
        flex-direction: column;
    }
    
    .alert-confirm-btn {
        width: 100%;
    }
}
