/**
 * Record Preview Modal Styles
 * Modern, clean design for viewing record details with PDF preview
 */

/* Modal Backdrop */
.record-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9998;
    display: none;
    animation: fadeIn 0.2s ease;
}

.record-modal-backdrop.show {
    display: block;
}

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

/* Modal Container */
.record-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.record-modal.show {
    display: flex;
}

/* Modal Dialog */
.record-modal-dialog {
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 1400px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
    position: relative;
}

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

/* Modal Header */
.record-modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.record-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

.record-modal-title i {
    color: #3B82F6;
    font-size: 24px;
}

.record-modal-subtitle {
    margin: 4px 0 0 36px;
    font-size: 13px;
    color: #6B7280;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Header Status Badge */
.header-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.header-status-badge.active {
    background: #D1FAE5;
    color: #065F46;
}

.header-status-badge.pending {
    background: #FEF3C7;
    color: #92400E;
}

.header-status-badge i {
    width: 12px;
    height: 12px;
}

.record-modal-close {
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6B7280;
    transition: all 0.15s ease;
}

.record-modal-close:hover {
    background: #F3F4F6;
    color: #111827;
}

/* Modal Body */
.record-modal-body {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 0;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* Left Panel - Record Details - Single Card with HR Separators */
.record-details-panel {
    border-right: 1px solid #E5E7EB;
    overflow-y: auto;
    background: #F3F4F6;
    padding: 20px;
}

.record-details-section {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.record-details-section:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.record-details-section:last-child {
    margin-bottom: 0;
}

/* Primary Section - Highlighted for main info */
.record-details-section.primary-section {
    background: linear-gradient(135deg, #EFF6FF 0%, #FFFFFF 100%);
    border-color: #BFDBFE;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.1);
}

.record-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 20px;
    padding-bottom: 0;
    border-bottom: none;
}

.record-section-title i {
    font-size: 14px;
    color: #6B7280;
}

.record-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #F3F4F6;
    gap: 16px;
}

.record-detail-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.record-detail-row:first-child {
    padding-top: 0;
}

.record-detail-label {
    font-size: 13px;
    font-weight: 400;
    color: #6B7280;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.5;
    flex-shrink: 0;
}

.record-detail-value {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    word-wrap: break-word;
    line-height: 1.5;
    text-align: right;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
}

.record-detail-value.empty {
    color: #9CA3AF;
    font-style: italic;
    font-weight: 400;
}

/* Special styling for specific values */
.record-detail-value.highlight {
    color: #3B82F6;
    font-size: 15px;
    font-weight: 700;
}

.record-detail-value.amount {
    color: #10B981;
    font-size: 16px;
    font-weight: 700;
}

/* Empty/N/A Value Styling */
.empty-value {
    color: #9CA3AF !important;
    font-style: italic;
    font-weight: 400 !important;
}

/* Highlight Row - Important Information */
.record-detail-row.highlight-row {
    background: #F9FAFB;
    margin: -8px -12px 14px;
    padding: 14px 12px !important;
    border-radius: 8px;
    border-bottom: none !important;
}

/* Status Badge - Card Style */
.record-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: none;
    box-shadow: none;
    border: 1px solid transparent;
}

.record-status-badge.active {
    background: #FEF3C7;
    color: #92400E;
    border-color: #FDE68A;
}

.record-status-badge.pending {
    background: #FEF3C7;
    color: #92400E;
    border-color: #FDE68A;
}

.record-status-badge i {
    font-size: 10px;
}

/* Warning/Alert Badge */
.record-alert-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #FEF3C7;
    border: 1px solid #FDE68A;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 16px;
}

.record-alert-badge i {
    color: #F59E0B;
    font-size: 16px;
    flex-shrink: 0;
}

.record-alert-badge .alert-text {
    font-size: 13px;
    font-weight: 600;
    color: #92400E;
}

.record-alert-badge .alert-label {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.03em;
}

/* Right Panel - PDF Preview */
.record-pdf-panel {
    background: #F3F4F6;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pdf-preview-header {
    padding: 16px 24px;
    background: #FFFFFF;
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.pdf-preview-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}

