/**
 * Module: Project Completed (Công trình đã thi công)
 * Component CSS for .project-completed
 * Matches mockup perfectly with responsive grid and clean aesthetic
 */

.project-completed {
    position: relative;
    width: 100%;
    padding: 20px 0 40px;
    box-sizing: border-box;
}

.project-completed__container {
    width: 100%;
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* ==========================================================================
   1. Filter Tabs Bar (Pill buttons)
   ========================================================================== */
.project-completed__filter-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px 14px;
    margin: 0 auto 38px auto;
    padding: 0;
}

.project-completed__filter-btn {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 24px;
    border-radius: 9999px;
    background-color: #ffffff;
    color: #1e293b;
    border: 1px solid #d1d5db;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    text-decoration: none;
    outline: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.project-completed__filter-btn:hover {
    color: #006039;
    border-color: #006039;
    background-color: #f0fdf4;
    box-shadow: 0 3px 10px rgba(0, 96, 57, 0.08);
}

.project-completed__filter-btn.is-active {
    background-color: #006039;
    color: #ffffff;
    border-color: #006039;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(0, 96, 57, 0.28);
}

/* ==========================================================================
   2. Projects Grid Layout
   ========================================================================== */
.project-completed__grid {
    display: grid;
    gap: 28px 24px;
    width: 100%;
    transition: opacity 0.3s ease;
}

.project-completed__grid--cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-completed__grid--cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.project-completed__grid--cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 1024px) {
    .project-completed__grid--cols-3,
    .project-completed__grid--cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px 18px;
    }
}

@media (max-width: 640px) {
    .project-completed__grid--cols-2,
    .project-completed__grid--cols-3,
    .project-completed__grid--cols-4 {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .project-completed__filter-bar {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 8px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .project-completed__filter-bar::-webkit-scrollbar {
        display: none;
    }

    .project-completed__filter-btn {
        padding: 7px 18px;
        font-size: 13px;
        flex-shrink: 0;
    }
}

/* ==========================================================================
   3. Card Component
   ========================================================================== */
.project-completed__card {
    background-color: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.35s ease,
                opacity 0.35s ease;
    height: 100%;
    position: relative;
}

.project-completed__card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 32px rgba(0, 96, 57, 0.1);
    border-color: #cbd5e1;
}

/* Image Wrap & Badge */
.project-completed__thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10.5;
    background-color: #f1f5f9;
    overflow: hidden;
}

.project-completed__thumb-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    outline: none;
}

.project-completed__thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-completed__card:hover .project-completed__thumb-wrap img {
    transform: scale(1.06);
}

.project-completed__badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 3;
    display: inline-block;
    padding: 5px 14px;
    background-color: #006039;
    color: #ffffff;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.35;
    border-radius: 9999px;
    letter-spacing: 0.15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
    pointer-events: none;
}

/* Card Body */
.project-completed__body {
    padding: 20px 22px 18px 22px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    background-color: #ffffff;
}

.project-completed__title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
    color: #0f172a;
    margin: 0 0 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-completed__title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.project-completed__title a:hover {
    color: #006039;
}

.project-completed__desc {
    font-size: 13.5px;
    line-height: 1.55;
    color: #64748b;
    margin: 0 0 18px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card Footer */
.project-completed__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #f1f5f9;
    padding-top: 14px;
    margin-top: auto;
    width: 100%;
}

.project-completed__meta {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    gap: 8px;
    flex-wrap: nowrap;
}

.project-completed__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.project-completed__icon {
    stroke: #64748b;
    flex-shrink: 0;
}

.project-completed__meta-sep {
    color: #cbd5e1;
    font-size: 13px;
}

.project-completed__arrow-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: #006039;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 96, 57, 0.22);
}

.project-completed__arrow-btn svg {
    display: block;
    stroke: #ffffff;
    transition: transform 0.2s ease;
}

.project-completed__card:hover .project-completed__arrow-btn {
    background-color: #056941;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 96, 57, 0.32);
}

.project-completed__card:hover .project-completed__arrow-btn svg {
    transform: translateX(2px);
}

/* ==========================================================================
   4. Filter Animations & Empty State
   ========================================================================== */
.project-completed__card.is-hidden {
    display: none !important;
}

.project-completed__card.is-fading-out {
    opacity: 0;
    transform: scale(0.96);
}

.project-completed__card.is-fading-in {
    animation: ltcFadeInUp 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes ltcFadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.project-completed__empty {
    width: 100%;
    text-align: center;
    padding: 48px 20px;
    background-color: #f8fafc;
    border-radius: 12px;
    border: 1px dashed #cbd5e1;
    margin-top: 20px;
}

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