/**
 * JEA Cards Layout — Properties card grid with sidebar filters.
 *
 * @package     Joomla.Site
 * @subpackage  com_jea
 * @copyright   Copyright (C) 2026 ReCreating Anew (by GinA), Sidney, Maine, USA. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

/* ============================================================
   PAGE WRAPPER
   ============================================================ */
.jea-cards-page {
    font-family: inherit;
}

/* ============================================================
   SORT BAR
   ============================================================ */
.jea-sortbar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #e9edf3;
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 20px;
}

/* Left cluster: count + badge */
.jea-sortbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Right cluster: sort-by and per-page on the same row */
.jea-sortbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.jea-sortbar-count {
    font-size: .84rem;
    color: #64748b;
    white-space: nowrap;
    font-weight: 500;
}

.jea-sort-select-wrap {
    display: flex;
    align-items: center;
    gap: 7px;
}

.jea-sort-label {
    font-size: .78rem;
    color: #94a3b8;
    white-space: nowrap;
    margin: 0;
    font-weight: 500;
}

.jea-sort-select {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 5px 28px 5px 10px;
    font-size: .83rem;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px 9px;
    appearance: none;
    -webkit-appearance: none;
    color: #374151;
    cursor: pointer;
    min-width: 160px;
    height: auto;
    line-height: 1.4;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    transition: border-color .15s, box-shadow .15s;
}

.jea-sort-select:focus {
    border-color: #93c5fd;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.jea-perpage-wrap {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
}

