/* Modal Popup System - PC Evidence Portal */

/* Modal Overlay (backdrop) */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6); /* Dark semi-transparent backdrop */
    animation: fadeIn 0.2s ease-in-out;
}

/* Modal Content Box */
.modal-content {
    background-color: #ffffff;
    margin: 3% auto;
    padding: 0;
    border: none;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease-out;
    position: relative;
}

/* Modal Header */
.modal-header {
    background: linear-gradient(135deg, #1a4d7a, #2874a6);
    color: white;
    padding: 25px 30px;
    border-radius: 12px 12px 0 0;
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.6em;
    color: white;
}

/* Close Button (X) */
.modal-close {
    color: white;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.modal-close:hover,
.modal-close:focus {
    background: rgba(255, 255, 255, 0.2);
}

/* Modal Body */
.modal-body {
    padding: 30px;
    font-size: 1.05em;
    line-height: 1.8;
    color: #2c3e50;
}

/* Modal Footer (optional) */
.modal-footer {
    background: #f8f9fa;
    padding: 20px 30px;
    border-radius: 0 0 12px 12px;
    text-align: right;
    border-top: 1px solid #dee2e6;
}

.modal-footer .btn {
    margin-left: 10px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Modal Link Styling (triggers) */
a.modal-link {
    color: #2874a6;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s;
    cursor: pointer;
}

a.modal-link:hover {
    border-bottom-color: #2874a6;
}

a.modal-link::before {
    content: "📋 ";
    opacity: 0.8;
}

/* Scrollbar Styling for Modal */
.modal-content::-webkit-scrollbar {
    width: 10px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 12px 12px 0;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #2874a6;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #1a4d7a;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 20px;
    }
    
    .modal-header h3 {
        font-size: 1.3em;
    }
    
    .modal-body {
        padding: 20px;
        font-size: 1em;
    }
    
    .modal-close {
        font-size: 28px;
        width: 35px;
        height: 35px;
    }
}

/* Tablet Landscape (iPad) */
@media (min-width: 769px) and (max-width: 1024px) {
    .modal-content {
        width: 85%;
        max-width: 750px;
    }
}

/* Print - Hide Modals */
@media print {
    .modal {
        display: none !important;
    }
}

/* Body No-Scroll (when modal open) */
body.modal-open {
    overflow: hidden;
}

/* Special Modal Content Styling */

/* Projection Table in Modal */
.modal-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.95em;
}

.modal-body table th,
.modal-body table td {
    padding: 12px;
    border: 1px solid #dee2e6;
    text-align: left;
    vertical-align: top;
}

.modal-body table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #1a4d7a;
}

.modal-body table tr:nth-child(even) {
    background: #f8f9fa;
}

/* Quote Boxes in Modal */
.modal-body .quote-box {
    background: #f8f9fa;
    border-left: 5px solid #2874a6;
    padding: 20px;
    margin: 20px 0;
    font-family: 'Courier New', monospace;
}

/* Evidence Items in Modal */
.modal-body .evidence-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 15px;
    margin: 15px 0;
}

/* Highlight Boxes in Modal */
.modal-body .highlight-red {
    background-color: #ffe6e6;
    padding: 2px 4px;
    border-radius: 3px;
}

.modal-body .highlight-yellow {
    background-color: #fff9e6;
    padding: 2px 4px;
    border-radius: 3px;
}

.modal-body .highlight-blue {
    background-color: #e6f2ff;
    padding: 2px 4px;
    border-radius: 3px;
}

.modal-body .highlight-pink {
    background-color: #ffe6f0;
    padding: 2px 4px;
    border-radius: 3px;
}

/* ============================================================
   SETTLEMENT PDF MODAL
   ============================================================ */

.pdf-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.pdf-modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 95%;
    max-height: 95vh;
    width: 1200px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pdf-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.pdf-modal-close {
    background: #f5f5f5;
    border: none;
    font-size: 1.8em;
    cursor: pointer;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    color: #666;
    transition: all 0.2s;
    line-height: 1;
}

.pdf-modal-close:hover {
    background: #e0e0e0;
    color: #333;
    transform: scale(1.1);
}

.pdf-modal-body {
    overflow-y: auto;
    flex: 1;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Responsive */
@media (max-width: 768px) {
    .pdf-modal-content {
        max-width: 98%;
        max-height: 98vh;
        padding: 1rem;
    }
    
    .pdf-modal-header h2 {
        font-size: 1.1em !important;
    }
}
