/* Common modal styles */

/* Modal enhancements */
.modal-content {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
    padding: 1rem 1.5rem;
}

.modal-title {
    font-weight: 600;
    color: #212529;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
    padding: 1rem 1.5rem;
}

/* Modal animations */
.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
    transform: translate(0, -50px);
}

.modal.show .modal-dialog {
    transform: none;
}

/* Border animation for modals */
@keyframes borderAnimation {
    0% {
        border: 2px solid transparent;
    }
    100% {
        border: 2px solid #0d6efd;
    }
}

.modal.show .modal-content {
    animation: borderAnimation 0.3s ease-in-out;
    animation-fill-mode: forwards;
}

/* Modal backdrop blur effect */
.modal-backdrop.show {
    backdrop-filter: blur(2px);
    background-color: rgba(0, 0, 0, 0.5);
}

/* Delete modal specific styles */
.modal-content.delete-modal {
    border-top: 4px solid #dc3545;
}

.modal-content.delete-modal .modal-header {
    background-color: #f8d7da;
    border-bottom-color: #f5c6cb;
}

.modal-content.delete-modal .modal-title {
    color: #721c24;
}

/* Success modal specific styles */
.modal-content.success-modal {
    border-top: 4px solid #28a745;
}

.modal-content.success-modal .modal-header {
    background-color: #d4edda;
    border-bottom-color: #c3e6cb;
}

.modal-content.success-modal .modal-title {
    color: #155724;
}

/* Info modal specific styles */
.modal-content.info-modal {
    border-top: 4px solid #17a2b8;
}

.modal-content.info-modal .modal-header {
    background-color: #d1ecf1;
    border-bottom-color: #bee5eb;
}

.modal-content.info-modal .modal-title {
    color: #0c5460;
}

/* Modal form styles */
.modal-body .form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.modal-body .form-control,
.modal-body .form-select {
    border-radius: 0.375rem;
    border-color: #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.modal-body .form-control:focus,
.modal-body .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Modal responsive adjustments */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-content {
        border-radius: 0.375rem;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
}

/* Loading state for modal buttons */
.modal-footer .btn.loading {
    position: relative;
    color: transparent;
}

.modal-footer .btn.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1rem;
    height: 1rem;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}