/* ============================================
   CUSTOM MODAL SYSTEM
   Modern UI replacement for alert/confirm/prompt
   ============================================ */

/* Base Modal Overlay */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 10000; /* Above toolbar (9999) but below WP admin bar (99999) */
}

.modal.active {
    display: flex !important; /* Show when active class is added */
}

/* Modal Content Container */
.modal-content {
    background: #FFFFFF;
    color: #1f2937;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    background: white;
    border-radius: 12px 12px 0 0;
    z-index: 10;
}

.modal-title {
    margin: 0;
    font-size: 20px;
    color: #000435;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #000435;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: linear-gradient(135deg, #FC8ED6 0%, #FE8088 100%); /* Bubblegum Pink to Coral Pink */
    color: white;
    transform: rotate(90deg);
}

/* Modal Body */
.modal-body {
    padding: 20px;
    color: #1f2937;
    overflow-y: auto;
    flex: 1;
}

/* Modal Footer */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
    background: white;
    border-radius: 0 0 12px 12px;
}

/* Modal Buttons */
.modal-btn {
    padding: 10px 20px;
    border: 2px solid #FE8088; /* Coral Pink outline */
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, #000080 0%, #33A7B5 100%); /* Navy Blue to Teal */
    color: white;
}

.modal-btn-primary {
    background: linear-gradient(135deg, #000080 0%, #33A7B5 100%); /* Navy Blue to Teal */
    color: white;
    border: 2px solid #FE8088; /* Coral Pink outline */
    box-shadow: 0 2px 6px rgba(51, 167, 181, 0.3);
}

.modal-btn-primary:hover {
    background: linear-gradient(135deg, #33A7B5 0%, #000080 100%); /* Reversed gradient */
    box-shadow: 0 4px 10px rgba(51, 167, 181, 0.4), 0 0 12px rgba(254, 128, 136, 0.2);
    transform: translateY(-1px);
}

.modal-btn-secondary {
    background: linear-gradient(135deg, #000080 0%, #33A7B5 100%); /* Navy Blue to Teal */
    color: white;
    border: 2px solid #FE8088; /* Coral Pink outline */
}

.modal-btn-secondary:hover {
    background: linear-gradient(135deg, #33A7B5 0%, #000080 100%); /* Reversed gradient */
    box-shadow: 0 4px 6px rgba(51, 167, 181, 0.3), 0 0 12px rgba(254, 128, 136, 0.2);
    transform: translateY(-1px);
}

/* ============================================
   CUSTOM MODAL ANIMATIONS & CONTENT
   ============================================ */

/* Slide-in animation */
.custom-modal-content {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Message */
.modal-message {
    font-size: 16px;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 20px;
    white-space: pre-line;
}

/* Modal Input (for prompt) */
.modal-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
    margin-top: 10px;
}

.modal-input:focus {
    border-color: #33A7B5;
    box-shadow: 0 0 0 3px rgba(51, 167, 181, 0.1);
}

/* Modal Select (for dropdown) */
.modal-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
    margin-top: 10px;
    background: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23374151' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.modal-select:focus {
    border-color: #33A7B5;
    box-shadow: 0 0 0 3px rgba(51, 167, 181, 0.1);
}

.modal-select:hover {
    border-color: #9ca3af;
}

/* Option Description */
.modal-option-description {
    margin-top: 12px;
    padding: 12px 16px;
    background: #f9fafb;
    border-left: 4px solid #33A7B5;
    border-radius: 6px;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
    min-height: 48px;
}

.modal-option-description em {
    font-style: italic;
    color: #9ca3af;
}

/* ============================================
   MODAL CHOICES (Radio/Checkbox Options)
   ============================================ */

.modal-choices {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.modal-choice-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.modal-choice-option:hover {
    border-color: #33A7B5;
    background: #f0f9fa;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.modal-choice-option input[type="radio"],
.modal-choice-option input[type="checkbox"] {
    margin-top: 3px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #33A7B5;
}

.modal-choice-content {
    flex: 1;
}

.modal-choice-label {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
    font-size: 15px;
}

.modal-choice-description {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
}

/* Selected state */
.modal-choice-option:has(input:checked) {
    border-color: #33A7B5;
    background: linear-gradient(135deg, rgba(51, 167, 181, 0.05) 0%, rgba(0, 0, 128, 0.05) 100%);
    box-shadow: 0 0 0 1px rgba(51, 167, 181, 0.2);
}

/* ============================================
   REPORT MODAL SPECIFIC STYLES
   ============================================ */

#report-modal .modal-content {
    max-width: 900px;
    width: 95%;
}

.report-header {
    border-bottom: 3px solid #33A7B5;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.report-title {
    font-size: 24px;
    color: #33A7B5;
    margin: 0 0 5px 0;
    font-weight: 700;
}

.report-meta {
    color: #6b7280;
    font-size: 14px;
}

.report-section {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.report-section:last-child {
    border-bottom: none;
}

.report-section .section-title {
    font-size: 18px;
    color: #33A7B5;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 8px;
    margin-bottom: 15px;
    background: transparent;
}

.report-section .info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.report-section .info-item {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.report-section .info-label {
    font-weight: 600;
    color: #374151;
    min-width: 120px;
}

.report-section .info-value {
    color: #1f2937;
}

.report-section .facility-card {
    background: #f9fafb;
    border-left: 4px solid #33A7B5;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 0 8px 8px 0;
}

.report-section .facility-name {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.report-section .list-section {
    margin-top: 12px;
}

.report-section .list-title {
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    font-size: 14px;
}

.report-section .list-items {
    margin: 0;
    padding-left: 20px;
    color: #1f2937;
}

.report-section .list-items li {
    padding: 3px 0;
    font-size: 14px;
}

.report-section .subsection-title {
    font-size: 15px;
    color: #6b7280;
    font-weight: 600;
    margin: 15px 0 10px 0;
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */

/* Tablet & smaller */
@media (max-width: 768px) {
    .modal-content {
        width: 90%;
        max-width: 700px;
    }

    .report-section .info-grid {
        grid-template-columns: 1fr;
    }

    .report-section .info-item {
        flex-direction: column;
        gap: 2px;
    }

    .report-section .info-label {
        min-width: auto;
    }
}

/* Mobile */
@media (max-width: 640px) {
    .modal-content {
        width: 95%;
        max-width: 100%;
        margin: 10px;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 15px;
    }

    .modal-title {
        font-size: 18px;
    }

    .modal-footer {
        flex-direction: column;
        gap: 8px;
    }

    .modal-btn {
        width: 100%;
        padding: 12px 16px;
    }

    .modal-input,
    .modal-select {
        font-size: 16px; /* Prevent zoom on mobile */
        padding: 14px;
    }

    .modal-choice-option {
        padding: 14px;
    }

    .modal-choices {
        gap: 10px;
    }
}
