/**
 * WP Dynamic Filter Pro - Premium Frontend Styles
 * Airbnb-inspired design with compact, international appeal
 */

/* ===================================
   Variables & Base - Light Theme
   =================================== */
:root {
    --wdfp-primary: #FF385C;
    --wdfp-primary-hover: #E31C5F;
    --wdfp-primary-light: #FFE7ED;
    --wdfp-secondary: #717171;
    --wdfp-text: #222222;
    --wdfp-text-light: #717171;
    --wdfp-text-muted: #B0B0B0;
    --wdfp-border: #DDDDDD;
    --wdfp-border-light: #EBEBEB;
    --wdfp-bg: #FFFFFF;
    --wdfp-bg-light: #F7F7F7;
    --wdfp-bg-hover: #FAFAFA;
    --wdfp-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.08);
    --wdfp-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --wdfp-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --wdfp-shadow-lg: 0 6px 20px rgba(0, 0, 0, 0.15);
    --wdfp-radius: 12px;
    --wdfp-radius-sm: 8px;
    --wdfp-radius-full: 50px;
    --wdfp-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================
   Container & Layout
   =================================== */
.wdfp-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 0px;
}

.wdfp-layout-row {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 32px;
    align-items: start;
}

/* Sidebar Column */
.wdfp-sidebar-col {
    position: relative;
}

.wdfp-sidebar-sticky {
    position: sticky;
    top: 24px;
}

/* Content Column */
.wdfp-content-col {
    min-width: 0;
}

/* ===================================
   Sidebar Filters
   =================================== */
.wdfp-filters-sidebar {
    background: var(--wdfp-bg);
    border: 1px solid var(--wdfp-border-light);
    border-radius: var(--wdfp-radius);
    padding: 0;
    box-shadow: var(--wdfp-shadow-sm);
}

.wdfp-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--wdfp-border-light);
}

.wdfp-filter-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--wdfp-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.wdfp-filter-title svg {
    color: var(--wdfp-text-light);
}

.wdfp-btn-clear-all {
    background: none;
    border: none;
    color: var(--wdfp-text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    transition: var(--wdfp-transition);
}

.wdfp-btn-clear-all:hover {
    color: var(--wdfp-primary);
}

/* Filter Sections */
.wdfp-filters-list {
    padding: 0;
}

.wdfp-filter-section {
    padding: 24px;
    border-bottom: 1px solid var(--wdfp-border-light);
}

.wdfp-filter-section:last-child {
    border-bottom: none;
}

.wdfp-filter-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--wdfp-text);
    margin-bottom: 12px;
}

/* Search Bar */
.wdfp-search-bar {
    position: relative;
}

.wdfp-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--wdfp-text-light);
    pointer-events: none;
    z-index: 2;
}

.wdfp-search-input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1px solid var(--wdfp-border);
    border-radius: var(--wdfp-radius-sm);
    font-size: 14px;
    color: var(--wdfp-text);
    transition: var(--wdfp-transition);
    background: var(--wdfp-bg);
    font-family: inherit;
}

.wdfp-search-input:focus {
    outline: none;
    border-color: var(--wdfp-text);
    box-shadow: 0 0 0 1px var(--wdfp-text);
}

.wdfp-search-input::placeholder {
    color: var(--wdfp-text-muted);
}

/* Select Filters */
.wdfp-filter-select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--wdfp-border);
    border-radius: var(--wdfp-radius-sm);
    font-size: 14px;
    color: var(--wdfp-text);
    background: var(--wdfp-bg);
    transition: var(--wdfp-transition);
    font-family: inherit;
    cursor: pointer;
}

.wdfp-filter-select:focus {
    outline: none;
    border-color: var(--wdfp-text);
    box-shadow: 0 0 0 1px var(--wdfp-text);
}

/* Range Sliders */
.wdfp-range-wrapper {
    padding: 8px 0;
}

.wdfp-range-group {
    margin-bottom: 12px;
}

.wdfp-range-group:last-child {
    margin-bottom: 0;
}

.wdfp-range-group label {
    display: block;
    font-size: 12px;
    color: var(--wdfp-text-light);
    margin-bottom: 8px;
    font-weight: 500;
}

.wdfp-range-slider {
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: var(--wdfp-border);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.wdfp-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--wdfp-bg);
    border: 2px solid var(--wdfp-text);
    cursor: pointer;
    transition: var(--wdfp-transition);
    box-shadow: var(--wdfp-shadow);
}

.wdfp-range-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--wdfp-bg);
    border: 2px solid var(--wdfp-text);
    cursor: pointer;
    transition: var(--wdfp-transition);
    box-shadow: var(--wdfp-shadow);
}

