/* ===== SEARCH PROPERTY SALES — PAGE-SPECIFIC STYLES ===== */
/* Depends on HeaderModern.css and SharedModern.css being loaded first */

/* ===== HERO SUBTITLE (matches ParcelSearchModern.css) ===== */
.hero-subtitle {
    font-size: 15px !important;
    color: rgba(255, 255, 255, 0.95) !important; /* WCAG 1.4.3: ~6.8:1 on hero gradient ✓ */
    max-width: 620px;
    margin: 4px 0 0 0 !important;
    line-height: 1.5;
}

/* ===== TEXT-SIZE BAR — right-aligned, no back link ===== */
.page-top-bar.right-only {
    display: flex !important;
    justify-content: flex-end !important;
}

/* ===== SEARCH CARD ===== */
/* Matches ParcelSearchModern.css card pattern */
.search-card {
    background: #ffffff;
    border: 1px solid #dde5f4;
    border-radius: 6px;
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.search-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 24px;
    background: #1260cc;
    color: #ffffff;
}

.search-card-header.teal { background: #0b7a6e; }

.search-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    font-size: 22px;
}

.search-card-header-text h2 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
}

.search-card-header-text p {
    margin: 0;
    font-size: 13px;
    color: #ffffff; /* WCAG 1.4.3: 5.2:1 on #0b7a6e ✓ */
    line-height: 1.4;
}

/* Expand / Collapse toggle button — right side of header */
.search-card-toggle-btn {
    margin-left: auto;
    align-self: center;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.22);  /* dark overlay → effective bg ~#085f54, white text = 7.6:1 ✓ */
    border: 1px solid rgba(255, 255, 255, 0.65);
    color: #ffffff;
    padding: 5px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}
.search-card-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.10);
}
.search-card-toggle-btn:focus {
    outline: 3px solid rgba(255, 255, 255, 0.7);
    outline-offset: 2px;
}

/* Collapsed state — body hidden, header border-radius stays full */
.search-card.collapsed .search-card-body {
    display: none;
}
.search-card.collapsed {
    border-radius: 6px;
    overflow: hidden;
}

.search-card-body {
    padding: 24px;
}

/* ===== FORM LAYOUT ===== */
fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.field label,
.field > span.label,
.field > asp\:label {
    font-size: 14px;
    font-weight: 600;
    color: #0d1f47;
}

/* Target ASP.NET Label rendered as span inside .field */
.field > span {
    font-size: 14px;
    font-weight: 600;
    color: #0d1f47;
    display: block;
}

.field select,
.field input[type="text"] {
    padding: 9px 12px;
    border: 1px solid #c8d4e8;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    color: #0d1f47;
    background: #ffffff;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
    box-sizing: border-box;
}

.field select:focus,
.field input[type="text"]:focus {
    outline: none;
    border-color: #0b7a6e;
    box-shadow: 0 0 0 3px rgba(11, 122, 110, 0.12);
}

/* Native HTML5 date input */
.date-input {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    border: 1px solid #c8d4e8;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    color: #0d1f47;
    background: #ffffff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.date-input:focus {
    outline: none;
    border-color: #0b7a6e;
    box-shadow: 0 0 0 3px rgba(11, 122, 110, 0.12);
}

/* Checkbox row */
.field-row-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.field-row-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #0b7a6e;
    cursor: pointer;
    flex-shrink: 0;
}

.field-row-checkbox span {
    font-size: 14px;
    color: #0d1f47;
    cursor: pointer;
}

