/**
 * MLD Public Records Integration - Styles
 *
 * Displays public records data (assessment, tax, sale history) on property detail pages.
 *
 * @package MLS_Listings_Display
 * @since 6.79.0
 */

.mld-public-records-section {
    margin: 30px 0;
    padding: 0;
}

.mld-pr-section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

.mld-pr-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
}

.mld-pr-card h3,
.mld-pr-card-header {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: #1a1a2e;
}

.mld-pr-card-warning {
    border-color: #f59e0b;
    background: #fffbeb;
}

.mld-pr-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mld-pr-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f3f4f6;
}

.mld-pr-row:last-child {
    border-bottom: none;
}

.mld-pr-label {
    color: #6b7280;
    font-size: 14px;
}

.mld-pr-value {
    font-weight: 500;
    color: #1a1a2e;
    font-size: 14px;
}

.mld-pr-highlight {
    background: #f0f9ff;
    border-radius: 6px;
    padding: 10px !important;
    margin: 4px -4px;
}

.mld-pr-highlight .mld-pr-value {
    font-size: 16px;
    font-weight: 700;
    color: #1e40af;
}

/* Tables */
.mld-pr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.mld-pr-table th {
    text-align: left;
    padding: 8px 12px;
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
    font-weight: 600;
    color: #374151;
    font-size: 13px;
}

.mld-pr-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f3f4f6;
}

.mld-pr-table tbody tr:hover {
    background: #f9fafb;
}

.mld-pr-mismatch {
    background: #fef2f2 !important;
}

.mld-pr-mismatch:hover {
    background: #fee2e2 !important;
}

.mld-pr-discrepancy-note {
    font-size: 13px;
    color: #92400e;
    margin: 0 0 12px 0;
    padding: 8px 12px;
    background: #fef3c7;
    border-radius: 6px;
}

.mld-pr-match-info {
    text-align: right;
    color: #9ca3af;
    padding: 8px 0;
    font-size: 12px;
}

/* Year-over-year change indicators */
.mld-pr-change-up {
    color: #dc2626;
    font-weight: 500;
    font-size: 13px;
}

.mld-pr-change-down {
    color: #16a34a;
    font-weight: 500;
    font-size: 13px;
}

/* Registry of Deeds links in sale history */
.mld-pr-table a {
    color: #2563eb;
    text-decoration: none;
}

.mld-pr-table a:hover {
    text-decoration: underline;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .mld-pr-table {
        font-size: 12px;
    }

    .mld-pr-table th,
    .mld-pr-table td {
        padding: 6px 8px;
    }

    .mld-pr-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .mld-pr-value {
        font-size: 15px;
    }

    /* Collapsible sections on mobile */
    .mld-pr-collapsible .mld-pr-card-header {
        cursor: pointer;
        position: relative;
        padding-right: 30px;
        user-select: none;
    }

    .mld-pr-collapsible .mld-pr-card-header::after {
        content: '\25BC';
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        font-size: 12px;
        color: #9ca3af;
        transition: transform 0.2s ease;
    }

    .mld-pr-collapsible.collapsed .mld-pr-card-header::after {
        transform: translateY(-50%) rotate(-90deg);
    }

    .mld-pr-collapsible.collapsed .mld-pr-card-body {
        display: none;
    }

    /* Remove padding from card when using header/body structure */
    .mld-pr-collapsible {
        padding: 16px;
    }
}

/* ===========================================================
   Building permit history (added v6.99.66 / BMN-PR v0.4.0)
   =========================================================== */

.mld-pr-empty-note {
    color: #6b7280;
    font-style: italic;
    margin: 0;
    padding: 6px 0;
    font-size: 14px;
}

.mld-pr-permits-table .mld-pr-permit-status-col {
    width: 100px;
    white-space: nowrap;
}

.mld-pr-permits-table .mld-pr-permit-value-col {
    width: 110px;
    text-align: right;
    white-space: nowrap;
}

.mld-pr-permits-table .mld-pr-permit-date {
    white-space: nowrap;
    color: #4b5563;
    vertical-align: top;
    font-size: 13px;
}

.mld-pr-permit-worktype {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.mld-pr-permit-description {
    font-size: 13px;
    color: #374151;
    margin-top: 4px;
    line-height: 1.4;
}

.mld-pr-permit-contractor {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
    font-style: italic;
}

.mld-pr-permit-source-link,
.mld-pr-permit-number {
    display: inline-block;
    margin-top: 4px;
    font-size: 11px;
    color: #6b7280;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.mld-pr-permit-source-link {
    color: #2563eb;
}

.mld-pr-permit-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.mld-pr-permit-status-closed {
    background: #d1fae5;
    color: #047857;
}

.mld-pr-permit-status-open {
    background: #fef3c7;
    color: #92400e;
}

.mld-pr-permit-status-stopwork {
    background: #fee2e2;
    color: #b91c1c;
}

.mld-pr-permit-status-voided {
    background: #e5e7eb;
    color: #4b5563;
    text-decoration: line-through;
}

.mld-pr-permit-status-unknown {
    background: #f3f4f6;
    color: #6b7280;
}

.mld-pr-permit-attribution {
    margin-top: 12px;
    color: #9ca3af;
    text-align: right;
}

@media (max-width: 768px) {
    /* Drop the value column on mobile — re-surface it inline in the type cell */
    .mld-pr-permits-table .mld-pr-permit-value-col {
        display: none;
    }

    .mld-pr-permits-table .mld-pr-permit-status-col {
        width: auto;
    }

    .mld-pr-permits-table .mld-pr-permit-date {
        font-size: 12px;
        width: 70px;
    }

    .mld-pr-permit-description {
        font-size: 12px;
    }
}

