/* تنسيقات Modal الحديثة */

.modern-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modern-modal-overlay.show {
    opacity: 1;
}

.modern-modal-box {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    animation: modalSlideIn 0.4s ease forwards;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.8) translateY(-30px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modern-modal-header {
    text-align: center;
    padding: 30px 30px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.modern-modal-icon {
    font-size: 64px;
    margin-bottom: 15px;
    animation: iconPulse 0.6s ease;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.modern-modal-icon.icon-success {
    color: #28a745;
}

.modern-modal-icon.icon-error {
    color: #dc3545;
}

.modern-modal-icon.icon-warning {
    color: #ffc107;
}

.modern-modal-icon.icon-confirm {
    color: #007bff;
}

.modern-modal-icon.icon-info {
    color: #17a2b8;
}

.modern-modal-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.modern-modal-title.title-success { color: #28a745; }
.modern-modal-title.title-error { color: #dc3545; }
.modern-modal-title.title-warning { color: #ffc107; }
.modern-modal-title.title-confirm { color: #007bff; }
.modern-modal-title.title-info { color: #17a2b8; }

.modern-modal-body {
    padding: 25px 30px;
    text-align: center;
}

.modern-modal-message {
    font-size: 16px;
    color: #555;
    line-height: 1.6;
    margin: 0;
}

.modern-modal-footer {
    padding: 20px 30px 30px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.modern-modal-btn {
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modern-modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.modern-modal-btn:active {
    transform: translateY(0);
}

.modern-modal-btn-confirm {
    color: #fff;
}

.modern-modal-btn-confirm.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.modern-modal-btn-confirm.btn-error {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.modern-modal-btn-confirm.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #333;
}

.modern-modal-btn-confirm.btn-confirm {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.modern-modal-btn-confirm.btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #117a8b 100%);
}

.modern-modal-btn-cancel {
    background: #f8f9fa;
    color: #6c757d;
    border: 2px solid #dee2e6;
}

.modern-modal-btn-cancel:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

/* RTL Support */
[dir="rtl"] .modern-modal-footer {
    flex-direction: row-reverse;
}

/* Responsive */
@media (max-width: 576px) {
    .modern-modal-box {
        width: 95%;
        border-radius: 15px;
    }
    
    .modern-modal-header {
        padding: 25px 20px 15px;
    }
    
    .modern-modal-icon {
        font-size: 52px;
    }
    
    .modern-modal-title {
        font-size: 20px;
    }
    
    .modern-modal-body {
        padding: 20px;
    }
    
    .modern-modal-message {
        font-size: 15px;
    }
    
    .modern-modal-footer {
        padding: 15px 20px 25px;
        flex-direction: column;
    }
    
    .modern-modal-btn {
        width: 100%;
        min-width: auto;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .modern-modal-box {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .modern-modal-header {
        border-bottom-color: #4a5568;
    }
    
    .modern-modal-message {
        color: #cbd5e0;
    }
    
    .modern-modal-btn-cancel {
        background: #4a5568;
        color: #e2e8f0;
        border-color: #718096;
    }
    
    .modern-modal-btn-cancel:hover {
        background: #718096;
    }
}

/* Animation للنص */
.modern-modal-message {
    animation: fadeIn 0.5s ease 0.2s both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* تأثير على الأزرار */
.modern-modal-btn {
    position: relative;
    overflow: hidden;
}

.modern-modal-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.modern-modal-btn:active::before {
    width: 300px;
    height: 300px;
}
