/* ===================================================
   ===== Projects Section =====
=================================================== */

#projects {
    text-align: center;
    background: rgba(255, 255, 255, 0.4);
    margin-top: 20px;
    margin-bottom: 10px;
    border-radius: 16px;
}

.projects-wrap {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #333;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 350px));
    justify-content: center;
    gap: 2rem;
}

/* DRIBBBLE-STYLE INTERACTIVE CARDS */
.project-card {
    perspective: 1000px;
    height: 480px;
    border-radius: 20px;
    box-shadow:
        0 10px 20px rgba(0, 0, 0, 0.08),
        0 6px 6px rgba(0, 0, 0, 0.05);
    /* transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); */
    transition:
        opacity 0.4s ease,
        transform 0.4s ease,
        visibility 0.4s;
    background: white;
    overflow: hidden;
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
}

.project-card:hover {
    transform: translateY(-12px) scale(1.01);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.project-card a {
    text-decoration: none;
    color: black;
}

.project-card a:hover {
    color: blue;
}

body.dark .project-card a {
    color: white;
}

body.dark .project-card a:hover {
    color: #467db4;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-style: preserve-3d;
}

.project-card:hover .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.card-front {
    border-radius: 20px;
}

.card-back {
    transform: rotateY(180deg);
    background: #1e293b;
    color: white;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
}

/* STATIC GLOSS + SHIMMER OVERLAY */
.card-thumbnail {
    /* height: 180px; */
    /* was 240px – shorter = more text fits */
    overflow: hidden;
    position: relative;
}

/* .card-thumbnail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.15) 0%,
            rgba(255, 255, 255, 0.05) 50%,
            rgba(0, 0, 0, 0.1) 100%);
    z-index: 1;
} */

.card-thumbnail::before {
    content: '';
    position: absolute;
    inset: 0;
    /* background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0.2),
            rgba(0, 0, 0, 0.2)); */
    pointer-events: none;
}

/* SHIMMER ANIMATION (subtle loop) */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

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

.card-thumbnail::after {
    content: '';
    position: absolute;
    top: 0;
    left: -200%;
    width: 200%;
    height: 100%;
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0.2),
            rgba(0, 0, 0, 0.5));
    opacity: 0.5;
    animation: shimmer 4.5s infinite;
    z-index: 2;
}

/* HOVER: Remove shimmer, enhance gradient */
.project-card:hover .card-thumbnail::after {
    animation: none;
    opacity: 0;
}

.project-card:hover .card-thumbnail::before {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.3) 0%,
            transparent 50%,
            rgba(0, 0, 0, 0.2) 100%);
}

.card-thumbnail img {
    width: 100%;
    height: 100%;
    /* object-fit: cover; */
    /* focus on center of text, not the top empty area */
    object-position: center center;
    transition: transform 0.6s ease;
}

.project-card:hover .card-thumbnail img {
    transform: scale(1.15);
}

.card-links {
    display: flex;
    gap: 0.75rem;
}

.btn-live,
.btn-github {
    flex: 1;
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    border-radius: 10px;
}

.btn-live {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
}

.btn-live:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(99, 102, 241, 0.3);
}

.btn-github {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-github:hover {
    background: rgba(255, 255, 255, 0.3);
}

.project-tagline {
    display: block;
    font-size: 0.75rem;
    color: #94a3b8;
    letter-spacing: 0.5px;
    margin-bottom: 0.6rem;
    text-transform: uppercase;
}

/* =========================================
======= Filter UI + Animation ===========
========================================== */
/* FILTER BUTTONS */
.project-filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 20px;
    border-radius: 30px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #fff;
    cursor: pointer;
    font-weight: 600;
    font-family: var(--font-primary);
    transition: all 0.3s ease;
}

/* .filter-btn:hover {
    background: #d1d5db;
}

.filter-btn.active {
    background: #6366f1;
    color: white;
} */

body.dark .filter-btn {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

body.dark .filter-btn.active,
body.dark .filter-btn:hover {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

body.dark #projects {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* CARD ANIMATION */

.project-card.hide {
    display: none;
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
    position: absolute;
    visibility: hidden;
}

.projects-grid {
    position: relative;
    min-height: 500px;
    /* prevents jump */
}

.projects-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    margin-bottom: -40px;
}

.project-nav-btn {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(30, 41, 59, 0.85);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.project-nav-btn:hover {
    transform: translateY(-2px);
}

/* ==========================================
   TABLET — LIVE WORKS SECTION
   769px to 1024px
========================================== */
@media (min-width: 769px) and (max-width: 1024px) {

    /* ======================================
       PROJECT FILTERS
    ====================================== */

    .project-filters {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 10px;
    }


    /* Hide ALL button on tablet */
    .filter-btn[data-filter="all"] {
        display: none;
    }


    /* Tablet buttons are indicators */
    .filter-btn {
        pointer-events: auto;
        cursor: pointer;
    }

    /* ======================================
       PROJECT GRID
    ====================================== */

    .projects-grid {
        grid-template-columns: repeat(2, minmax(280px, 350px));
        justify-content: center;
        align-items: start;
        gap: 2rem;
        min-height: auto;
    }


    /* ======================================
       SINGLE CARD — CENTER
    ====================================== */

    .projects-grid.tablet-single {
        grid-template-columns: minmax(280px, 350px);
        justify-content: center;
    }


    /* ======================================
       PROJECT CARD
    ====================================== */

    .project-card {
        width: 100%;
        max-width: 350px;
        height: 420px;
        margin: 0 auto;
    }


    /* ======================================
       NAVIGATION
    ====================================== */

    .projects-navigation {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 12px;
        margin-top: 25px;
        margin-bottom: 0;
    }


    .project-nav-btn {
        display: inline-flex;
        justify-content: center;
        align-items: center;
    }

}

/* ==========================================
   MOBILE — LIVE WORKS
========================================== */

@media (max-width: 768px) {

    /* ======================================
       FILTER BUTTONS
    ====================================== */

    .project-filters {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
    }


    /* Hide ALL button on mobile */
    .filter-btn[data-filter="all"] {
        display: none;
    }


    /* Buttons are visual indicators only */
    .filter-btn {
        pointer-events: auto;
        cursor: pointer;
    }

    /* ======================================
       PROJECT GRID
    ====================================== */

    .projects-grid {
        grid-template-columns: 1fr;
        justify-content: center;
        align-items: start;
        gap: 2rem;
        min-height: auto;
    }


    /* ======================================
       SINGLE MOBILE CARD
    ====================================== */

    .projects-grid.mobile-single {
        grid-template-columns: minmax(0, 350px);
        justify-content: center;
    }


    /* ======================================
       PROJECT CARD
    ====================================== */

    .project-card {
        width: 100%;
        max-width: 350px;
        height: 480px;
        margin: 0 auto;
    }


    /* ======================================
       NAVIGATION
    ====================================== */

    .projects-navigation {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        margin-top: 20px;
        margin-bottom: 0;
    }


    .project-nav-btn {
        display: inline-flex;
        justify-content: center;
        align-items: center;
    }

}