/* Account for fixed header */
#feature-property {
    padding-top: 80px;
}

@media (max-width: 768px) {
    #feature-property {
        padding-top: 70px;
    }
}

/* Map canvas sizing */
.map-canvas {
    width: 100%;
    height: 100%;
    min-height: 400px;
}

.half_map_area .map-canvas {
    height: 100%;
    min-height: 600px;
}

@media (max-width: 991px) {
    .half_map_area .map-canvas {
        height: 500px;
        min-height: 500px;
    }
}

/* Mapbox marker enhancements */
.mapboxgl-marker {
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
    transition: filter 0.2s ease;
}

.mapboxgl-marker:hover {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

/* Custom pin markers (used by databaza-map.js) */
.custom-price-marker {
    cursor: pointer;
}

.price-pin {
    position: relative;
    background-color: white;
    color: white;
    padding: 4px 10px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid white;
    line-height: 1.2;
}

.custom-price-marker:hover .price-pin {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    z-index: 1000;
}

.price-pin-arrow {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid inherit;
}

/* Custom cluster markers (used by databaza-map.js) */
.custom-cluster-marker {
    cursor: pointer;
}

.cluster-pin {
    background: white;
    color: #1e293b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-cluster-marker:hover .cluster-pin {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

/* Fixed layout for listings + map */
.databaza-container {
    position: relative;
    height: calc(100vh - 100px);
    overflow: hidden;
}

.databaza-left-column {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.databaza-filters-section {
    flex-shrink: 0;
    overflow-y: auto;
    max-height: fit-content;
    padding-bottom: 20px;
    position: relative;
}

.databaza-listings-section {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: 0;
    width: 100%;
    max-width: 100%;
    scroll-behavior: smooth;
}

.databaza-listings-section .row {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
}

.databaza-listings-section .col-lg-12 {
    padding-left: 15px;
    padding-right: 15px;
    max-width: 100%;
    box-sizing: border-box;
}

.databaza-listings-section::-webkit-scrollbar {
    width: 8px;
}

.databaza-listings-section::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.databaza-listings-section::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.databaza-listings-section::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.databaza-right-column {
    height: 100%;
    position: sticky;
    top: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.half_map_area {
    height: 100%;
    position: relative;
}

.half_map_area .home_two_map {
    height: 100%;
}

/* Listings Header */
.listings-header {
    top: 0;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px 0;
    flex-wrap: nowrap;
    gap: 12px;
}

.listings-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.results-count {
    font-size: 16px;
    color: #1f2937;
    font-weight: 500;
    flex-shrink: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.results-count strong {
    color: #ff5a5f;
    font-weight: 700;
    font-size: 18px;
}

.btn-clear-active-filters {
    display: none;
    padding: 8px 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 6px;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-clear-active-filters.active {
    display: flex;
}

.btn-clear-active-filters:hover {
    background: #f9fafb;
    border-color: #ff5a5f;
    color: #ff5a5f;
}

.btn-clear-active-filters i {
    font-size: 12px;
}

/* Map toggle buttons */
.hide-map-button {
    position: absolute;
    top: 15px;
    left: 35px;
    background: white;
    color: #484848;
    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hide-map-button:hover {
    background: #f7f7f7;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hide-map-button .flaticon-close {
    font-size: 12px;
}

.show-map-button-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 12px;
}

.show-map-button-inline:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.show-map-button-inline .flaticon-maps-and-flags {
    font-size: 16px;
}

/* Listing card styles */
.listing-price-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    padding: 6px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-weight: 600;
    z-index: 10;
}

.listing-price-badge .current-price {
    font-size: 16px;
    color: #1a1a1a;
}

.listing-price-badge .price-period {
    font-size: 13px;
    color: #717171;
    font-weight: 400;
}

.location-card .listing-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.location-card .listing-title a {
    text-decoration: none;
    color: inherit;
    font-weight: 800;
    transition: color 0.2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.location-card .listing-title a::first-letter {
    text-transform: uppercase;
}

.location-card .listing-title a:hover {
    color: #1a1a1a;
    text-decoration: none;
}

.location-card .listing-meta {
    display: flex;
    gap: 12px;
    font-size: 14px;
    color: #717171;
    margin-bottom: 8px;
}

.location-card .listing-meta .meta-item {
    display: flex;
    align-items: center;
}

.location-card .listing-meta .meta-item::before {
    content: "•";
    margin-right: 8px;
    color: #ff9599;
}

.location-card .listing-meta .meta-item:first-child::before {
    content: "";
    margin-right: 0;
}

.location-card .fp_footer {
    display: none;
}

.location-card .thumb {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    background: #f0f0f0;
    cursor: pointer;
}

.location-card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition:
        transform 0.4s ease,
        filter 0.4s ease;
}

.location-card:hover .thumb img {
    transform: scale(1.08);
    filter: brightness(1.1);
}

.location-card .thumb::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        transparent 60%,
        rgba(0, 0, 0, 0.3) 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.location-card:hover .thumb::after {
    opacity: 1;
}

/* Featured listing styles */
.location-card.is-featured {
    border: 2px solid #f59e0b;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.25);
    position: relative;
}

.location-card.is-featured::before {
    content: "";
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #fbbf24 100%);
    border-radius: 14px;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.location-card.is-featured:hover::before {
    opacity: 0.15;
}

.featured-star-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    z-index: 15;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    animation: pulse-star 2s ease-in-out infinite;
}

@keyframes pulse-star {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.featured-ribbon {
    position: absolute;
    top: 56px;
    left: 12px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

/* Map info card */
.map-info-card {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 360px;
    max-width: calc(100% - 40px);
    background: white;
    backdrop-filter: blur(6px);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    z-index: 1000;
    display: none;
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

.map-info-card.visible {
    display: block;
}

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

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.map-info-card-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: background 0.2s;
    z-index: 10;
}

.map-info-card-close:hover {
    background: white;
}

.map-info-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.map-info-card-gallery {
    width: 100%;
    height: 100%;
}

.map-info-card-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.map-info-price-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    padding: 6px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-weight: 600;
    z-index: 5;
}

.map-info-price-badge .current-price {
    font-size: 16px;
    color: #1a1a1a;
}

.map-info-price-badge .price-period {
    font-size: 13px;
    color: #717171;
    font-weight: 400;
}

.map-info-card-body {
    padding: 16px;
}

.map-info-card-body .listing-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-info-card-body .listing-meta {
    display: flex;
    gap: 12px;
    font-size: 14px;
    color: #717171;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.map-info-card-body .listing-meta .meta-item::before {
    content: "•";
    margin-right: 8px;
    color: #d0d0d0;
}

.map-info-card-body .listing-meta .meta-item:first-child::before {
    content: "";
    margin-right: 0;
}

.map-info-card-view-btn {
    background: #ff5a5f;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
    font-size: 15px;
}

.map-info-card-view-btn:hover {
    background: #e04a4f;
}

/* Simple Text Explainer - subtle overlay for non-authenticated users */
.map-explainer-simple {
    position: absolute;
    bottom: 15px;
    left: 15px;
    z-index: 100;
    pointer-events: all;
}

.map-explainer-simple a {
    display: inline-block;
    background: rgba(255, 255, 255, 0.92);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    color: #484848;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.map-explainer-simple a:hover {
    background: rgba(255, 255, 255, 0.98);
    color: #ff5a5f;
    text-decoration: none;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.16);
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .map-explainer-simple {
        left: 50%;
        transform: translateX(-50%);
    }
}

@media (max-width: 576px) {
    .map-explainer-simple {
        left: 10px;
        transform: none;
    }

    .map-explainer-simple a {
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* Grid layout for listings */
.databaza-listings-grid {
    display: grid;
    gap: 20px;
    padding: 0;
    margin: 0;
    list-style: none;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.databaza-listings-grid li.extrawide {
    width: 100% !important;
    margin: 0 !important;
    display: block;
    min-width: 0;
    box-sizing: border-box;
}

.databaza-listings-grid li.empty-state-item {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
}

.databaza-listings-grid .feat_property {
    height: 100%;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.databaza-listings-grid .feat_property img {
    max-width: 100%;
    object-fit: cover;
}

.databaza-listings-grid .feat_property .details,
.databaza-listings-grid .feat_property .tc_content {
    overflow: hidden;
    word-wrap: break-word;
    max-width: 100%;
}

#listings-container {
    transition: opacity 0.3s ease;
}

#listings-container.loading {
    opacity: 0.4;
}

/* Skeleton Loading Styles */
.skeleton-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.skeleton-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

.skeleton-content {
    padding: 16px;
}

.skeleton-title {
    height: 20px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 12px;
    width: 70%;
}

.skeleton-text {
    height: 14px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-text:last-child {
    width: 50%;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-loader {
    display: none;
}

.skeleton-loader.active {
    display: contents;
}

/* Hide listings initially on desktop - will be shown quickly via JS */
#listings-container > li.extrawide {
    display: none;
}

#listings-container.ready > li.extrawide {
    display: block;
}

/* Responsive grid columns */
@media (min-width: 1200px) {
    .databaza-listings-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .databaza-left-column.col-xl-12 .databaza-listings-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .databaza-listings-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .databaza-left-column.col-xl-12 .databaza-listings-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 576px) and (max-width: 767px) {
    .databaza-listings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575px) {
    .databaza-listings-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile responsiveness */
@media (max-width: 1199px) {
    .databaza-container {
        height: auto;
        overflow: visible;
    }

    .databaza-left-column,
    .databaza-right-column {
        height: auto;
    }

    .databaza-listings-section {
        overflow-y: visible;
        max-height: none;
    }

    .half_map_area .map-canvas {
        height: 500px;
    }

    .hide-map-button,
    .show-map-button-inline {
        display: none !important;
    }

    .databaza-right-column {
        display: none !important;
    }

    .databaza-left-column {
        width: 100% !important;
        max-width: 100% !important;
    }

    .map-info-card {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }
}

/* Mobile-specific fixes for listings header buttons */
@media (max-width: 767px) {
    .listings-header {
        flex-wrap: nowrap;
        gap: 8px;
        padding: 10px 0;
    }

    .results-count {
        font-size: 13px;
        flex: 1 1 auto;
        min-width: 0;
    }

    .results-count strong {
        font-size: 15px;
    }

    .listings-header-actions {
        gap: 6px;
        flex-shrink: 0;
    }

    .btn-clear-active-filters {
        font-size: 0;
        padding: 8px;
        gap: 0;
        min-width: 38px;
        width: 38px;
    }

    .btn-clear-active-filters i {
        font-size: 14px;
        margin: 0;
    }

    .btn-open-filters {
        padding: 8px;
        font-size: 0;
        gap: 0;
        min-width: 38px;
        width: 38px;
        justify-content: center;
    }

    .btn-open-filters .flaticon-filter-results-button {
        font-size: 16px;
    }

    .btn-open-filters .filter-text {
        display: none !important;
    }

    .filter-count {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .listings-header {
        gap: 6px;
    }

    .results-count {
        font-size: 12px;
    }

    .results-count strong {
        font-size: 14px;
    }

    .listings-header-actions {
        gap: 5px;
    }

    .btn-clear-active-filters {
        padding: 7px;
        width: 36px;
        min-width: 36px;
    }

    .btn-clear-active-filters i {
        font-size: 13px;
    }

    .btn-open-filters {
        padding: 7px;
        min-width: 36px;
        width: 36px;
    }

    .btn-open-filters .flaticon-filter-results-button {
        font-size: 15px;
    }
}

/* Modal Type Selector Styles */
.modal-type-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.modal-type-option {
    position: relative;
    cursor: pointer;
}

.modal-type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.modal-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    background: white;
    transition: all 0.2s ease;
    height: 100%;
    min-height: 85px;
}

.modal-type-option:hover .modal-type-card {
    border-color: var(--card-color, #6b7280);
    background: color-mix(in srgb, var(--card-color, #6b7280) 5%, white);
}

.modal-type-option input[type="radio"]:checked + .modal-type-card {
    border-color: var(--card-color, #6b7280);
    background: var(--card-color, #6b7280);
    color: white;
}

.modal-type-icon {
    width: 28px;
    height: 28px;
    margin-bottom: 6px;
    color: var(--card-color, #6b7280);
    transition: color 0.2s ease;
}

.modal-type-option
    input[type="radio"]:checked
    + .modal-type-card
    .modal-type-icon {
    color: white;
}

.modal-type-icon svg {
    width: 100%;
    height: 100%;
}

.modal-type-name {
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    color: #1f2937;
    transition: color 0.2s ease;
    line-height: 1.2;
}

.modal-type-option
    input[type="radio"]:checked
    + .modal-type-card
    .modal-type-name {
    color: white;
}

@media (max-width: 480px) {
    .modal-type-selector-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 8px;
    }

    .modal-type-card {
        padding: 10px 6px;
        min-height: 75px;
    }

    .modal-type-icon {
        width: 24px;
        height: 24px;
        margin-bottom: 4px;
    }

    .modal-type-name {
        font-size: 11px;
    }
}

/* No Type Selected Message */
.no-type-message {
    display: none; /* Hidden by default, shown by JS when no type selected */
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 2px dashed #cbd5e1;
    margin: 20px 0;
}

.no-type-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    color: #94a3b8;
}

.no-type-icon svg {
    width: 100%;
    height: 100%;
}

.no-type-title {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 8px 0;
}

.no-type-description {
    font-size: 15px;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

@media (max-width: 480px) {
    .no-type-message {
        padding: 30px 16px;
    }

    .no-type-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 12px;
    }

    .no-type-title {
        font-size: 18px;
    }

    .no-type-description {
        font-size: 14px;
    }
}
