/**
 * Flatsome UX Builder Component: Project Filter
 * Module: inc/builder/project-filter/project-filter.css
 * Class: project-filter
 */

.project-filter {
    position: relative;
    width: 100%;
    padding: 20px 0 40px;
    background: transparent;
    font-family: inherit;
}

.project-filter__container {
    max-width: 1240px;
    margin: 0 auto;
    padding-left: 15px;
    padding-right: 15px;
}

/* ==========================================================================
   1. Toolbar (Category Tabs & Search Box)
   ========================================================================== */
.project-filter__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

/* Category Tabs */
.project-filter__tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.project-filter__tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: #334155;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    text-decoration: none;
    outline: none;
    box-shadow: none;
}

.project-filter__tab:hover {
    color: #00583b;
    background: #f0fdf4;
}

.project-filter__tab.is-active {
    background: #00583b;
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 88, 59, 0.2);
}

/* Search Box */
.project-filter__search {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 260px;
    max-width: 340px;
    width: 100%;
    height: 42px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 0 16px 0 40px;
    transition: all 0.25s ease;
    box-sizing: border-box;
}

.project-filter__search:focus-within {
    border-color: #00583b;
    box-shadow: 0 0 0 3px rgba(0, 88, 59, 0.12);
}

.project-filter__search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    pointer-events: none;
}

.project-filter__search-input {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: #1e293b;
    padding: 0;
    box-shadow: none;
}

.project-filter__search-input::placeholder {
    color: #94a3b8;
}

.project-filter__search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: none;
    background: #e2e8f0;
    color: #64748b;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s;
}

.project-filter__search-clear:hover {
    background: #cbd5e1;
    color: #1e293b;
}

/* ==========================================================================
   2. Projects Grid
   ========================================================================== */
.project-filter__grid {
    display: grid;
    gap: 24px;
    margin-bottom: 20px;
}

.project-filter__grid--col-4 {
    grid-template-columns: repeat(4, 1fr);
}

.project-filter__grid--col-3 {
    grid-template-columns: repeat(3, 1fr);
}

.project-filter__grid--col-2 {
    grid-template-columns: repeat(2, 1fr);
}

/* Project Card */
.project-filter__card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #edf2f7;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1),
                box-shadow 0.3s cubic-bezier(0.165, 0.84, 0.44, 1),
                border-color 0.3s ease;
    box-sizing: border-box;
}

.project-filter__card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(0, 48, 30, 0.08);
    border-color: #cbd5e1;
}

/* Thumbnail */
.project-filter__thumb {
    position: relative;
    display: block;
    width: 100%;
    height: 195px;
    overflow: hidden;
    background: #f1f5f9;
}

.project-filter__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.project-filter__card:hover .project-filter__thumb img {
    transform: scale(1.06);
}

/* Card Body */
.project-filter__body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 18px 20px 22px;
}

.project-filter__badge-wrap {
    margin-bottom: 10px;
}

.project-filter__badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    color: #00583b;
    background: #e8f5e9;
    border-radius: 999px;
    letter-spacing: 0.2px;
}

/* Title */
.project-filter__title {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.45;
    color: #1e293b;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 46px;
}

.project-filter__title a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.2s ease;
}

.project-filter__title a:hover {
    color: #00583b;
}

/* Location */
.project-filter__location {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 16px;
}

.project-filter__loc-icon {
    display: flex;
    align-items: center;
    color: #94a3b8;
    flex-shrink: 0;
}

.project-filter__loc-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Footer / Link */
.project-filter__footer {
    margin-top: auto;
    padding-top: 10px;
}

.project-filter__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #00583b;
    text-decoration: none;
    transition: gap 0.25s ease, color 0.2s ease;
}

.project-filter__link svg {
    transition: transform 0.25s ease;
}

.project-filter__link:hover {
    color: #00402b;
}

.project-filter__card:hover .project-filter__link svg {
    transform: translateX(4px);
}

/* Empty State */
.project-filter__empty {
    text-align: center;
    padding: 60px 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px dashed #cbd5e1;
    margin-top: 20px;
}

.project-filter__empty-icon {
    margin-bottom: 14px;
}

.project-filter__empty-text {
    font-size: 15px;
    color: #64748b;
    margin: 0;
}

/* ==========================================================================
   3. Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
    .project-filter__grid--col-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .project-filter__toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .project-filter__search {
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    .project-filter__grid--col-4,
    .project-filter__grid--col-3,
    .project-filter__grid--col-2 {
        grid-template-columns: 1fr;
    }
    .project-filter__tabs {
        overflow-x: auto;
        padding-bottom: 6px;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    .project-filter__tab {
        flex-shrink: 0;
    }
}
