/* Base layout for archive page */
.archive-provider-container {
    padding: 0 20px;
}

/* Make category-filter-container sticky on desktop */
.category-filter-container {
    width: 100%;
    margin: 20px 0;
    background-color: #ffffff;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Two-column layout structure */
.archive-layout {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.filters-column {
    width: 25%;
    flex-shrink: 0;
    position: sticky;
    top: var(--filters-top, 140px);
    align-self: flex-start;
    max-height: calc(100vh - var(--filters-top, 140px));
    overflow-y: auto;
}

.posts-column {
    width: 75%;
}

/* Level 1: Categories Row styling */
.category-filter-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 15px;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 15px 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    flex: 1;
    min-width: 100px;
    max-width: 160px;
    border: 1px solid #f3f3f3;
}

.category-item:hover {
    background-color: #f0f0f0;
    transform: translateY(-3px);
}

.category-item.active {
    border: 2px solid transparent;
    border-radius: 8px;
    background: 
        linear-gradient(#FFF7EC, #FFF7EC) padding-box,
        linear-gradient(to bottom right, #FFAC33, #FF9999) border-box;
}

.category-icon {
    width: 25px;
    height: 25px;
    margin-bottom: 7px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #4a6ee0;
}

.category-icon i {
    font-size: 24px;
}

.category-name {
    margin: 0;
    font-size: 14px;
    font-weight: 600 !important;
}

/* Sub-filter container for Type and Activity rows */
.sub-filter-container {
    display: flex;
    flex-wrap: nowrap;
    gap: 20px;
}
.sub-filter-container .filter-level-options a{
    font-size: 0.85rem;
}

/* Level 2 and 3: Type and Activity Filter Rows */
.type-filter-row,
.activity-filter-row {
    display: flex;
    align-items: center;
    background-color: #f0f0f0;
    padding: 15px;
    border-radius: 6px;
    flex-wrap: wrap;
    gap: 10px;
    flex: 1; /* Each row takes equal width */
    min-width: 0; /* Prevents overflow */
}

.filter-level-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    min-width: 80px;
}

.filter-level-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.filter-option {
    display: inline-block;
    padding: 4px 10px;
    background-color: #fff;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #444;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid #ddd;
}

.filter-option:hover {
    color: #444;
    border: 1px solid transparent;
    border-radius: 8px;
    background: 
        linear-gradient(to right, rgba(255, 172, 51, 0.2), rgba(255, 153, 153, 0.2)) padding-box,
        linear-gradient(to right, #FFAC33, #FF9999) border-box;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.filter-option.active {
    background: linear-gradient(to right, #FF8C00, #FF6B6B);
    color: white;
    border-color: transparent; /* optional: keeps the border clean */
  }

/* Filter form styling */
.filter-form {
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08); */
}

/* Filter action buttons */
.filter-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.clear-filters {
    background: #63b2f2;
    color: white;
    border: none;
    padding: 10px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s;
}

.clear-filters:hover {
    background: #278ee1;
}

/* Providers grid */
.providers-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Provider card styling */
.provider-card {
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: transform 0.3s ease-in-out;
    position: relative;
}

.provider-card:hover {
    transform: scale(1.03);
}

.provider-title {
    font-size: 1.2em;
    margin: 10px 0 0 0 !important;
}

/* Shiny effect with spin on card hover for the star icon in featured listings */
.featured-listings-section .provider-title .fa-star {
    color: #ffd700;
    font-size: 16px;
    margin-right: 4px;
    position: relative;
    display: inline-block;
    animation: pulse-star 1.5s ease-in-out infinite;
}

.featured-listings-section .provider-title .fa-star::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    animation: sparkle 2s ease-in-out infinite;
    z-index: 1;
}

/* Pulse animation for the star */
@keyframes pulse-star {
    0%, 100% {
        transform: scale(1);
        text-shadow: 0 0 4px rgba(255, 215, 0, 0.5);
    }
    50% {
        transform: scale(1.15);
        text-shadow: 0 0 6px rgba(255, 215, 0, 0.7);
    }
}

/* Sparkle animation */
@keyframes sparkle {
    0% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0.8;
    }
    50% {
        transform: translate(8px, -8px) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: translate(0, 0) rotate(360deg);
        opacity: 0.8;
    }
}

/* Spin animation for hover */
@keyframes spin-star {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Hover effect with spin on provider card */
.featured-listings-section .provider-card:hover .provider-title .fa-star {
    color: #ffeb3b;
    text-shadow: 0 0 8px rgba(255, 235, 59, 0.8);
    animation: spin-star 1s ease-in-out !important;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.featured-listings-section .provider-title {
    display: inline-block;
    padding: 5px;
}

.featured-listings-section .provider-card {
    pointer-events: auto;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .featured-listings-section .provider-title .fa-star {
        font-size: 14px;
        margin-right: 6px;
    }
    .featured-listings-section .provider-title .fa-star::after {
        width: 5px;
        height: 5px;
    }
    .featured-listings-section .provider-title {
        padding: 3px;
    }
}

.provider-meta {
    padding: 0 10px 10px;
    font-size: 0.9em;
    color: #555;
}

.provider-image {
    position: relative;
}

.provider-image img {
    width: 100%;
    height: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    aspect-ratio: 16/10;
    object-fit: cover;
}

/* Tag overlays */
.tag-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 25%;
    display: flex;
    flex-direction: row;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    z-index: 1;
    border-radius: 0 0 8px 8px;
}

.tag-overlay h4 {
    margin: 0;
    padding: 0;
    color: rgb(255, 255, 255);
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.35);
}

.tag-overlay-top-right {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    gap: 5px;
    padding: 5px;
    box-sizing: border-box;
}

/* Gradient and blur effects */
.tag-overlay::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to top, 
        rgba(255, 255, 255, 0.6) 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        rgba(255, 255, 255, 0) 100%
    );
    z-index: -1;
    border-radius: 0 0 8px 8px;
}