.jea-perpage-wrap > div select,
.jea-perpage-wrap > div .form-select {
    width: 72px !important;
    max-width: 72px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 5px 6px !important;
    font-size: .83rem !important;
    background: #fff !important;
    color: #374151 !important;
    height: auto !important;
    line-height: 1.4;
    box-shadow: 0 1px 3px rgba(0,0,0,.06) !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

/* ============================================================
   TWO-COLUMN LAYOUT: SIDEBAR + CARDS
   Inline styles on the elements handle the actual flex display
   (to defeat template CSS); these classes provide CSS fallback.
   ============================================================ */
.jea-cards-layout {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 24px;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.jea-sidebar {
    width: 280px !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    display: block !important;
}

/* Collapsible sidebar toggle button (replaces old <h3> heading) */
.jea-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px 18px;
    font-size: .85rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: .03em;
    cursor: pointer;
    box-shadow: 0 3px 16px rgba(0,0,0,.09);
    margin-bottom: 0;
    transition: border-radius .3s ease, box-shadow .2s ease;
}

.jea-sidebar-toggle:hover {
    background: #f8fafc;
}

.jea-sidebar-toggle[aria-expanded="true"] {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-color: transparent;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
}

.jea-toggle-icon {
    font-size: .7rem;
    color: #94a3b8;
    transition: transform .25s ease;
}

.jea-sidebar-inner {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 14px 14px;
    padding: 18px 18px 20px;
    position: sticky;
    top: 20px;
    box-shadow: 0 3px 16px rgba(0,0,0,.09);
    overflow: hidden;
    transition: max-height .3s ease, padding .3s ease;
}

/* Legacy h3 heading (for layouts that don't use the toggle button) */
.jea-sidebar-inner h3 {
    font-size: .85rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
    letter-spacing: .03em;
}

/* Each filter group — generous bottom spacing + subtle divider */
.jea-filter-group {
    margin-bottom: 0;
    padding: 14px 0;
    border-bottom: 1px solid #f1f5f9;
}

.jea-filter-group:first-child {
    padding-top: 0;
}

.jea-filter-group:last-of-type {
    border-bottom: none;
    padding-bottom: 4px;
}

/* Field label */
.jea-filter-label {
    display: block;
    font-size: .67rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .09em;
    margin-bottom: 7px;
}

/* All inputs and selects inside sidebar */
.jea-sidebar-inner input[type="text"],
.jea-sidebar-inner input[type="number"],
.jea-sidebar-inner select,
.jea-sidebar-inner .form-select {
    width: 100% !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 7px 11px !important;
    font-size: .84rem !important;
    background: #f8fafc !important;
    color: #1e293b !important;
    transition: border-color .15s, box-shadow .15s, background .15s;
    box-sizing: border-box;
    height: auto !important;
    line-height: 1.5;
    appearance: auto;
}

.jea-sidebar-inner input[type="text"]:focus,
.jea-sidebar-inner input[type="number"]:focus,
.jea-sidebar-inner select:focus,
.jea-sidebar-inner .form-select:focus {
    border-color: #2563eb !important;
    background: #fff !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37,99,235,.14) !important;
}

/* Budget range: two inputs side by side */
.jea-range {
    display: flex;
    align-items: center;
    gap: 6px;
}

.jea-range input {
    flex: 1;
    min-width: 0;
}

.jea-range-sep {
    color: #94a3b8;
    font-size: .85rem;
    font-weight: 600;
    flex-shrink: 0;
}

/* Scrollable checkbox lists */
.jea-filter-list-wrap ul,
.jea-filter-group ul {
    list-style: none !important;
    margin: 0;
    padding: 5px 8px !important;
    max-height: 160px;
    overflow-y: auto;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px;
    background: #f8fafc;
    transition: max-height .25s ease;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.jea-filter-group ul li,
.jea-filter-list-wrap ul li {
    list-style: none !important;
    padding: 3px 0 !important;
}

/* Expandable "Show all" toggle */
.jea-list-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    padding: 4px 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    letter-spacing: .01em;
    line-height: 1.55;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.jea-list-toggle-btn:hover {
    background: #f5f8ff;
    border-color: #bfdbfe;
    color: #2563eb;
    box-shadow: 0 1px 6px rgba(37,99,235,.12);
}

/* Active filter group — label becomes blue, small dot indicator */
.jea-filter-active .jea-filter-label {
    color: #2563eb !important;
}
.jea-filter-active .jea-filter-label::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #2563eb;
    border-radius: 50%;
    margin-left: 6px;
    vertical-align: middle;
    margin-bottom: 1px;
}
.jea-filter-active select,
.jea-filter-active input[type="text"],
.jea-filter-active input[type="number"] {
    border-color: #93c5fd !important;
    background-color: #eff6ff !important;
}

/* Active-filters badge in sortbar */
.jea-filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #eff6ff;
    border: 1px solid #93c5fd;
    color: #1d4ed8;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    padding: 3px 10px 3px 10px;
    white-space: nowrap;
    margin-left: 2px;
}
.jea-filter-badge-clear {
    background: none;
    border: none;
    color: #3b82f6;
    font-size: .9rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    font-weight: 700;
    margin-left: 2px;
}
.jea-filter-badge-clear:hover { color: #dc2626; }

/* Category-filter banner — shown when arriving from explore-issues / explore-amenities */
.jea-category-filter-banner {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin: .5rem 0 .75rem;
}
.jea-category-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .65rem;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.2;
}
.jea-category-filter-tag--issue {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}
.jea-category-filter-tag--amenity {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}
.jea-category-filter-tag-clear {
    color: inherit;
    text-decoration: none;
    opacity: .65;
    font-weight: 700;
    margin-left: .15rem;
}
.jea-category-filter-tag-clear:hover { opacity: 1; }

/* Standalone "exclude issues" checkbox */
.jea-checkbox-label {
    display: flex !important;
    align-items: flex-start;
    gap: 9px;
    font-size: .84rem !important;
    font-weight: 400 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    color: #374151 !important;
    cursor: pointer;
    line-height: 1.45;
    margin: 0;
}

.jea-checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    width: 14px !important;
    height: 14px;
    accent-color: #2563eb;
}

/* Apply / Reset buttons */
.jea-filter-actions {
    display: flex;
    flex-direction: row;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e9edf3;
}

.jea-btn-apply {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    background: #2563eb;
    color: #fff !important;
    border: 1px solid transparent;
    border-radius: 20px;
    font-size: .81rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: background .18s, box-shadow .18s, transform .12s;
    text-decoration: none !important;
    box-sizing: border-box;
    line-height: 1.45;
    letter-spacing: .01em;
    box-shadow: 0 1px 6px rgba(37,99,235,.25);
}

.jea-btn-apply:hover {
    background: #1d4ed8;
    color: #fff !important;
    box-shadow: 0 3px 12px rgba(37,99,235,.32);
    transform: translateY(-1px);
}

.jea-btn-apply:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(37,99,235,.18);
}

