/* Modal System - Based on Figma Design */

/* ===== GENERIC MODAL OVERLAY ===== */
.generic-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 39, 92, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
}

.generic-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.generic-modal-overlay.closing {
    opacity: 0;
    visibility: hidden;
}

/* ===== GENERIC MODAL CONTAINER ===== */
.generic-modal-container {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px;
    max-width: 800px;
    width: 100%;
    max-height: calc(100vh - 40px);
    overflow: hidden;
    position: relative;
    transform: scale(0.8);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    margin: auto;
    display: flex;
    flex-direction: column;
}

.generic-modal-overlay.active .generic-modal-container {
    transform: scale(1);
}

/* Ensure perfect centering */
.generic-modal-overlay {
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile browsers */
}

/* ===== GENERIC MODAL HEADER ===== */
.generic-modal-header {
    margin-bottom: 30px;
    text-align: center;
    flex-shrink: 0;
}

.generic-modal-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 28px;
    line-height: 1.3;
    color: #030712;
    margin: 0 0 10px 0;
}

.generic-modal-description {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.5;
    color: #6b7280;
    margin: 0;
}

/* ===== GENERIC MODAL CONTENT ===== */
.generic-modal-content {
    margin-bottom: 30px;
    min-height: 200px;
    overflow-y: auto;
    flex: 1;
    padding-right: 10px;
    margin-right: -10px;
}

/* Custom scrollbar for modal content */
.generic-modal-content::-webkit-scrollbar {
    width: 6px;
}

.generic-modal-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.generic-modal-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.generic-modal-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ===== GENERIC MODAL ACTIONS ===== */
.generic-modal-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    margin-top: auto;
}

.generic-modal-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
    height: 48px;
    justify-content: center;
    min-width: 120px;
}

.generic-modal-btn-secondary {
    background: #ffffff;
    border: 1px solid #d1d5db;
    color: #374151;
}

.generic-modal-btn-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.generic-modal-btn-primary {
    background: #00275c;
    color: #ffffff;
    border: none;
}

.generic-modal-btn-primary:hover {
    background: #001a3d;
}

.generic-modal-btn-danger {
    background: #ef4444;
    color: #ffffff;
    border: none;
}

.generic-modal-btn-danger:hover {
    background: #dc2626;
}

.generic-modal-btn-icon {
    width: 20px;
    height: 20px;
}

/* ===== GENERIC MODAL CLOSE BUTTON ===== */
.generic-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.generic-modal-close:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.generic-modal-close-icon {
    width: 18px;
    height: 18px;
    color: #6b7280;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .generic-modal-overlay {
        padding: 10px;
    }
    
    .generic-modal-container {
        padding: 30px 20px;
        width: 100%;
        max-height: calc(100vh - 20px);
        margin: 0;
        border-radius: 16px;
    }
    
    .generic-modal-title {
        font-size: 24px;
    }
    
    .generic-modal-content {
        padding-right: 5px;
        margin-right: -5px;
    }
    
    .generic-modal-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .generic-modal-btn {
        width: 100%;
    }
}

/* ===== LEGACY MODAL OVERLAY (for deletion modals) ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 39, 92, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===== LEGACY MODAL CONTAINER (for deletion modals) ===== */
.modal-container {
    background: #ffffff;
    border-radius: 20px;
    padding: 60px 120px;
    max-width: 650px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.8);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

/* ===== MODAL HEADER ===== */
.modal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    margin-bottom: 40px;
}

.modal-icon-container {
    background: #fef2f2;
    border-radius: 100px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
}

.modal-icon {
    width: 40px;
    height: 40px;
    color: #ef4444;
}

.modal-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 30px;
    line-height: 1.3;
    color: #030712;
    margin: 0;
}

.modal-description {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.5;
    color: #030712;
    text-align: center;
    margin: 0;
}

/* ===== MODAL CONTENT BLOCK ===== */
.modal-content-block {
    background: #ffffff;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    width: 100%;
    margin-bottom: 40px;
}

.modal-content-header {
    background: #eff6ff;
    padding: 12px 20px;
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid #f3f4f6;
}

.modal-content-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.5;
    color: #030712;
    margin: 0;
}

.modal-content-body {
    padding: 0;
}

.modal-info-row {
    display: flex;
    border-bottom: 1px solid #f3f4f6;
}

.modal-info-row:last-child {
    border-bottom: none;
}

.modal-info-item {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.modal-info-item:not(:last-child) {
    border-right: 1px solid #f3f4f6;
}

.modal-info-label {
    background: #f9fafb;
    padding: 12px 20px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
    color: #030712;
}

.modal-info-value {
    padding: 0 20px 20px 20px;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.5;
    color: #030712;
}

/* ===== MODAL ACTIONS ===== */
.modal-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
}

.modal-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    border-radius: 12px;
    font-family: 'Marianne', sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
    height: 44px;
    justify-content: center;
}

.modal-btn-secondary {
    background: #ffffff;
    border: 1px solid #00275c;
    color: #172554;
}

.modal-btn-secondary:hover {
    background: #f8fafc;
}

.modal-btn-danger {
    background: #ef4444;
    color: #ffffff;
    border: none;
}

.modal-btn-danger:hover {
    background: #dc2626;
}

.modal-btn-icon {
    width: 20px;
    height: 20px;
}

/* ===== MODAL CLOSE BUTTON ===== */
.modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: #ffffff;
    border: 1px solid #00275c;
    border-radius: 100px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f8fafc;
}

.modal-close-icon {
    width: 16px;
    height: 16px;
    color: #00275c;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .modal-container {
        padding: 40px 20px;
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .modal-title {
        font-size: 24px;
    }
    
    .modal-info-row {
        flex-direction: column;
    }
    
    .modal-info-item:not(:last-child) {
        border-right: none;
        border-bottom: 1px solid #f3f4f6;
    }
    
    .modal-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .modal-btn {
        width: 100%;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}