.pdf-preview-title i {
    color: #3B82F6;
    font-size: 16px;
}

.pdf-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pdf-control-btn {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6B7280;
    transition: all 0.15s ease;
}

.pdf-control-btn:hover:not(:disabled) {
    background: #F9FAFB;
    border-color: #D1D5DB;
    color: #111827;
}

.pdf-control-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pdf-control-btn i {
    font-size: 14px;
}

.pdf-page-info {
    font-size: 13px;
    color: #6B7280;
    font-weight: 500;
    padding: 0 12px;
}

.pdf-zoom-display {
    font-size: 13px;
    color: #6B7280;
    font-weight: 500;
    min-width: 50px;
    text-align: center;
}

.pdf-divider {
    width: 1px;
    height: 24px;
    background: #E5E7EB;
    margin: 0 4px;
}

.pdf-preview-container {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px;
    position: relative;
}

.pdf-canvas-wrapper {
    background: #FFFFFF;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    display: inline-block;
}

#recordPdfCanvas {
    display: block;
    width: 100%;
    height: auto;
}

/* PDF Loading State */
.pdf-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #6B7280;
}

.pdf-loading i {
    font-size: 48px;
    margin-bottom: 12px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.pdf-loading p {
    font-size: 14px;
    font-weight: 500;
}

/* PDF Error State */
.pdf-error {
    text-align: center;
    padding: 40px;
    color: #DC2626;
}

.pdf-error i {
    font-size: 48px;
    margin-bottom: 12px;
}

.pdf-error p {
    font-size: 14px;
    font-weight: 500;
}

/* Modal Footer */
.record-modal-footer {
    padding: 20px 32px;
    border-top: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
    background: #F9FAFB;
}

.record-modal-footer-left {
    display: flex;
    gap: 8px;
}

.record-modal-footer-right {
    display: flex;
    gap: 8px;
}

.modal-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
}

.modal-btn i {
    font-size: 16px;
}

.modal-btn-primary {
    background: #3B82F6;
    color: #FFFFFF;
}

.modal-btn-primary:hover {
    background: #2563EB;
}

.modal-btn-success {
    background: #10B981;
    color: #FFFFFF;
}

.modal-btn-success:hover {
    background: #059669;
}

.modal-btn-danger {
    background: #EF4444;
    color: #FFFFFF;
}

.modal-btn-danger:hover {
    background: #DC2626;
}

.modal-btn-outline {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    color: #6B7280;
}

.modal-btn-outline:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
    color: #111827;
}

/* Keyboard Shortcut Badge */
.btn-shortcut {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 8px;
    letter-spacing: 0.02em;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .record-modal-dialog {
        max-width: 95%;
    }

    .record-modal-body {
        grid-template-columns: 350px 1fr;
    }
}

@media (max-width: 968px) {
    .record-modal-body {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .record-details-panel {
        border-right: none;
        border-bottom: 1px solid #E5E7EB;
        max-height: 300px;
    }

    .record-modal-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .record-modal-footer-left,
    .record-modal-footer-right {
        width: 100%;
        justify-content: center;
    }

    .modal-btn {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .record-modal {
        padding: 0;
    }

    .record-modal-dialog {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .record-modal-header {
        padding: 16px 20px;
    }

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

    .record-details-section {
        padding: 16px 20px;
    }

    .pdf-preview-container {
        padding: 16px;
    }

    .record-modal-footer {
        padding: 16px 20px;
    }

    .modal-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* Custom Scrollbar */
.record-details-panel::-webkit-scrollbar,
.pdf-preview-container::-webkit-scrollbar {
    width: 8px;
}

.record-details-panel::-webkit-scrollbar-track,
.pdf-preview-container::-webkit-scrollbar-track {
    background: #F3F4F6;
}

.record-details-panel::-webkit-scrollbar-thumb,
.pdf-preview-container::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 4px;
}

.record-details-panel::-webkit-scrollbar-thumb:hover,
.pdf-preview-container::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}