.jea-btn-reset {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    text-align: center;
    color: #6b7280 !important;
    font-size: .81rem;
    font-weight: 500;
    text-decoration: none !important;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: #fff;
    cursor: pointer;
    box-sizing: border-box;
    line-height: 1.45;
    letter-spacing: .01em;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    transition: color .18s, background .18s, border-color .18s, box-shadow .18s, transform .12s;
}

.jea-btn-reset:hover {
    color: #b91c1c !important;
    background: #fff8f8;
    border-color: #fecaca;
    box-shadow: 0 1px 6px rgba(185,28,28,.12);
    transform: translateY(-1px);
}

.jea-btn-reset:active {
    transform: translateY(0);
    background: #fee2e2;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.jea-cards-main {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    display: block !important;
}

/* ============================================================
   CARD GRID — 2 columns by default (JS also sets inline style)
   ============================================================ */
.jea-card-grid {
    display: grid;
    grid-template-columns: repeat(var(--jea-cols, 3), 1fr);
    gap: 18px;
}

/* ============================================================
   INDIVIDUAL CARD
   ============================================================ */
.jea-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    transition: box-shadow .2s ease, transform .2s ease;
}

.jea-card:hover {
    box-shadow: 0 6px 22px rgba(0,0,0,.11);
    transform: translateY(-3px);
}

/* Card image — fixed aspect ratio */
.jea-card-img-wrap {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #f1f5f9;
    overflow: hidden;
}

/* Image link — wraps the thumbnail inside .jea-card-img-wrap */
a.jea-card-img-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none !important;
    border: none !important;
    outline: none;
}

/* Thumbnail image */
img.jea-card-img,
.jea-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}

/* No-image placeholder — shown when no thumbnail is available */
div.jea-card-img.jea-card-img--placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    color: #94a3b8;
    font-size: 2.5rem;
}

div.jea-card-img.jea-card-img--placeholder::before {
    content: "\f03e"; /* FontAwesome fa-image */
    font-family: "Font Awesome 5 Free", "Font Awesome 5 Pro", FontAwesome, sans-serif;
    font-weight: 900;
}

.jea-card:hover img.jea-card-img,
.jea-card:hover .jea-card-img-wrap img {
    transform: scale(1.03);
}

.jea-card-img-wrap .jea-mini-map {
    height: 100%;
    width: 100%;
    pointer-events: none;
}

.jea-card-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #94a3b8;
    font-size: .8rem;
    text-decoration: none;
    background: #f8fafc;
}

/* Status badge */
.jea-status-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .67rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    line-height: 1.4;
    pointer-events: none;
}

.jea-status-available-now  { background: #166534; color: #dcfce7; }
.jea-status-available-from { background: #92400e; color: #fef3c7; }
.jea-status-occupied       { background: #991b1b; color: #fee2e2; }

/* Condition badge */
.jea-condition-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: .64rem;
    font-weight: 600;
    background: rgba(0,0,0,.5);
    color: #fff;
    backdrop-filter: blur(4px);
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Card body */
.jea-card-body {
    padding: 13px 15px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
}

.jea-card-title {
    font-size: .9rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.35;
}

/* Title link — the <a> inside h3.jea-card-title */
a.jea-card-title-link,
.jea-card-title a {
    color: #1e293b !important;
    text-decoration: none !important;
    font-weight: 600 !important;
}

a.jea-card-title-link:hover,
.jea-card-title a:hover {
    color: #2563eb !important;
}

.jea-card-price {
    font-size: 1.05rem;
    font-weight: 700;
    color: #2563eb;
    line-height: 1.2;
}

.jea-card-price small {
    font-size: .72rem;
    font-weight: 400;
    color: #64748b;
}

.jea-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    font-size: .77rem;
    color: #64748b;
}

.jea-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.jea-meta-item svg {
    flex-shrink: 0;
    color: #94a3b8;
}

.jea-card-issues-warn {
    display: flex;
    align-items: center;
    gap: 7px;
    background: #fffbeb;
    border: 1px solid #f59e0b;
    border-radius: 7px;
    padding: 5px 9px;
    font-size: .75rem;
    font-weight: 600;
    color: #92400e;
}

.jea-card-issues-warn svg {
    flex-shrink: 0;
    color: #f59e0b;
}

.jea-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

.jea-card-btn {
    display: inline-block;
    padding: 5px 15px;
    background: #2563eb;
    color: #fff !important;
    border-radius: 7px;
    font-size: .8rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: background .15s;
    line-height: 1.5;
}

.jea-card-btn:hover,
.jea-card-btn:focus {
    background: #1d4ed8;
    color: #fff !important;
}

.jea-card-date {
    font-size: .71rem;
    color: #94a3b8;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.jea-pagination {
    margin-top: 26px;
    text-align: center;
}

.jea-pagination .counter {
    font-size: .82rem;
    color: #64748b;
    margin-bottom: 8px;
}

/* ============================================================
   NO RESULTS
   ============================================================ */
.jea-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.jea-no-results p {
    font-size: 1rem;
    margin-bottom: 16px;
}

/* ============================================================
   #jFormCards SPECIFICITY OVERRIDES
   Use the form wrapper ID to win over Bootstrap / Atum template
   rules that would otherwise override the sidebar inputs and
   button colours.
   ============================================================ */

/* Sidebar inputs */
#jFormCards .jea-sidebar-inner input[type="text"],
#jFormCards .jea-sidebar-inner input[type="number"] {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: .84rem;
    background: #f8fafc;
    color: #1e293b;
    height: auto;
    line-height: 1.5;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
}

#jFormCards .jea-sidebar-inner select {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 32px 8px 12px;
    font-size: .84rem;
    background-color: #f8fafc;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px 11px;
    color: #1e293b;
    height: auto;
    line-height: 1.5;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
}

