/**
 * Custom Modal Styles
 * Reusable modal component styling - Matched with project design system
 * Uses Inter font globally (same as login page)
 */

/* Modal Overlay - Global font from login page */
.modal,
.modal * {
    font-family: 'Inter', sans-serif !important;
}

.modal {
    z-index: 1055;
}

.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

/* Modal Content */
.modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 27px 0 rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    background: #ffffff;
}

/* Modal Header */
.modal-header {
    background: linear-gradient(to right, #0575E6, #003b5c);
    color: #ffffff;
    border-bottom: none;
    padding: 1.25rem 1.5rem;
    position: relative;
}

.modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.modal-header .modal-title {
    color: #ffffff;
    font-weight: 600;
    font-size: 1.125rem;
    margin: 0;
    letter-spacing: -0.2px;
}

.modal-header .btn-close {
    opacity: 0.9;
    transition: opacity 0.2s ease;
    padding: 0.5rem;
    margin: -0.5rem -0.5rem -0.5rem auto;
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e");
    background-size: 1em;
    background-repeat: no-repeat;
    background-position: center;
    border: 0;
    border-radius: 0.375rem;
    width: 1em;
    height: 1em;
}

.modal-header .btn-close:hover {
    opacity: 1;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e");
}

.modal-header .btn-close:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
    outline: none;
}

/* Modal Body */
.modal-body {
    padding: 1.5rem;
    color: #344767;
    font-size: 0.875rem;
    line-height: 1.6;
}

.modal-body p {
    margin-bottom: 0.75rem;
    color: #344767;
}

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

.modal-body ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.modal-body ul li {
    margin-bottom: 0.5rem;
    color: #344767;
}

.modal-body .alert {
    border-radius: 8px;
    border: none;
    padding: 0.75rem 1rem;
    margin-bottom: 0;
}

.modal-body .alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

.modal-body .alert-warning i {
    color: #ff9800;
}

/* Modal Alert Warning - White text variant (for use in modals with colored backgrounds) */
.modal-alert-warning {
    background-color: rgba(255, 193, 7, 0.2) !important;
    border: 1px solid rgba(255, 193, 7, 0.3) !important;
    color: #ffffff !important;
}

.modal-alert-warning small {
    color: #ffffff !important;
}

.modal-alert-warning i {
    color: #ffc107 !important;
}

.modal-alert-warning strong {
    color: #ffffff !important;
    font-weight: 600 !important;
}

/* Font Awesome Icons in Modal Body - Global styling */
.modal-body .fa-solid,
.modal-body .fa-regular,
.modal-body .fa-brands,
.modal-body i[class*="fa-"] {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 6 Brands", "FontAwesome" !important;
    font-weight: 900 !important;
    font-style: normal !important;
    display: inline-block !important;
    font-size: inherit !important;
}

.modal-body .fa-regular {
    font-weight: 400 !important;
}

.modal-body .fa-brands {
    font-weight: 400 !important;
    font-family: "Font Awesome 6 Brands" !important;
}

/* Specific styling for icons in alerts */
.modal-alert-warning .fa-solid,
.modal-alert-warning .fa-regular,
.modal-alert-warning i[class*="fa-"] {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 6 Brands", "FontAwesome" !important;
    font-weight: 900 !important;
    font-style: normal !important;
    display: inline-block !important;
    color: #ffffff !important;
}

/* Modal Footer */
.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 1.5rem;
    background-color: #f8f9fa;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Center align button when there's only one button */
.modal-footer .btn:only-child {
    margin-left: auto;
    margin-right: auto;
}

.modal-footer .btn {
    min-width: 100px;
    font-weight: 600;
    padding: 0.625rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-footer .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.modal-footer .btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Button Styles - Match project design */
.modal-footer .btn.bg-gradient-primary {
    background: linear-gradient(135deg, #2C4FCF 0%, #6B66E8 100%);
    color: #ffffff;
    box-shadow: 0 4px 6px rgba(5, 117, 230, 0.3);
}

.modal-footer .btn.bg-gradient-primary:hover {
    box-shadow: 0 6px 12px rgba(5, 117, 230, 0.4);
    color: #ffffff;
}

.modal-footer .btn.bg-gradient-secondary {
    background: linear-gradient(45deg, #6c757d, #5a6268);
    color: #ffffff;
    box-shadow: 0 4px 6px rgba(108, 117, 125, 0.3);
}

.modal-footer .btn.bg-gradient-secondary:hover {
    box-shadow: 0 6px 12px rgba(108, 117, 125, 0.4);
    color: #ffffff;
}

/* Icon in Modal Header - Global Font Awesome styling */
.modal-header .fa-solid,
.modal-header .modal-header-icon,
.modal-header i[class*="fa-"] {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    color: #ffffff !important;
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 6 Brands", "FontAwesome" !important;
    font-weight: 900 !important;
    font-style: normal !important;
    display: inline-block !important;
    font-size: 1.5rem !important;
}

.modal-header-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Success Modal Variant */
.modal-success .modal-header {
    background: linear-gradient(to right, #4CAF50, #2E7D32);
}

/* Warning Modal Variant */
.modal-warning .modal-header {
    background: linear-gradient(to right, #FF9800, #F57C00);
}

/* Error/Danger Modal Variant */
.modal-danger .modal-header {
    background: linear-gradient(to right, #F44336, #C62828);
}

/* Info Modal Variant */
.modal-info .modal-header {
    background: linear-gradient(to right, #2196F3, #1565C0);
}

/* Loading State */
.modal-loading .modal-body {
    text-align: center;
    padding: 2rem;
}

.modal-loading .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3rem;
    color: #0575E6;
}

/* Success Icon in Modal Body */
.modal-body .fa-circle-check {
    color: #4CAF50;
}

/* Responsive */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-content {
        border-radius: 12px;
    }
    
    .modal-header {
        padding: 1rem 1.25rem;
    }
    
    .modal-header .modal-title {
        font-size: 1rem;
    }
    
    .modal-body {
        padding: 1.25rem;
        font-size: 0.8125rem;
    }
    
    .modal-footer {
        padding: 0.75rem 1.25rem;
        flex-direction: column-reverse;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin: 0;
    }
    
    .modal-footer .btn:first-child {
        margin-top: 0.5rem;
    }
}

/* Animation */
.modal.fade .modal-dialog {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translate(0, -50px);
}

.modal.show .modal-dialog {
    transform: translate(0, 0);
}

.modal.fade .modal-backdrop {
    transition: opacity 0.15s linear;
}

/* Focus styles for accessibility */
.modal-footer .btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(5, 117, 230, 0.25);
}

.modal-footer .btn.bg-gradient-primary:focus {
    box-shadow: 0 0 0 3px rgba(5, 117, 230, 0.25), 0 4px 6px rgba(5, 117, 230, 0.3);
}

.modal-footer .btn.bg-gradient-secondary:focus {
    box-shadow: 0 0 0 3px rgba(108, 117, 125, 0.25), 0 4px 6px rgba(108, 117, 125, 0.3);
}
