/* Custom Styles for Properties Page */
.properties-page {
    min-height: 100vh;
    background: var(--background);
    padding-top: 100px;
    padding-bottom: 3rem;
}

.properties-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Page Header */
.page-header {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.page-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
    background: #2d2d2d;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    font-size: 1.25rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Project Filter Indicator */
.project-filter-indicator {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    animation: slideInDown 0.3s ease-out;
}

.project-filter-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0; /* Allow text to truncate */
}

.project-filter-text {
    font-size: 1rem;
    line-height: 1.4;
}

.project-filter-text strong {
    font-weight: 600;
}

.project-name {
    display: inline;
    word-break: break-word;
}

.clear-project-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
    white-space: nowrap;
    margin-left: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.clear-project-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.clear-project-btn:active {
    transform: translateY(0);
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile responsive for project filter */
@media (max-width: 768px) {
    .project-filter-indicator {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
        align-items: stretch;
        text-align: center;
    }
    
    .project-filter-info {
        justify-content: center;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .project-filter-text {
        font-size: 0.95rem;
    }
    
    .project-name {
        display: block;
        margin-top: 0.25rem;
        font-size: 1.1rem;
        font-weight: 600;
    }
    
    .clear-project-btn {
        margin-left: 0;
        align-self: center;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        min-height: 44px; /* Touch target size */
    }
}

@media (max-width: 480px) {
    .project-filter-indicator {
        margin-left: -1rem;
        margin-right: -1rem;
        border-radius: 0;
    }
    
    .project-filter-text {
        font-size: 0.9rem;
    }
    
    .project-name {
        font-size: 1rem;
    }
}

/* Search Section */
.search-section {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: var(--border-radius);
    padding: 0.6rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.filter-toggle:hover,
.filter-toggle.active {
    border-color: var(--primary-color);
    background: rgba(239, 90, 82, 0.1);
    color: var(--primary-color);
}

.quick-search {
    margin-bottom: 1.5rem;
}

.search-input-group {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 2rem;
    border: 2px solid var(--border);
    border-radius: var(--border-radius);
    font-size: 1.125rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(239, 90, 82, 0.1);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1.125rem;
}

.search-btn {
    position: absolute;
    right: 0.1rem;
    top: 39%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: calc(var(--border-radius) - 2px);
    padding: 1.24rem 2.1rem;
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    background: var(--accent-color);
}

/* Advanced Filters */
.advanced-filters {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    margin-top: 1.5rem;
}

.advanced-filters.active {
    display: grid;
    animation: fadeInUp 0.3s ease-out;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-label {
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.filter-select {
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--border-radius);
    background: var(--white);
    transition: var(--transition);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(239, 90, 82, 0.1);
}

/* Pet Filter Checkbox Styling */
.pet-filter {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--border-radius);
    transition: var(--transition);
    cursor: pointer;
    min-height: 54px;
}

.pet-filter:hover {
    border-color: var(--primary-color);
}

.pet-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    margin: 0;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.pet-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.pet-checkbox i {
    color: var(--text-light);
    transition: var(--transition);
}

.pet-checkbox input[type="checkbox"]:checked + i {
    color: var(--primary-color);
}

.pet-filter:has(input:checked) {
    border-color: var(--primary-color);
    background: rgba(239, 90, 82, 0.05);
}

.filter-actions {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.btn-clear {
    background: var(--text-light);
    color: var(--white);
    border: none;
    padding: 0.4rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.btn-clear:hover {
    background: var(--text-dark);
}

/* Results Header */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-count {
    font-size: 1.125rem;
    color: var(--text-dark);
}

.results-count strong {
    color: var(--primary-color);
    font-weight: 700;
}

.view-options {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.sort-select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--border-radius);
    background: var(--white);
}

.view-toggle {
    display: flex;
    background: var(--background);
    border-radius: var(--border-radius);
    padding: 0.25rem;
    border: 2px solid var(--border);
}

.view-btn {
    padding: 0.5rem 0.75rem;
    border: none;
    background: none;
    cursor: pointer;
    transition: var(--transition);
    border-radius: calc(var(--border-radius) - 0.25rem);
    color: var(--text-light);
}

.view-btn.active,
.view-btn:hover {
    background: var(--white);
    color: var(--primary-color);
    box-shadow: var(--shadow);
}

/* Properties Results */
.properties-results {
    margin-bottom: 2rem;
}

.properties-grid {
    display: none;
    grid-template-rows: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.properties-list {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
}

.properties-map {
    display: none;
    height: 600px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    position: relative;
}

/* Active view states */
.properties-grid.active {
    display: grid !important;
}

.properties-list.active {
    display: flex !important;
}

.properties-map.active {
    display: block !important;
}

.map-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.map-controls {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.map-control-btn {
    background: var(--white);
    border: none;
    border-radius: var(--border-radius);
    padding: 0.75rem;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
}

.map-control-btn:hover {
    background: var(--primary-color);
    color: var(--white);
}

.map-property-popup {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    max-width: 320px;
    border: 2px solid var(--primary-color);
    min-width: 280px;
}

.map-property-popup .popup-title {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.map-property-popup .popup-location {
    color: var(--text-light);
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.map-property-popup .popup-price {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.map-property-popup .popup-features {
    display: flex;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.map-property-popup .popup-features span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.map-property-popup .popup-project {
    background: rgba(239, 90, 82, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
    display: inline-block;
}

.map-property-popup .popup-actions {
    display: flex;
    gap: 0.5rem;
    flex-direction: column;
}

.map-property-popup .btn-sm {
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
    text-align: center;
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.map-property-popup .btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.map-property-popup .btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.map-property-popup .btn-sm:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* List View */
.property-list-item {
    display: flex;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    border: 2px solid transparent;
}

.property-list-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
}

.list-image {
    width: 275px;
    height: 296px;
    overflow: hidden;
    flex-shrink: 0;
}

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

.list-content {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
}

.list-info {
    flex: 1;
}

.list-actions {
    display: -webkit-box ;
    flex-direction: row;
    gap: 0.5rem;
    margin-left: 0rem;
}

/* Loading and Empty States */
.loading-properties {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.loading-properties i {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: spin 1s linear infinite;
    color: var(--primary-color);
}

.empty-results {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-top: -24rem;
}

.empty-results i {
    font-size: 4rem;
    color: var(--primary-color);
    opacity: 0.5;
    margin-bottom: 1rem;
}

.empty-results h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.error-message {
    text-align: center;
    padding: 2rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--border-radius);
    color: #dc2626;
    margin-bottom: 2rem;
}

.error-message i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.retry-btn {
    background: #dc2626;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    margin-top: 1rem;
    transition: var(--transition);
}

.retry-btn:hover {
    background: #b91c1c;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.pagination-btn {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    background: var(--white);
    color: var(--text-dark);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.pagination-btn:hover,
.pagination-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: var(--white);
}

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

/* Enhanced Map Loading */
.map-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: var(--background);
    color: var(--text-light);
}

.map-loading i {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: spin 1s linear infinite;
    color: var(--primary-color);
}

/* ===== SKELETON LOADING STYLES ===== */

/* Base skeleton animation */
@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

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

/* Dark mode skeleton */
.dark-mode .skeleton {
    background: linear-gradient(90deg, #2d2d2d 25%, #3d3d3d 50%, #2d2d2d 75%);
    background-size: 200px 100%;
}

/* Skeleton Grid Cards */
.skeleton-properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.skeleton-property-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 2px solid transparent;
    opacity: 0;
    animation: fadeInUp 0.3s ease-out forwards;
}

.skeleton-property-card:nth-child(1) { animation-delay: 0.1s; }
.skeleton-property-card:nth-child(2) { animation-delay: 0.2s; }
.skeleton-property-card:nth-child(3) { animation-delay: 0.3s; }
.skeleton-property-card:nth-child(4) { animation-delay: 0.4s; }
.skeleton-property-card:nth-child(5) { animation-delay: 0.5s; }
.skeleton-property-card:nth-child(6) { animation-delay: 0.6s; }

.skeleton-property-image {
    width: 100%;
    height: 250px;
    position: relative;
    overflow: hidden;
}

.skeleton-image {
    width: 100%;
    height: 100%;
}

.skeleton-badges {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.skeleton-badge {
    width: 60px;
    height: 24px;
    border-radius: 12px;
}

.skeleton-actions {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    display: flex;
    gap: 0.5rem;
}

.skeleton-action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-property-info {
    padding: 1.5rem;
}

.skeleton-title {
    height: 24px;
    margin-bottom: 0.75rem;
    border-radius: 4px;
}

.skeleton-location {
    height: 18px;
    width: 70%;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.skeleton-price {
    height: 28px;
    width: 50%;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.skeleton-features {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.skeleton-feature {
    height: 20px;
    width: 60px;
    border-radius: 4px;
}

.skeleton-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.skeleton-agent {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-agent-name {
    width: 80px;
    height: 16px;
    border-radius: 4px;
}

.skeleton-view-btn {
    width: 100px;
    height: 36px;
    border-radius: 6px;
}

/* Skeleton List Items */
.skeleton-properties-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.skeleton-list-item {
    display: flex;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 2px solid transparent;
    opacity: 0;
    animation: fadeInUp 0.3s ease-out forwards;
}

.skeleton-list-item:nth-child(1) { animation-delay: 0.1s; }
.skeleton-list-item:nth-child(2) { animation-delay: 0.2s; }
.skeleton-list-item:nth-child(3) { animation-delay: 0.3s; }
.skeleton-list-item:nth-child(4) { animation-delay: 0.4s; }

.skeleton-list-image {
    width: 275px;
    height: 200px;
    flex-shrink: 0;
}

.skeleton-list-content {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
}

.skeleton-list-info {
    flex: 1;
}

.skeleton-list-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-left: 1rem;
}

.skeleton-list-title {
    height: 24px;
    width: 80%;
    margin-bottom: 0.75rem;
    border-radius: 4px;
}

.skeleton-list-location {
    height: 18px;
    width: 60%;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.skeleton-list-price {
    height: 28px;
    width: 40%;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.skeleton-list-features {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.skeleton-list-agent {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.skeleton-list-action {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-list-view-btn {
    width: 120px;
    height: 36px;
    border-radius: 6px;
}

/* Skeleton Map Loading */
.skeleton-map-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: var(--background);
    color: var(--text-light);
    animation: pulse 2s infinite;
}

.skeleton-map-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 1.5rem;
}

.skeleton-map-text {
    height: 24px;
    width: 200px;
    margin-bottom: 0.5rem;
    border-radius: 4px;
}

.skeleton-map-subtext {
    height: 18px;
    width: 150px;
    border-radius: 4px;
}

/* Smooth transition when switching from skeleton to real content */
.properties-grid,
.properties-list {
    transition: opacity 0.3s ease-in-out;
}

.properties-grid.skeleton-to-real,
.properties-list.skeleton-to-real {
    opacity: 0;
    animation: fadeIn 0.5s ease-in-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .properties-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1.5rem;
    }
    
    .skeleton-properties-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1.5rem;
    }
    
    .advanced-filters {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    .properties-container {
        padding: 0 1rem;
    }

    .page-header {
        padding: 1.5rem;
        text-align: center;
    }

    .page-title {
        font-size: 2.5rem;
    }

    .search-section {
        padding: 1.5rem;
    }

    .search-header {
        flex-direction: column;
        align-items: center;
    }

    .advanced-filters {
        grid-template-columns: 1fr;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .properties-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    .skeleton-properties-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    .property-list-item {
        flex-direction: column;
    }

    .skeleton-list-item {
        flex-direction: column;
    }

    .list-image {
        width: 100%;
        height: 200px;
    }

    .skeleton-list-image {
        width: 100%;
        height: 200px;
    }

    .list-content {
        flex-direction: column;
        gap: 1rem;
    }

    .skeleton-list-content {
        flex-direction: column;
        gap: 1rem;
    }

    .list-actions {
        flex-direction: row;
        margin-left: 0;
    }

    .skeleton-list-actions {
        flex-direction: row;
        margin-left: 0;
    }

    .properties-map {
        height: 400px;
    }

    .view-toggle {
        flex-wrap: inherit;
        justify-content: center;
    }

    .view-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .map-property-popup {
        max-width: 260px;
        min-width: 240px;
    }
}

/* Mobile Property Badges */
@media (max-width: 768px) {
    /* Property actions - แสดงเสมอในมือถือ */
    .property-actions {
        position: static;
        opacity: 1;
        flex-direction: row;
        justify-content: center;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--border);
    }

    /* Property badges responsive สำหรับมือถือ */
    .property-badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
        border-radius: 15px;
    }
    
    .property-badge.badge-featured {
        top: 0.5rem;
        left: 0.5rem;
    }
    
    .property-badge.badge-sale_down {
        top: 0.5rem;
        right: 0.5rem;

    }
    
    .property-badge.badge-sale,
    .property-badge.badge-rent {
        top: 0.5rem;
        right: 0.5rem;
    }
    
    .property-badge.badge-transfer {
        top: 0.5rem;
        right: 0.5rem;
    }
    
    /* ถ้ามีทั้ง sale และ rent แสดงพร้อมกัน ให้จัดเรียงแนวตั้ง */
    .property-card:has(.badge-sale) .property-badge.badge-rent {
        top: 2.5rem;
    }
    
    /* ถ้ามีทั้ง featured และ badges อื่นๆ ให้จัดเรียงไม่ทับซ้อน */
    .property-card:has(.badge-featured) .property-badge.badge-sale,
    .property-card:has(.badge-featured) .property-badge.badge-rent {
        top: 0.5rem;
        right: 0.5rem;
    }
    
    .property-card:has(.badge-featured) .property-badge.badge-sale_down {
        bottom: 0.5rem;
        left: 0.5rem;
    }
    
    .property-card:has(.badge-featured) .property-badge.badge-transfer {
        bottom: 0.5rem;
        right: 0.5rem;
    }
}

@media (max-width: 480px) {

    .property-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
        border-radius: 12px;
    }
    
    .property-badge i {
        font-size: 0.7rem;
    }

    .btn-clear {
        background: var(--text-light);
        color: var(--white);
        border: none;
        padding: 0.9rem 1rem;
        border-radius: var(--border-radius);
        cursor: pointer;
        transition: var(--transition);
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeInUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