#jFormCards .jea-sidebar-inner input[type="text"]:focus,
#jFormCards .jea-sidebar-inner input[type="number"]:focus,
#jFormCards .jea-sidebar-inner select:focus {
    border-color: #2563eb;
    background-color: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37,99,235,.14);
}

/* Active filter highlights */
#jFormCards .jea-filter-active .jea-filter-label {
    color: #2563eb;
}

#jFormCards .jea-filter-active select,
#jFormCards .jea-filter-active input[type="text"],
#jFormCards .jea-filter-active input[type="number"] {
    border-color: #93c5fd;
    background-color: #eff6ff;
}

/* Action buttons */
#jFormCards button.jea-btn-apply {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    background: #2563eb;
    color: #fff !important;
    border: 1px solid transparent;
    border-radius: 20px;
    font-size: .81rem;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.45;
    letter-spacing: .01em;
    box-shadow: 0 1px 6px rgba(37,99,235,.25);
    transition: background .18s, box-shadow .18s, transform .12s;
    text-decoration: none !important;
}

#jFormCards button.jea-btn-apply:hover {
    background: #1d4ed8;
    color: #fff !important;
    box-shadow: 0 3px 12px rgba(37,99,235,.32);
    transform: translateY(-1px);
}

#jFormCards button.jea-btn-apply:active {
    transform: translateY(0);
}

#jFormCards button.jea-btn-reset {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    text-align: center;
    color: #6b7280 !important;
    font-size: .81rem;
    font-weight: 500;
    text-decoration: none !important;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: #fff;
    cursor: pointer;
    line-height: 1.45;
    letter-spacing: .01em;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    transition: color .18s, background .18s, border-color .18s, box-shadow .18s, transform .12s;
}

#jFormCards button.jea-btn-reset:hover {
    color: #b91c1c !important;
    background: #fff8f8;
    border-color: #fecaca;
    box-shadow: 0 1px 6px rgba(185,28,28,.12);
    transform: translateY(-1px);
}

#jFormCards button.jea-btn-reset:active {
    transform: translateY(0);
    background: #fee2e2;
}

/* "Show all" list toggle */
#jFormCards button.jea-list-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    padding: 5px 15px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: .73rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    line-height: 1.55;
    letter-spacing: .01em;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
    text-decoration: none;
}

#jFormCards button.jea-list-toggle-btn:hover {
    background: #f5f8ff;
    border-color: #bfdbfe;
    color: #2563eb;
    box-shadow: 0 1px 6px rgba(37,99,235,.12);
}

/* Per-page dropdown in sort bar */
#jFormCards .jea-sortbar-count {
    font-size: .84rem;
    color: #64748b;
    white-space: nowrap;
    font-weight: 500;
}

