/* ============================================
   DGMA Modal Styles - Consistent Modal Styling
   ============================================ */

/* Body scroll lock when modal is open */
body.modal-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Modal Overlay - Locks background */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    overflow-x: hidden;
}

.modal-overlay.show {
    display: flex;
}

/* Modal Container */
.modal-container {
    background: white;
    border-radius: 16px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    position: relative;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-30px) scale(0.95);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Modal Header */
.modal-header {
    background: #4c956c;
    padding: 18px 24px;
    position: relative;
    text-align: center;
    border-radius: 16px 16px 0 0;
    flex-shrink: 0;
}

.modal-header h3,
.modal-header h2 {
    color: white;
    font-size: 1.4rem;
    margin: 0;
    font-weight: 600;
}

/* Close Button - White X with rounded square hover */
.modal-close-btn {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    background: transparent;
    color: white;
    border: none;
    width: 34px;
    height: 34px;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    line-height: 1;
    padding: 0;
    border-radius: 8px;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    transform: translateY(-50%);
}

.modal-close-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* Modal Body Wrapper - Scrollable area */
.modal-body-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Modal Body */
.modal-body {
    padding: 24px;
}

/* Modal Footer */
.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0 0 16px 16px;
    flex-shrink: 0;
}

/* Custom Scrollbar for Modal - Green minimal design without arrows */
.modal-body-wrapper::-webkit-scrollbar {
    width: 6px;
}

.modal-body-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body-wrapper::-webkit-scrollbar-thumb {
    background: #4c956c;
    border-radius: 10px;
}

.modal-body-wrapper::-webkit-scrollbar-thumb:hover {
    background: #3a7556;
}

/* Hide scrollbar arrows/buttons */
.modal-body-wrapper::-webkit-scrollbar-button {
    display: none;
    height: 0;
    width: 0;
}

/* Modal Buttons */
.modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Noto Sans Arabic', Arial, sans-serif;
}

.modal-btn-primary {
    background: #4c956c;
    color: white;
}

.modal-btn-primary:hover {
    background: #3a7556;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 149, 108, 0.3);
}

.modal-btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.modal-btn-secondary:hover {
    background: #d1d5db;
}

.modal-btn-danger {
    background: #ef4444;
    color: white;
}

.modal-btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Close button alternative styles for different header colors */
.close-btn {
    background: transparent;
    color: white;
    border: none;
    width: 34px;
    height: 34px;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 0;
    border-radius: 8px;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modal-container {
        width: 95%;
        max-height: 95vh;
        margin: 10px;
    }

    .modal-header {
        padding: 14px 16px;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-footer {
        padding: 12px 16px;
        flex-wrap: wrap;
    }

    .modal-btn {
        flex: 1;
        min-width: 100px;
    }
}