.wdfp-range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.wdfp-range-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
}

.wdfp-range-value {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--wdfp-text);
    margin-top: 12px;
    font-weight: 500;
}

/* Filter Actions */
.wdfp-filter-actions {
    padding: 20px 24px;
    border-top: 1px solid var(--wdfp-border-light);
}

/* ===================================
   Buttons
   =================================== */
.wdfp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: 1px solid var(--wdfp-text);
    border-radius: var(--wdfp-radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--wdfp-transition);
    background: var(--wdfp-bg);
    color: var(--wdfp-text);
    text-decoration: none;
    font-family: inherit;
}

.wdfp-btn:hover {
    background: var(--wdfp-bg-light);
    transform: translateY(-1px);
    box-shadow: var(--wdfp-shadow);
}

.wdfp-btn-primary {
    background: var(--wdfp-primary);
    border-color: var(--wdfp-primary);
    color: white;
}

.wdfp-btn-primary:hover {
    background: var(--wdfp-primary-hover);
    border-color: var(--wdfp-primary-hover);
}

.wdfp-btn-block {
    width: 100%;
}

.wdfp-btn svg {
    width: 16px;
    height: 16px;
}

/* ===================================
   Results Header
   =================================== */
.wdfp-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 20px 0;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--wdfp-border-light);
}

.wdfp-results-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.wdfp-results-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wdfp-results-count {
    font-size: 14px;
    color: var(--wdfp-text-light);
    font-weight: 400;
}

.wdfp-count-number {
    font-weight: 600;
    color: var(--wdfp-text);
    font-size: 16px;
}

/* Sort Dropdown */
.wdfp-sort-wrapper {
    position: relative;
}

.wdfp-sort-select {
    padding: 10px 36px 10px 14px;
    border: 1px solid var(--wdfp-border);
    border-radius: var(--wdfp-radius-sm);
    font-size: 14px;
    color: var(--wdfp-text);
    background: var(--wdfp-bg);
    cursor: pointer;
    transition: var(--wdfp-transition);
    appearance: none;
    font-family: inherit;
    font-weight: 500;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23222222' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.wdfp-sort-select:hover {
    border-color: var(--wdfp-text);
}

.wdfp-sort-select:focus {
    outline: none;
    border-color: var(--wdfp-text);
    box-shadow: 0 0 0 1px var(--wdfp-text);
}

/* View Toggle */
.wdfp-view-toggle {
    display: flex;
    gap: 4px;
    border: 1px solid var(--wdfp-border);
    border-radius: var(--wdfp-radius-sm);
    padding: 4px;
    background: var(--wdfp-bg-light);
}

.wdfp-view-btn {
    padding: 8px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--wdfp-transition);
    color: var(--wdfp-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wdfp-view-btn:hover {
    background: var(--wdfp-bg);
    color: var(--wdfp-text);
}

.wdfp-view-btn.active {
    background: var(--wdfp-bg);
    color: var(--wdfp-text);
    box-shadow: var(--wdfp-shadow-sm);
}

/* ===================================
   Loading Overlay
   =================================== */
.wdfp-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: var(--wdfp-radius);
}

.wdfp-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--wdfp-border);
    border-top-color: var(--wdfp-primary);
    border-radius: 50%;
    animation: wdfp-spin 0.8s linear infinite;
}

@keyframes wdfp-spin {
    to { transform: rotate(360deg); }
}

/* ===================================
   Results Grid
   =================================== */
.wdfp-results-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 32px;
    position: relative;
}

.wdfp-results-grid.wdfp-layout-grid.wdfp-columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.wdfp-results-grid.wdfp-layout-grid.wdfp-columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.wdfp-results-grid.wdfp-layout-grid.wdfp-columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.wdfp-results-grid.wdfp-layout-list {
    grid-template-columns: 1fr;
}

/* ===================================
   Property Card - Airbnb Style
   =================================== */
.wdfp-card {
    position: relative;
    border-radius: var(--wdfp-radius);
    overflow: hidden;
    transition: var(--wdfp-transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.wdfp-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.wdfp-card-image-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: var(--wdfp-radius);
    background: var(--wdfp-bg-light);
}

.wdfp-card-image {
    position: relative;
    width: 100%;
    padding-top: 66.67%;
    overflow: hidden;
}

.wdfp-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--wdfp-transition);
}

.wdfp-card:hover .wdfp-card-image img {
    transform: scale(1.05);
}

