/**
 * Park Filter Shortcode Styles
 * 
 * Responsive grid, filter bar, park cards, skeleton loading.
 * Design system: 1400px tube, Astra-compatible.
 *
 * @package StateParksCPT
 * @since 2.5.0
 */

/* ============================================
   Container
   ============================================ */
.pf-container {
    max-width: 1400px;
    margin: 0 auto 3rem;
    padding: 0 clamp(16px, 3vw, 40px);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ============================================
   Filter Bar
   ============================================ */
.pf-filter-bar {
    background: linear-gradient(135deg, #f8faf9 0%, #eef5f0 100%);
    border: 1px solid rgba(46, 125, 50, 0.12);
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 28px;
    position: sticky;
    top: 80px;
    z-index: 50;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.3s ease;
}

.pf-filter-bar:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.pf-filter-bar-inner {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pf-results-count {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(46, 125, 50, 0.1);
}

.pf-count-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: #2E7D32;
    letter-spacing: -0.02em;
    line-height: 1;
}

.pf-count-label {
    font-size: 0.95rem;
    color: #5a6c5e;
    font-weight: 500;
}

.pf-filters-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.pf-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 160px;
}

.pf-filter-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7c6e;
}

.pf-select {
    appearance: none;
    -webkit-appearance: none;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7c6e' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 12px center no-repeat;
    padding: 10px 36px 10px 14px;
    border: 1px solid #d4ddd6;
    border-radius: 10px;
    font-size: 0.88rem;
    color: #2d3a30;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.pf-select:hover {
    border-color: #2E7D32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.08);
}

.pf-select:focus {
    outline: none;
    border-color: #2E7D32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
}

.pf-search-group {
    flex: 1.5;
}

.pf-search-wrapper {
    position: relative;
}

.pf-search-input {
    width: 100%;
    padding: 10px 14px 10px 40px !important;
    border: 1px solid #d4ddd6;
    border-radius: 10px;
    font-size: 0.88rem;
    color: #2d3a30;
    transition: all 0.2s ease;
    background: #fff;
    box-sizing: border-box;
}

.pf-search-input:hover {
    border-color: #2E7D32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.08);
}

.pf-search-input:focus {
    outline: none;
    border-color: #2E7D32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
}

.pf-search-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ba89d;
    pointer-events: none;
}

/* ============================================
   Park Grid
   ============================================ */
.pf-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    min-height: 200px;
}

/* ============================================
   Park Cards
   ============================================ */
.pf-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    border: 1px solid #e8ede9;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.pf-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(46, 125, 50, 0.12);
    border-color: rgba(46, 125, 50, 0.25);
}

.pf-card-image-wrap {
    position: relative;
    height: 120px;
    overflow: hidden;
}

.pf-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.pf-card:hover .pf-card-image {
    transform: scale(1.06);
}

.pf-state-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #2E7D32;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 10px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.pf-accessible-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(25, 118, 210, 0.9);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-size: 0.85rem;
    line-height: 1;
    padding: 4px 5px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.pf-card-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.pf-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1a2e1c;
    margin: 0 0 6px 0 !important;
    padding: 0 !important;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pf-card:hover .pf-card-title {
    color: #2E7D32;
}

/* Activity Badges */
.pf-card-activities {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.pf-activity-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
    background: #f0f5f1;
    border-radius: 7px;
    transition: background 0.2s;
}

.pf-card:hover .pf-activity-badge {
    background: #e3efe5;
}

.pf-activity-more {
    font-size: 0.68rem;
    font-weight: 700;
    color: #6b7c6e;
    width: auto;
    padding: 0 8px;
}

/* Rating + Fee */
.pf-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #f0f3f1;
    flex-wrap: wrap;
}

.pf-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.pf-rating-stars {
    display: flex;
    gap: 1px;
    color: #F9A825;
}

.pf-star {
    flex-shrink: 0;
}

.pf-star-empty {
    color: #d4ddd6;
}

.pf-rating-value {
    font-size: 0.82rem;
    font-weight: 700;
    color: #2d3a30;
}

.pf-rating-count {
    font-size: 0.72rem;
    color: #8b998d;
}

.pf-fee {
    font-size: 0.72rem;
    font-weight: 600;
    color: #5a6c5e;
    background: #f5f8f6;
    padding: 2px 8px;
    border-radius: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.pf-fee-free {
    color: #2E7D32;
    background: #e8f5e9;
    font-weight: 700;
}

/* No Results */
.pf-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #6b7c6e;
}

.pf-no-results svg {
    margin-bottom: 16px;
    opacity: 0.4;
}

.pf-no-results h3 {
    font-size: 1.2rem;
    color: #3a4d3c;
    margin: 0 0 8px;
}

.pf-no-results p {
    font-size: 0.9rem;
    margin: 0;
}

/* ============================================
   Load More
   ============================================ */
.pf-load-more-wrap {
    text-align: center;
    padding: 40px 0 20px;
}

.pf-load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #2E7D32;
    color: #fff;
    border: none;
    padding: 14px 36px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(46, 125, 50, 0.25);
}

.pf-load-more-btn:hover {
    background: #1B5E20;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.35);
}

.pf-load-more-btn:active {
    transform: translateY(0);
}

.pf-load-more-btn:disabled {
    background: #a5c8a8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.pf-load-more-info {
    font-size: 0.82rem;
    color: #8b998d;
    margin-top: 12px;
}

/* Spinner */
.pf-spinner {
    animation: pf-spin 1s linear infinite;
}

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

/* ============================================
   Skeleton Loading
   ============================================ */
.pf-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.pf-skeleton-card {
    pointer-events: none;
}

.pf-skeleton-card .pf-card-image {
    background: #eef2ef;
    height: 200px;
}

.pf-skeleton-line {
    height: 14px;
    border-radius: 7px;
    background: #eef2ef;
    margin-bottom: 10px;
}

.pf-skeleton-pulse {
    animation: pf-pulse 1.5s ease-in-out infinite;
}

@keyframes pf-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* ============================================
   Card Entry Animation
   ============================================ */
.pf-card {
    animation: pf-card-in 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes pf-card-in {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

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

/* Stagger animation for cards */
.pf-card:nth-child(3n+1) {
    animation-delay: 0ms;
}

.pf-card:nth-child(3n+2) {
    animation-delay: 60ms;
}

.pf-card:nth-child(3n+3) {
    animation-delay: 120ms;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {

    .pf-grid,
    .pf-skeleton-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .pf-card:nth-child(2n+1) {
        animation-delay: 0ms;
    }

    .pf-card:nth-child(2n+2) {
        animation-delay: 60ms;
    }
}

@media (max-width: 768px) {
    .pf-filter-bar {
        position: static;
        padding: 16px;
        border-radius: 12px;
    }

    .pf-filters-row {
        flex-direction: column;
        gap: 10px;
    }

    .pf-filter-group {
        min-width: 100%;
    }

    .pf-count-number {
        font-size: 1.4rem;
    }
}

@media (max-width: 640px) {

    .pf-grid,
    .pf-skeleton-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .pf-card-image-wrap {
        height: 180px;
    }

    .pf-container {
        padding: 0 16px;
    }
}