/* ===== BUTTONS ===== */
.btn-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.btn-primary,
input.btn-primary[type="submit"],
a.btn-primary {
    background: #1260cc;
    color: #ffffff !important;
    border: none;
    border-radius: 4px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.15s;
}
.btn-primary:hover { background: #0e4aa0; }
.btn-primary:focus { outline: 3px solid #0b7a6e; outline-offset: 2px; }

.btn-secondary,
input.btn-secondary[type="submit"] {
    background: #f0f3fa;
    color: #0d1f47 !important;
    border: 1px solid #c8d4e8;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.15s;
}
.btn-secondary:hover { background: #e2e8f5; }
.btn-secondary:focus { outline: 3px solid #0b7a6e; outline-offset: 2px; }

.btn-teal,
input.btn-teal[type="submit"] {
    background: #0b7a6e;
    color: #ffffff !important;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.15s;
}
.btn-teal:hover { background: #085e54; }
.btn-teal:focus { outline: 3px solid #0b7a6e; outline-offset: 2px; }

/* ===== ERROR MESSAGE ===== */
.sales-error-message {
    display: block;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #dc2626;
    color: #7f1d1d;
    padding: 10px 14px;
    border-radius: 3px;
    margin: 12px 0;
    font-size: 14px;
}

/* ===== RESULTS ACTIONS BAR ===== */
.results-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    flex-wrap: wrap;
}

.field-tip {
    font-size: 13px;
    color: #445571;
    font-style: italic;
}

/* ===== RESULTS SECTION ===== */
.results-section {
    margin-top: 8px;
}

/* ===== MAP VIEW (toggled by View Map / View Transactions button) ===== */
.map-container {
    width: 100%;
    border: 1px solid #dde5f4;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    margin-top: 8px;
    background: #f8fafd;
}

.map-container iframe {
    display: block;
    width: 100%;
    height: 640px;
    border: none;
}

/* Scrollable wrapper so wide table doesn't break layout on smaller screens */
.results-table-scroll {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #dde5f4;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* After JS moves pagination outside, flatten the bottom edge of the scroll wrapper
   so it visually connects with the pagination bar below it */
.results-table-scroll.has-external-pager {
    border-radius: 6px 6px 0 0;
    border-bottom: none;
}

/* ===== GRIDVIEW TABLE OVERRIDES ===== */
table.sales-grid {
    width: 100% !important;
    border-collapse: collapse;
    font-size: 13px;
    color: #0d1f47;
    background: #ffffff;
    min-width: 1200px; /* ensures horizontal scroll before crushing columns */
}

/* Header row */
table.sales-grid .sales-grid-header,
table.sales-grid th {
    background: #e8ecf5 !important;
    color: #0d1f47 !important;
    font-weight: 600;
    font-size: 12px;
    padding: 10px 10px !important;
    border-bottom: 2px solid #c8d4e8 !important;
    border-right: 1px solid #dde5f4 !important;
    text-align: center;
    white-space: nowrap;
}

/* Sort link buttons in header */
table.sales-grid th a,
table.sales-grid th .sales-grid-header a {
    color: #0d1f47 !important;
    text-decoration: none;
    font-weight: 600;
}
table.sales-grid th a:hover {
    color: #0b7a6e !important;
    text-decoration: underline;
}

/* Data rows */
table.sales-grid .sales-grid-row td,
table.sales-grid tr.sales-grid-row td {
    background: #ffffff !important;
    padding: 9px 10px !important;
    border-bottom: 1px solid #eef1f9 !important;
    border-right: 1px solid #f0f3fa !important;
    vertical-align: top;
    font-size: 13px;
    line-height: 1.4;
    white-space: nowrap;
}

table.sales-grid .sales-grid-row-alt td,
table.sales-grid tr.sales-grid-row-alt td {
    background: #f5f7fc !important;
    padding: 9px 10px !important;
    border-bottom: 1px solid #eef1f9 !important;
    border-right: 1px solid #f0f3fa !important;
    vertical-align: top;
    font-size: 13px;
    line-height: 1.4;
    white-space: nowrap;
}

/* Address column (3rd td) can wrap — addresses are intentionally long */
table.sales-grid td:nth-child(3) {
    white-space: normal;
    min-width: 160px;
}

table.sales-grid tr:hover td {
    background: #eef3fb !important;
}

/* Links inside grid rows */
table.sales-grid td a {
    color: #1260cc;
    text-decoration: underline;
}
table.sales-grid td a:hover {
    color: #0b7a6e;
}

/* ===== PAGINATION (GridView PagerTemplate) ===== */
.pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 12px;
    flex-wrap: wrap;
    justify-content: center;
    background: #f8fafd;
    border-top: 1px solid #dde5f4;
}

/* When JS has moved .pagination outside .results-table-scroll it gets its own
   border on the left/right/bottom so it visually connects to the table above */
.pagination.pagination-outside {
    border: 1px solid #dde5f4;
    border-top: none;          /* top edge is already the scroll wrapper's border */
    border-radius: 0 0 6px 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.pagination a,
.pagination input[type="submit"] {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid #c8d4e8;
    border-radius: 4px;
    color: #0b7a6e;
    text-decoration: none;
    font-size: 13px;
    background: #ffffff;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.pagination a:hover,
.pagination input[type="submit"]:hover {
    background: #0b7a6e;
    color: #ffffff;
    border-color: #0b7a6e;
}

.pagination .pagination-current {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 4px;
    background: #0b7a6e;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
}

.pagination .pagination-ellipsis {
    color: #445571;
    font-size: 14px;
    padding: 0 4px;
}

/* ===== LOADING INDICATOR ===== */
.loading-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    color: #445571;
    font-size: 14px;
}

/* ===== ACCESSIBILITY ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:focus-visible {
    outline: 3px solid #0b7a6e;
    outline-offset: 2px;
}

/* ===== RESPONSIVE ===== */
@media screen and (max-width: 768px) {
    .search-card-body { padding: 16px; }

    .form-row-2 {
        grid-template-columns: 1fr;
    }

    .results-actions-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-row {
        flex-direction: column;
        width: 100%;
    }

    .btn-primary,
    .btn-secondary,
    .btn-teal {
        width: 100%;
        text-align: center;
    }
}

@media screen and (max-width: 560px) {
    .search-card-header { padding: 14px 16px; }
    .search-card-body   { padding: 12px; }

    .search-card-header-text h2 { font-size: 16px; }
}
