/**
 * Unified Modal Styles
 * All modals in the application should use these consistent styles
 * 
 * Color Coding:
 * - Normal: Blue (Wowate primary)
 * - Informative: Gray (Wowate secondary)
 * - Warning/Error: Orange
 * - Critical: Red
 */

/* Override Bootstrap modal defaults for consistency */
.modal-dialog {
    max-width: 600px;
}

.modal-dialog-centered {
    min-height: calc(100% - 3.5rem);
}

.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* Modal Headers - Unified gradient style */
.modal-header {
    border: none;
    border-radius: 12px 12px 0 0;
    padding: 1.5rem 2rem;
}

/* Color variants for modal headers - WOWATE COLORS */
.modal .modal-header.modal-primary {
    background: linear-gradient(135deg, #0fb6cc 0%, #2E86AB 100%) !important; /* Wowate Blue - Normal */
    color: white !important;
}

.modal .modal-header.modal-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%) !important;
    color: white !important;
}

.modal .modal-header.modal-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%) !important; /* Orange - Warning/Error */
    color: white !important;
}

.modal .modal-header.modal-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important; /* Red - Critical */
    color: white !important;
}

.modal .modal-header.modal-info {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%) !important; /* Gray - Informative */
    color: white !important;
}

.modal .modal-header.modal-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%) !important; /* Gray - Informative */
    color: white !important;
}

.modal .modal-header.modal-dark {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%) !important;
    color: white !important;
}

.modal .modal-header.modal-light {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    color: #495057 !important;
}

/* Modal title - consistent sizing */
.modal-header .modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-header .modal-title i {
    font-size: 1.1rem;
}

/* Close button for colored headers */
.modal .modal-header .btn-close {
    filter: brightness(0) invert(1) !important;
    opacity: 0.8 !important;
}

.modal .modal-header .btn-close:hover {
    opacity: 1 !important;
}

.modal .modal-header.modal-light .btn-close,
.modal .modal-header.modal-warning .btn-close {
    filter: none !important;
    opacity: 0.6 !important;
}

.modal .modal-header.modal-light .btn-close:hover,
.modal .modal-header.modal-warning .btn-close:hover {
    opacity: 1 !important;
}

/* Modal body - consistent padding */
.modal-body {
    padding: 2rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Info boxes inside modals */
.modal-body .alert {
    border-radius: 8px;
    margin-bottom: 1rem;
}

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

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

.modal-body .alert ul li {
    margin-bottom: 0.25rem;
}

/* Modal footer - consistent styling */
.modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 1rem 2rem;
    border-radius: 0 0 12px 12px;
    gap: 0.5rem;
}

/* Progress bars in modals */
.modal-body .progress {
    height: 25px;
    border-radius: 8px;
    background-color: #e9ecef;
    overflow: hidden;
}

.modal-body .progress-bar {
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.3s ease;
}

/* Form elements in modals */
.modal-body .form-control,
.modal-body .form-select {
    border-radius: 6px;
    border: 1px solid #ced4da;
    padding: 0.625rem 0.875rem;
}

.modal-body .form-control:focus,
.modal-body .form-select:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.modal-body .form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #495057;
}

/* Buttons in modal footer */
.modal-footer .btn {
    min-width: 120px;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    border-radius: 6px;
}

.modal-footer .btn i {
    margin-right: 0.375rem;
}

/* Large modals */
.modal-dialog.modal-lg {
    max-width: 800px;
}

.modal-dialog.modal-xl {
    max-width: 90%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-header {
        padding: 1.25rem 1.5rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-footer {
        padding: 1rem 1.5rem;
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
        min-width: unset;
    }
}

/* Animation improvements */
.modal.fade .modal-dialog {
    transition: transform 0.2s ease-out;
}

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

/* Backdrop */
.modal-backdrop.show {
    opacity: 0.6;
}