/* Favorite Button */
.wdfp-card-favorite {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--wdfp-transition);
    z-index: 2;
    backdrop-filter: blur(4px);
}

.wdfp-card-favorite:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 1);
}

.wdfp-card-favorite svg {
    color: var(--wdfp-text);
}

.wdfp-card-favorite:hover svg {
    fill: var(--wdfp-primary);
    stroke: var(--wdfp-primary);
}

/* Badge */
.wdfp-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 12px;
    border-radius: var(--wdfp-radius-sm);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--wdfp-text);
    backdrop-filter: blur(8px);
    box-shadow: var(--wdfp-shadow-sm);
}

/* Card Content */
.wdfp-card-content {
    padding: 12px 0 0 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wdfp-card-header {
    margin-bottom: 4px;
}

.wdfp-card-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 4px 0;
    line-height: 1.3;
    color: var(--wdfp-text);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wdfp-card-location {
    font-size: 13px;
    color: var(--wdfp-text-light);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wdfp-card-location svg {
    flex-shrink: 0;
}

.wdfp-card-type {
    font-size: 13px;
    color: var(--wdfp-text-light);
    margin: 0 0 4px 0;
}

.wdfp-card-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.wdfp-feature {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--wdfp-text-light);
}

.wdfp-feature svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.wdfp-card-price {
    margin-top: auto;
    padding-top: 4px;
}

.wdfp-price-amount {
    font-size: 16px;
    font-weight: 600;
    color: var(--wdfp-text);
}

.wdfp-price-period {
    font-size: 14px;
    font-weight: 400;
    color: var(--wdfp-text-light);
}

/* List Layout */
.wdfp-card-list {
    flex-direction: row;
    border: 1px solid var(--wdfp-border-light);
    border-radius: var(--wdfp-radius);
    padding: 16px;
    background: var(--wdfp-bg);
}

.wdfp-card-list .wdfp-card-image-wrapper {
    width: 280px;
    flex-shrink: 0;
}

.wdfp-card-list .wdfp-card-image {
    padding-top: 0;
    height: 200px;
}

.wdfp-card-list .wdfp-card-content {
    padding: 0 0 0 20px;
}

/* ===================================
   No Results
   =================================== */
.wdfp-no-results {
    text-align: center;
    padding: 80px 20px;
    color: var(--wdfp-text-light);
    font-size: 16px;
}

/* ===================================
   Pagination
   =================================== */
.wdfp-pagination-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 32px 0;
}

.wdfp-pagination-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--wdfp-border);
    background: var(--wdfp-bg);
    color: var(--wdfp-text);
    border-radius: var(--wdfp-radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--wdfp-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wdfp-pagination-btn:hover:not(:disabled) {
    background: var(--wdfp-bg-light);
    border-color: var(--wdfp-text);
}

.wdfp-pagination-btn.active {
    background: var(--wdfp-text);
    border-color: var(--wdfp-text);
    color: white;
}

.wdfp-pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.wdfp-btn-load-more {
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--wdfp-radius-sm);
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 1200px) {
    .wdfp-layout-row {
        grid-template-columns: 300px 1fr;
        gap: 24px;
    }

    .wdfp-results-grid.wdfp-columns-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 991px) {
    .wdfp-layout-row {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .wdfp-sidebar-sticky {
        position: static;
    }

    .wdfp-results-grid.wdfp-columns-2,
    .wdfp-results-grid.wdfp-columns-3,
    .wdfp-results-grid.wdfp-columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .wdfp-container {
        padding: 0 16px;
    }

    .wdfp-results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .wdfp-results-header-right {
        width: 100%;
        justify-content: space-between;
    }

    .wdfp-results-grid.wdfp-columns-2,
    .wdfp-results-grid.wdfp-columns-3,
    .wdfp-results-grid.wdfp-columns-4 {
        grid-template-columns: 1fr;
    }

    .wdfp-card-list {
        flex-direction: column;
    }

    .wdfp-card-list .wdfp-card-image-wrapper {
        width: 100%;
    }

    .wdfp-card-list .wdfp-card-image {
        padding-top: 66.67%;
        height: auto;
    }

    .wdfp-card-list .wdfp-card-content {
        padding: 16px 0 0 0;
    }
}

@media (max-width: 480px) {
    .wdfp-filter-header {
        padding: 16px;
    }

    .wdfp-filter-section {
        padding: 16px;
    }

    .wdfp-filter-actions {
        padding: 16px;
    }

    .wdfp-card-title {
        font-size: 14px;
    }

    .wdfp-price-amount {
        font-size: 15px;
    }
}