/* Modal Notification System */

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(2px);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.modal-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 90%;
    width: 100%;
    max-width: 500px;
    margin: 20px;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.modal-overlay.show .modal-container {
    transform: scale(1) translateY(0);
}

/* Modal Header */
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-header.success {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: #fff;
    border-bottom: none;
}

.modal-header.error {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: #fff;
    border-bottom: none;
}

.modal-header.warning {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: #fff;
    border-bottom: none;
}

.modal-header.info {
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    color: #fff;
    border-bottom: none;
}

/* Modal Icon */
.modal-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.modal-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.modal-header:not(.success):not(.error):not(.warning):not(.info) .modal-icon {
    background: #f5f5f5;
    color: #666;
}

/* Modal Title */
.modal-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.modal-header.success .modal-title,
.modal-header.error .modal-title,
.modal-header.warning .modal-title,
.modal-header.info .modal-title {
    color: #fff;
}

/* Modal Body */
.modal-body {
    padding: 24px;
    color: #333;
    line-height: 1.6;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-message {
    font-size: 16px;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    /* word-break: keep-all; */
    overflow-wrap: break-word;
}

.modal-message p {
    margin: 0.5rem 0;
    line-height: 1.6;
    word-break: keep-all;
    overflow-wrap: break-word;
}

.modal-message ul {
    margin: 8px 0 0 20px;
    padding: 0;
}

.modal-message li {
    margin: 4px 0;
}

/* Modal Footer */
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f9f9f9;
}

/* Modal Buttons */
.modal-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.modal-btn-primary {
    background: #0066cc;
    color: #fff;
}

.modal-btn-primary:hover {
    background: #0052a3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.3);
}

.modal-btn-primary:active {
    transform: translateY(0);
}

.modal-btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.modal-btn-secondary:hover {
    background: #d0d0d0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .modal-container {
        /* max-width: 95%; */
        margin: 10px;
        border-radius: 8px;
    }

    .modal-header {
        padding: 16px 20px;
    }

    .modal-title {
        font-size: 16px;
    }

    .modal-body {
        padding: 20px;
        font-size: 14px;
    }

    .modal-footer {
        padding: 12px 20px;
        /* flex-direction: column; */
    }

    .modal-btn {
        /* width: 100%; */
        padding: 12px 24px;
    }

    .modal-icon {
        width: 28px;
        height: 28px;
    }

    .modal-icon svg {
        width: 18px;
        height: 18px;
    }
}

/* Animation for auto-dismiss */
@keyframes slideOut {
    from {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
    to {
        transform: scale(0.9) translateY(-20px);
        opacity: 0;
    }
}

.modal-container.dismissing {
    animation: slideOut 0.3s ease forwards;
}

