/* Phase 6 Bonus Task B4 - Skeleton Loaders & Empty States */

/* Skeleton Loader Styles */
.listing-card.skeleton {
    pointer-events: none;
    user-select: none;
}

.skeleton-img,
.skeleton-text {
    background: linear-gradient(90deg,
            var(--surface-sunken) 0%,
            var(--surface-elevated) 50%,
            var(--surface-sunken) 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

.skeleton-img {
    width: 100%;
    /* height: 180px; Removed to inherit from .listing-photos (260px/220px) */
    border-radius: 12px 12px 0 0;
}

.skeleton-title {
    height: 24px;
    width: 70%;
    margin-bottom: 0.75rem;
}

.skeleton-desc {
    height: 16px;
    width: 90%;
    margin-bottom: 0.5rem;
}

.skeleton-meta {
    height: 16px;
    width: 50%;
}

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

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

@media (prefers-reduced-motion: reduce) {

    .skeleton-img,
    .skeleton-text {
        animation: none;
        background: var(--surface-elevated);
    }
}

/* Empty State Styles */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 500px;
    margin: 0 auto;
    grid-column: 1 / -1;
    /* Span all columns in grid */
}

.empty-state svg {
    color: var(--text-tertiary);
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

/* Rating Filter Pills (Make functional) */
.ll-filter-pill[data-filter="rating"] {
    position: relative;
}

.ll-filter-pill[data-filter="rating"]::after {
    content: attr(data-value);
    display: none;
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.ll-filter-pill[data-filter="rating"].ll-filter-pill--active::after {
    display: block;
}

/* Sort Dropdown Enhancement */
#sort {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M3 6h18M7 12h10M11 18h2'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 40px) center;
    padding-right: 60px;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .empty-state {
        padding: 3rem 1rem;
    }

    .empty-state h3 {
        font-size: 1.25rem;
    }

    .empty-state p {
        font-size: 0.9rem;
    }
}

/* Advanced Filters Toggle */
.ll-search__advanced {
    text-align: center;
    margin: 1rem 0;
}

.ll-filter-toggle {
    background: var(--surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.ll-filter-toggle:hover {
    background: var(--surface-overlay);
    border-color: var(--border-default);
    color: var(--text-primary);
}

.ll-advanced-filters {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.ll-advanced-filters .ll-select {
    min-width: 200px;
}

/* Location Input Wrapper (for geolocation button) */
.ll-search__input-wrapper {
    position: relative;
    flex: 1;
    min-width: 200px;
}

#btn-use-location {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

#btn-use-location:hover {
    color: var(--text-primary);
    background: var(--surface-overlay);
}

#btn-use-location.loading {
    animation: spin-location 1s linear infinite;
    color: var(--accent);
}

@keyframes spin-location {
    100% {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* Mobile responsive - unified forms */
@media (max-width: 600px) {
    .ll-search__form {
        flex-direction: column;
    }

    .ll-search__input-wrapper,
    .ll-search__input,
    .ll-search__select,
    .ll-button {
        width: 100%;
        min-width: unset;
        min-height: 44px;
        /* Touch target size */
    }

    .ll-advanced-filters {
        flex-direction: column;
        gap: 1rem;
    }

    .ll-advanced-filters .ll-select {
        width: 100%;
        min-width: unset;
        min-height: 44px;
    }
}

/* Smooth transitions for category cards / results toggle */
#category-cards,
#results {
    transition: opacity 0.3s ease, display 0s 0.3s;
}

.ll-services__see-all {
    text-align: center;
    margin: 2rem 0;
}