.tag-overlay::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: -2;
    border-radius: 0 0 8px 8px;
}

/* Tags styling */
.tag-container {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.provider-tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1rem !important;
    color: #353535;
    background: #fff;
}

.location-tag {
    font-size: 11px;
    color: #8d8d8d;
    font-weight: 500;
}

.location-tag i {
    margin-right: 5px;
}

/* Fallback for browsers without backdrop-filter support */
@supports not ((backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px))) {
    .tag-overlay::before {
        background: linear-gradient(
            to top, 
            rgba(255, 255, 255, 0.85) 0%, 
            rgba(255, 255, 255, 0.65) 50%, 
            rgba(255, 255, 255, 0) 100%
        );
    }
}

/* Pagination styling */
.pagination-container {
    margin-top: 30px;
    text-align: center;
}

.pagination-container .nav-links {
    display: inline-flex;
    gap: 5px;
}

.pagination-container .page-numbers {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-decoration: none;
}

.pagination-container .current {
    background-color: #f9f9f9;
    border-radius: 3px;
    text-decoration: none;
}

.pagination-container .current {
    background-color: #f9f9f9;
    font-weight: bold;
}


/* Infinite scroll styling */
.infinite-scroll-loader {
    text-align: center;
    padding: 20px 0;
    width: 100%;
    display: none;
}

.loader-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #4a6ee0;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 10px;
}

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

.infinite-scroll-end {
    text-align: center;
    padding: 30px 0;
    color: #666;
    font-style: italic;
    display: none;
}

/* Remove the pagination container */
.pagination-container {
    display: none;
}

/* Video preview styling */
.provider-image {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.provider-video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 62.5%;
    border-radius: 8px;
    overflow: hidden;
}

.provider-video-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease-in-out;
    border-radius: 8px;
    z-index: 1;
}

.provider-video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    z-index: 0;
}

/* When video is loaded, hide the image */
.provider-image[data-video-loaded="true"] img {
    opacity: 0;
    z-index: 0;
}

.provider-image[data-video-loaded="true"] video {
    z-index: 1;
}

/* Tag overlays need to be above both video and image */
.tag-overlay, 
.tag-overlay-top-right {
    z-index: 2;
}


/* Search Bar styling */
.provider-search-container {
    margin-bottom: 20px;
    position: relative;
}

.search-input-wrapper {
    position: relative; /* Isolate positioning for icons/button */
}

.search-icon-label {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 16px;
    pointer-events: none;
    transition: color 0.3s ease;
}

#provider-search:focus + .search-icon-label,
.search-icon-label:hover {
    color: #4a6ee0;
}

#provider-search {
    width: 100%;
    padding: 10px 120px 10px 40px;
    font-size: 16px;
    border: 2px solid transparent;
    border-radius: 30px;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(to right, #FFAC33, #FF9999) border-box;
  
    transition: border-color 0.3s ease;
    box-sizing: border-box;
  }

#provider-search:focus {
    border-color: #4a6ee0;
    outline: none;
    background-color: #e6f0ff;
}

#clear-search {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #63b2f2;
    color: white;
    border: none;
    padding: 5px 10px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

#clear-search:hover {
    background: #278ee1;
}

#clear-search i {
    font-size: 14px;
}

#search-loading {
    text-align: center;
    margin-top: 10px;
    color: #666;
    font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    #provider-search {
        padding: 10px 90px 10px 30px; /* Adjust for mobile */
    }
    
    .search-icon-label {
        left: 5px;
        font-size: 14px;
    }
    
    #clear-search {
        padding: 4px 8px;
        font-size: 12px;
        right: 5px;
    }
    
    #clear-search i {
        font-size: 12px;
    }
}


/* Responsive design */
@media (max-width: 1200px) {
    .category-filter-row {
        justify-content: center;
    }
    
    .category-item {
        min-width: 90px;
        max-width: 130px;
        border: 1px solid #dadada;
    }
}

