/* ==========================================
   MODAL NOTIFICATION SYSTEM
   Light / Minimalist / Professional Theme
   ========================================== */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 99999;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-container {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(0, 0, 0, 0.08);
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

.modal-container.modal-wide {
    max-width: 680px;
}

.modal-wide .modal-message {
    font-size: 0.9em;
    line-height: 1.8;
}

.modal-wide .modal-message p {
    margin: 0 0 12px 0;
}

.modal-wide .modal-message p:last-child {
    margin-bottom: 0;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Modal Header */
.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
    background: #fafafa;
}

.modal-header.success {
    background: #f0faf0;
    border-bottom-color: #d4e8d4;
}

.modal-header.error {
    background: #fdf2f2;
    border-bottom-color: #f0d0d0;
}

.modal-header.warning {
    background: #fdf8f0;
    border-bottom-color: #f0e4cc;
}

.modal-header.info {
    background: #f5f5f5;
    border-bottom-color: #e8e8e8;
}

.modal-icon {
    font-size: 1.6em;
    line-height: 1;
}

.modal-title {
    color: #2d3a2d;
    font-size: 1.2em;
    font-weight: 700;
    margin: 0;
}

/* Modal Body */
.modal-body {
    padding: 24px 25px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-message {
    color: #555;
    font-size: 0.95em;
    line-height: 1.7;
    margin: 0 0 16px 0;
}

.modal-message:last-child {
    margin-bottom: 0;
}

.modal-details {
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 14px 16px;
    margin-top: 12px;
}

.modal-detail-item {
    display: flex;
    justify-content: space-between;
    padding: 7px 0;
    color: #666;
    font-size: 0.9em;
}

.modal-detail-item:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
}

.modal-detail-label {
    color: #888;
}

.modal-detail-value {
    color: #2d3a2d;
    font-weight: 600;
}

/* Modal Footer */
.modal-footer {
    padding: 16px 25px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-shrink: 0;
    background: #fafafa;
}

.modal-button {
    background: #f0f0f0;
    border: 1px solid #ddd;
    color: #444;
    padding: 10px 22px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.2s ease;
    min-width: 90px;
}

.modal-button:hover {
    background: #e4e4e4;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.modal-button.primary {
    background: #5a9e3e;
    border-color: #5a9e3e;
    color: #fff;
}

.modal-button.primary:hover {
    background: #4a8a30;
    border-color: #4a8a30;
}

.modal-button.success {
    background: #4caf50;
    border-color: #4caf50;
    color: #fff;
}

.modal-button.success:hover {
    background: #43a047;
    border-color: #43a047;
}

.modal-button.danger {
    background: #d44444;
    border-color: #d44444;
    color: #fff;
}

.modal-button.danger:hover {
    background: #c33;
    border-color: #c33;
}

/* Confirmation */
.modal-confirmation-buttons {
    display: flex;
    gap: 10px;
    width: 100%;
}

.modal-confirmation-buttons .modal-button {
    flex: 1;
}

/* Loading Spinner */
.modal-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #e0e0e0;
    border-top-color: #5a9e3e;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.modal-body.centered {
    text-align: center;
}

.auto-close-countdown {
    color: #888;
    font-size: 0.85em;
    margin-top: 10px;
    text-align: center;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .modal-container {
        max-width: 95%;
        margin: 10px;
        max-height: 85vh;
    }

    .modal-header { padding: 16px 20px; }
    .modal-title { font-size: 1.1em; }
    .modal-icon { font-size: 1.4em; }
    .modal-body { padding: 20px; }

    .modal-footer {
        padding: 14px 20px;
        flex-direction: column;
    }

    .modal-button { width: 100%; }
    .modal-confirmation-buttons { flex-direction: column; }
}

@media (max-height: 600px) {
    .modal-container { max-height: 95vh; }
    .modal-header { padding: 12px 15px; }
    .modal-body { padding: 15px; }
    .modal-footer { padding: 12px 15px; }
    .modal-icon { font-size: 1.2em; }
    .modal-title { font-size: 1em; }
}