#jFormCards .jea-perpage-wrap select,
#jFormCards .jea-perpage-wrap .form-select {
    width: 72px !important;
    max-width: 72px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 5px 6px !important;
    font-size: .83rem !important;
    background: #fff !important;
    color: #374151 !important;
    height: auto !important;
    line-height: 1.4;
    box-shadow: 0 1px 3px rgba(0,0,0,.06) !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

#jFormCards .jea-sort-select {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 5px 28px 5px 10px;
    font-size: .83rem;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px 9px;
    appearance: none;
    -webkit-appearance: none;
    color: #374151;
    cursor: pointer;
    min-width: 160px;
    height: auto;
    line-height: 1.4;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

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

/* Mid-range: sidebar narrows slightly, 2-col cards remain */
@media (max-width: 1059px) and (min-width: 769px) {
    .jea-sidebar {
        width: 240px !important;
        min-width: 240px !important;
    }
}

/* Small screens: sidebar stacks (JS handles inline style override too) */
@media (max-width: 768px) {
    .jea-cards-layout {
        flex-direction: column !important;
    }

    .jea-sidebar {
        width: 100% !important;
        min-width: 100% !important;
    }

    .jea-sidebar-inner {
        position: static;
    }

    .jea-card-grid {
        --jea-cols: 2;
        gap: 14px;
    }

    .jea-sortbar {
        flex-wrap: wrap;
    }
}

/* Extra small: 1-col card */
@media (max-width: 540px) {
    .jea-card-grid {
        --jea-cols: 1;
    }
}

/* ============================================================
   PROFILE TAB — My Properties app
   Scoped under .jea-profile-props to avoid leaking into the
   main properties page.
   ============================================================ */

/* Container */
.jea-profile-props {
    padding: 8px 0;
}

/* Two-column layout: sidebar left, grid right */
.jea-profile-layout {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 20px;
    width: 100%;
}

@media (max-width: 768px) {
    .jea-profile-layout {
        flex-direction: column !important;
    }
    .jea-profile-props .jea-sidebar {
        width: 100% !important;
        min-width: 100% !important;
    }
}

/* Card grid inside profile tab */
.jea-profile-grid {
    display: grid !important;
    gap: 16px;
    grid-template-columns: repeat(3, 1fr);
    flex: 1 1 0%;
    min-width: 0;
}

@media (max-width: 900px) {
    .jea-profile-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 540px) {
    .jea-profile-grid { grid-template-columns: 1fr !important; }
}

/* ── Sidebar initial open state ─────────────────────────────── */
/* JS toggles max-height + padding inline; CSS provides the base */
.jea-profile-props .jea-sidebar-inner {
    max-height: 9999px !important;
    overflow: hidden;
    transition: max-height .3s ease, padding .3s ease;
}

/* ── Section badge overlay (My Property / Listed) ─────────────── */
.jea-card-section-badge {
    position: absolute;
    bottom: 7px;
    right: 7px;
    font-size: .65em;
    font-weight: 700;
    letter-spacing: .04em;
    padding: 2px 7px;
    border-radius: 4px;
    pointer-events: none;
}