@media (max-width: 992px) {
    .archive-layout {
        flex-direction: column;
    }
    
    .filters-column,
    .posts-column {
        width: 100%;
    }
    
    .providers-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filters-column {
        max-height: none;
        overflow-y: visible;
        position: static;
    }
    
    .filter-form {
        height: auto;
        overflow-y: visible;
        padding: 0;
        gap: 7px;
    }
    
    .category-filter-container {
        position: static;
        z-index: auto;
    }
    
    .sub-filter-container {
        flex-direction: column; /* Stack on tablet and below */
        gap: 10px;
    }
}

@media (max-width: 576px) {
    .category-filter-row {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 15px;
        padding-bottom: 10px;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }
    
    .filters-column .category-filter-row {
        flex-wrap: wrap;
        justify-content: center;
        overflow-x: visible;
        overflow-y: visible;
        padding-bottom: 0;
    }
    
    .category-filter-row::-webkit-scrollbar {
        height: 3px;
    }
    
    .category-filter-row::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.1);
        border-radius: 10px;
    }
    
    .category-filter-row::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.3);
        border-radius: 10px;
    }
    
    .category-item {
        flex: 0 0 calc((100vw - 80px) / 3.5);
        min-width: calc((100vw - 80px) / 3.5);
        max-width: calc((100vw - 80px) / 3.5);
    }
    
    .filters-column .category-item {
        flex: 0 0 calc(33.33% - 10px);
        min-width: auto;
        max-width: none;
    }
    
    .providers-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .tag-overlay h4 {
        font-size: 1rem;
        line-height: 1em;
    }
    .provider-video-container {
        padding-bottom: 100%;
    }

    
    .archive-provider-container {
        padding: 0;
    }
    
    .category-filter-container {
        position: sticky;
        top: 0;
        z-index: 100;
        /* background-color: #f9f9f9; */
        margin: 0 0 20px 0;
        /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); */
        gap: 5px;
    }
    
    .filters-column .category-filter-container {
        position: static;
        z-index: auto;
        margin: 20px 0;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    }
    
    .type-filter-row {
        display: flex;
        align-items: flex-start;
        background-color: #f0f0f0;
        padding: 10px 15px;
        border-radius: 6px;
        flex-wrap: wrap;
        gap: 10px;
        overflow-x: visible;
        overflow-y: visible;
    }
    
    .filters-column .type-filter-row {
        flex-wrap: wrap;
        overflow-x: visible;
        overflow-y: visible;
        padding: 15px;
    }
    
    .filter-level-options {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        flex: 1;
        overflow-x: visible;
        overflow-y: visible;
        padding-bottom: 0;
    }
    
    .filters-column .filter-level-options {
        flex-wrap: wrap;
        overflow-x: visible;
        overflow-y: visible;
        padding-bottom: 0;
    }
    
    .filter-option {
        flex: 0 0 auto;
        white-space: nowrap;
        min-width: fit-content;
    }
    
    .filter-level-title {
        display: none;
    }
    
    .type-filter-row .filter-level-title {
        align-self: flex-start;
    }
}




/* Filter Toggle Styles - Add to archive-provider.css */

/* Filter group wrapper */
.filter-group {
    position: relative;
}

/* Filter heading with toggle button */
.filter-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* margin: 0 0 10px 0; */
    font-size: 16px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    user-select: none;
    transition: color 0.3s ease;
}

.filter-heading:hover {
    color: #FF8C00;
}

/* Toggle icon button */
.filter-toggle-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF8C00, #FF6B6B);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(255, 140, 0, 0.3);
}

.filter-heading:hover .filter-toggle-icon {
    box-shadow: 0 4px 8px rgba(255, 140, 0, 0.4);
    transform: translateY(-1px);
}

.filter-toggle-icon i {
    transition: transform 0.3s ease;
}

/* Rotate icon when expanded */
.filter-group:not(.collapsed) .filter-toggle-icon i {
    transform: rotate(180deg);
}

/* Filter content area */
.filter-group .type-filter-row {
    max-height: 500px;
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease, padding 0.3s ease;
    /* margin-bottom: 20px; */
}

/* Collapsed state */
.filter-group.collapsed .type-filter-row {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* Desktop: Hide toggle icon, always show content */
@media (min-width: 993px) {
    .filter-toggle-icon {
        display: none;
    }
    
    .filter-heading {
        cursor: default;
    }
    
    .filter-heading:hover {
        color: #333;
    }
    
    /* Always show content on desktop */
    .filter-group .type-filter-row,
    .filter-group.collapsed .type-filter-row {
        max-height: none;
        opacity: 1;
        /* margin-bottom: 20px; */
    }
}

/* Mobile: Show toggle icon, allow collapse */
@media (max-width: 992px) {
    .filter-toggle-icon {
        display: flex;
    }
    
    .filter-heading {
        padding: 8px 0;
    }
}