/* dashboard/properties.css — Emerald Legacy */

.explorer-layout {
    display: flex;
    gap: 24px;
    margin-top: 24px;
    align-items: flex-start;
}

/* ------------------------------------------------------------------
   Filters sidebar — glass panel with subtle emerald tint
   ------------------------------------------------------------------ */
.filters-sidebar {
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: 24px;
    padding: 24px;
    border: 2px solid var(--border);
    border-radius: 16px;
    background-color: rgba(255, 255, 255, 0.9);
    background-image: linear-gradient(rgba(1, 50, 32, 0.03), rgba(1, 50, 32, 0.03));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.filters-sidebar h3 {
    margin: 0 0 20px;
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--primary);
}

.filter-group {
    margin-bottom: 20px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
}

.filter-group select,
.filter-group input {
    width: 100%;
    min-height: 52px;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-family: var(--font-sans);
    font-size: 1.05rem;
    color: var(--text-main);
    background: var(--white);
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.filter-group select:hover,
.filter-group input:hover {
    border-color: rgba(1, 50, 32, 0.35);
}

.filter-group select:focus-visible,
.filter-group input:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
    border-color: var(--primary);
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 12px;
}

.range-inputs input {
    width: 100%;
}

.range-inputs span {
    flex-shrink: 0;
    color: var(--text-light);
}

.filters-sidebar .btn-block + .btn-block {
    margin-top: 12px;
}

/* ------------------------------------------------------------------
   Sort control
   ------------------------------------------------------------------ */
.sort-select {
    min-height: 48px;
    padding: 8px 14px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--text-main);
    background: var(--white);
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s ease;
}

.sort-select:hover {
    border-color: rgba(1, 50, 32, 0.35);
}

.sort-select:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
    border-color: var(--primary);
}

/* ------------------------------------------------------------------
   Results grid
   ------------------------------------------------------------------ */
.results-container {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

/* ------------------------------------------------------------------
   Property cards (JS-rendered)
   ------------------------------------------------------------------ */
.property-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 12px rgba(1, 50, 32, 0.06);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.property-card:hover {
    transform: translateY(-6px);
    border-color: rgba(1, 50, 32, 0.35);
    box-shadow: 0 14px 30px rgba(1, 50, 32, 0.12);
}

.property-card:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

.card-image-container {
    position: relative;
    height: 240px;
    background: #E8E8E4;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-image-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, 0.35) 100%);
    pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
    .card-image-container img {
        transition: transform 0.5s ease;
    }

    .property-card:hover .card-image-container img {
        transform: scale(1.04);
    }
}

/* ------------------------------------------------------------------
   Badges (JS-injected classes)
   ------------------------------------------------------------------ */
.fomo-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10;
    background: linear-gradient(135deg, var(--gold) 0%, #B5952F 100%);
    color: var(--white);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 8px 14px;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.35);
}

.avm-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    background: var(--white);
    border: 2px solid var(--border);
}

.avm-badge .material-symbols-rounded {
    font-size: 1rem;
}

.avm-badge.rera-badge {
    color: #0284c7;
}

.avm-badge.great-deal {
    color: #B91C1C;
    background: #FEF2F2;
}

.avm-badge.fair-price {
    color: #166534;
    background: #ECFDF5;
}

/* ------------------------------------------------------------------
   Card content
   ------------------------------------------------------------------ */
.card-content {
    flex: 1;
    padding: 20px 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.property-type {
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
}

.property-price {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-main);
}

.property-title {
    margin: 0;
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-main);
}

.property-location {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1.05rem;
    color: var(--text-light);
}

.property-location .material-symbols-rounded {
    font-size: 1.2rem;
    color: var(--primary);
}

.property-features {
    display: flex;
    gap: 20px;
    padding-top: 16px;
    border-top: 2px solid var(--border);
    margin-top: auto;
}

.feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    color: var(--text-light);
}

.feature .material-symbols-rounded {
    font-size: 1.2rem;
    color: var(--primary);
}

/* ------------------------------------------------------------------
   Loading / empty states (JS injects inline-styled divs + spin)
   ------------------------------------------------------------------ */
@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* ------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------ */
@media (max-width: 767px) {
    .explorer-layout {
        flex-direction: column;
        gap: 20px;
    }

    .filters-sidebar {
        width: 100%;
        position: static;
    }

    .filter-group {
        display: inline-block;
        width: calc(50% - 12px);
        margin-right: 12px;
        vertical-align: top;
    }

    .filter-group:nth-of-type(2n) {
        margin-right: 0;
    }
}

/* Tablet (768-1023px): sticky filters bar in single row, 2-col grid */
@media (min-width: 768px) and (max-width: 1023px) {
    .explorer-layout {
        flex-direction: column;
        gap: 24px;
    }

    .filters-sidebar {
        width: 100%;
        position: sticky;
        top: 12px;
        z-index: 20;
        display: flex;
        flex-wrap: wrap;
        align-items: flex-end;
        gap: 16px 20px;
        padding: 20px 24px;
        margin-bottom: 8px;
    }

    .filters-sidebar h3 {
        width: 100%;
        margin-bottom: 4px;
        font-size: 1.25rem;
    }

    .filters-sidebar .filter-group {
        flex: 1 1 200px;
        min-width: 180px;
        margin-bottom: 0;
    }

    .filters-sidebar .range-inputs {
        flex-wrap: nowrap;
    }

    .filters-sidebar .btn-block {
        width: auto;
        flex: 1 1 200px;
        min-height: 56px;
        margin-top: 4px;
    }

    .filters-sidebar .btn-block + .btn-block {
        margin-top: 0;
    }

    .properties-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px;
    }
}

@media (max-width: 480px) {
    .filter-group {
        display: block;
        width: 100%;
        margin-right: 0;
    }

    .filters-sidebar {
        padding: 20px 16px;
    }

    .properties-grid {
        grid-template-columns: 1fr;
    }

    .card-image-container {
        height: 200px;
    }
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

/* ------------------------------------------------------------------
   Contained loading states (prevents full-page takeover)
   ------------------------------------------------------------------ */
.gk-loading-container {
    grid-column: 1 / -1;
    min-height: 220px;
    max-height: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 36px 20px;
    background: var(--surface, #ffffff);
    border: 1px solid var(--border, #E2E8F0);
    border-radius: 16px;
    box-sizing: border-box;
    margin: 12px 0;
}

.gk-spinner-icon {
    display: inline-block !important;
    width: 48px;
    height: 48px;
    line-height: 48px;
    text-align: center;
    font-size: 2.4rem !important;
    animation: spin 1s linear infinite !important;
    transform-origin: center center;
    will-change: transform;
    flex-shrink: 0;
}