.jea-card-section-badge--owned  { background: rgba(30,100,30,.75); color: #fff; }
.jea-card-section-badge--listed { background: rgba(0,70,140,.65);  color: #fff; }

/* ── Address line ──────────────────────────────────────────────── */
.jea-card-address {
    font-size: .76em;
    color: #999;
    display: flex;
    align-items: flex-start;
    gap: 4px;
    margin: 2px 0 0;
    overflow: hidden;
}

.jea-card-address-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.jea-card-address-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Price refinements ─────────────────────────────────────────── */
.jea-card-price-amount { font-weight: 700; }

.jea-card-price-freq {
    font-size: .82em;
    color: #777;
    margin-left: 2px;
}

/* ── Meta chip internals ───────────────────────────────────────── */
.jea-meta-icon {
    vertical-align: middle;
    margin-right: 2px;
}

.jea-meta-item-value { font-weight: 600; }

.jea-meta-item-label { color: #999; }

/* ── View button (profile-only class) ─────────────────────────── */
a.jea-card-view-btn,
a.jea-card-edit-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: .78em !important;
    font-weight: 600 !important;
    padding: 5px 10px !important;
    border-radius: 5px;
    text-decoration: none !important;
    transition: background .14s, color .14s, border-color .14s;
    white-space: nowrap;
    flex: 1;
    text-align: center;
    line-height: 1.4;
    box-sizing: border-box;
}

a.jea-card-view-btn {
    background: #f2f2f2 !important;
    color: #333 !important;
    border: 1px solid #e0e0e0 !important;
}

a.jea-card-view-btn:hover,
a.jea-card-view-btn:focus,
a.jea-card-view-btn:active {
    background: #e4e4e4 !important;
    color: #111 !important;
    border-color: #ccc !important;
    text-decoration: none !important;
}

/* ── Edit button (profile-only class, owner / admin only) ─────── */
a.jea-card-edit-btn {
    background: #fff3e0 !important;
    color: #e65100 !important;
    border: 1px solid #ffe0b2 !important;
}

a.jea-card-edit-btn:hover,
a.jea-card-edit-btn:focus,
a.jea-card-edit-btn:active {
    background: #ffe0b2 !important;
    color: #bf360c !important;
    border-color: #ffcc80 !important;
    text-decoration: none !important;
}

.jea-card-edit-btn-icon { flex-shrink: 0; }

/* empty — lets you show / hide the label text via CSS */
.jea-card-edit-btn-label {}

/* ── No-results message (inside profile grid) ──────────────────── */
.jea-profile-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 24px;
    color: #bbb;
    font-size: .88em;
    display: none;
}

/* ── Pending ownership claims panel ──────────────────────────────── */
.jea-profile-claims {
    background: #fffde7;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.jea-profile-claims__title {
    font-size: .86em;
    font-weight: 700;
    color: #856404;
    margin: 0 0 6px;
}

.jea-profile-claims__count {
    font-weight: 400;
}

.jea-profile-claims__subtitle {
    font-size: .80em;
    color: #6d4c00;
    margin: 0 0 10px;
}

.jea-profile-claims__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.jea-profile-claims__item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #ffe082;
}

.jea-profile-claims__item:last-child { border-bottom: none; }

.jea-profile-claims__info {
    flex: 1;
    min-width: 0;
}

.jea-profile-claims__name {
    font-weight: 600;
    font-size: .84em;
}

.jea-profile-claims__addr {
    font-size: .77em;
    color: #888;
    margin-top: 2px;
}

.jea-profile-claims__btns {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.jea-profile-claims__confirm-btn,
.jea-profile-claims__deny-btn {
    font-size: .74em;
    padding: 3px 10px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.jea-profile-claims__confirm-btn { background: #388e3c; color: #fff; }
.jea-profile-claims__confirm-btn:hover { background: #2e7d32; }

.jea-profile-claims__deny-btn {
    background: #f5f5f5;
    color: #555;
    border: 1px solid #ccc !important;
}

.jea-profile-claims__deny-btn:hover { background: #e0e0e0; }

/* ── Empty state (no properties at all) ─────────────────────────── */
.jea-profile-empty {
    text-align: center;
    padding: 36px 16px;
    color: #bbb;
    font-size: .9em;
}

.jea-profile-empty__icon {
    font-size: 2.2em;
    display: block;
    margin-bottom: 10px;
    opacity: .4;
}

/* ── Status badge additions not in the base JEA card CSS ──────── */
.jea-status-slogan      { background: rgba(20,20,20,.70); color: #fff; }
.jea-status-coming-soon { background: #6a1b9a; color: #fff; }
.jea-status-pending     { background: #e65100; color: #fff; }
.jea-status-off-market  { background: #455a64; color: #fff; }
.jea-status-for-rent    { background: #1565c0; color: #fff; }
.jea-status-for-sale    { background: #b71c1c; color: #fff; }

/* ── Filter list items — checkboxes and labels ────────────────── */
/* Applied to each <li> inside the tenancy-issues / amenities lists */
.jea-filter-list-item {
    list-style: none !important;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 3px 0;
}

/* Checkbox inside a filter list item */
.jea-filter-list-checkbox {
    margin-top: 2px;
    flex-shrink: 0;
    width: auto !important;
    accent-color: #2563eb;
}

/* Text label inside a filter list item */
.jea-filter-item-label {
    font-size: .8rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    margin: 0;
    line-height: 1.4;
    color: #374151;
}

/* ============================================================
   PROPERTY EDIT MODAL
   ============================================================ */

/* Full-viewport overlay */
.jea-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,.65);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

/* Dialog box */
.jea-modal-dialog {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 24px 64px rgba(0,0,0,.35);
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1400px;
    height: 90vh;
    max-height: 90vh;
    overflow: hidden;
}

/* Header bar */
.jea-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #1e293b;
    color: #fff;
    flex-shrink: 0;
    gap: 12px;
}

.jea-modal-title {
    font-size: .95rem;
    font-weight: 600;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jea-modal-header-btns {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Save & Done button */
.jea-modal-save-close {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border: none;
    border-radius: 5px;
    background: #16a34a;
    color: #fff;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}

.jea-modal-save-close:hover { background: #15803d; }
.jea-modal-save-close:disabled { background: #6b7280; cursor: not-allowed; }

/* Close (×) button */
.jea-modal-close-btn {
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background .15s, color .15s;
}

.jea-modal-close-btn:hover { background: rgba(255,255,255,.15); color: #fff; }

/* "Open full page" link in preview modal header */
.jea-modal-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: .8rem;
    font-weight: 600;
    color: #cbd5e1;
    text-decoration: none;
    border: 1px solid rgba(203,213,225,.35);
    transition: background .15s, color .15s, border-color .15s;
}
.jea-modal-open-btn:hover {
    background: rgba(255,255,255,.12);
    color: #fff;
    border-color: rgba(255,255,255,.4);
    text-decoration: none;
}

/* iframe fills remaining height */
.jea-modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
}

.jea-edit-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Responsive — full screen on mobile */
@media (max-width: 768px) {
    .jea-modal-overlay { padding: 0; }
    .jea-modal-dialog  { max-width: 100%; height: 100vh; max-height: 100vh; border-radius: 0; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Sort bar — previously inline on default_cards.php
   ═══════════════════════════════════════════════════════════════════════════ */
.jea-sortbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #e9edf3;
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 20px;
}
.jea-sortbar-left  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.jea-sortbar-right {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    flex-wrap: nowrap;
    margin-left: auto;
}
.jea-sort-select-wrap { display: flex; align-items: center; gap: 7px; }
.jea-sort-label {
    white-space: nowrap;
    font-size: .78rem;
    color: #94a3b8;
    font-weight: 500;
    margin: 0;
}
.jea-perpage-wrap { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.jea-perpage-select-wrap { width: 72px; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   Layout — previously inline on default_cards.php
   ═══════════════════════════════════════════════════════════════════════════ */
.jea-cards-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 24px;
    width: 100%;
}
.jea-sidebar {
    width: 280px;
    min-width: 280px;
    flex-shrink: 0;
    flex-grow: 0;
}
.jea-sidebar-inner {
    transition: max-height .3s ease, padding .3s ease;
    overflow: hidden;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
}
.jea-cards-main { flex: 1 1 0%; min-width: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   Budget range filter — previously inline on default_cards.php
   ═══════════════════════════════════════════════════════════════════════════ */
.jea-range           { display: flex; align-items: center; gap: 5px; }
.jea-range-input     { flex: 1; min-width: 0; }
.jea-range-sep       { flex-shrink: 0; color: #adb5bd; font-size: .8rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   Checkbox filter lists (amenities / tenancy issues) — previously inline
   ═══════════════════════════════════════════════════════════════════════════ */
.jea-filter-list {
    list-style: none;
    padding: 4px 6px;
    margin: 0;
    max-height: 160px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    background: #fff;
    transition: max-height .25s ease;
}
.jea-filter-list li {
    list-style: none;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 2px 0;
}
.jea-filter-checkbox  { margin-top: 2px; flex-shrink: 0; width: auto; }
.jea-filter-check-label {
    font-size: .8rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   No-results reset link — previously inline on default_cards.php
   ═══════════════════════════════════════════════════════════════════════════ */
.jea-no-results .jea-btn-apply { display: inline-block; width: auto; padding: 8px 22px; }

/* Card grid mini-map (no-image fallback) */
.jea-mini-map {
    height: 100%;
    width: 100%;
    pointer-events: none;
}
