/*------------------------------------------
    Filter Bar (Project Tag Buttons)
------------------------------------------*/
.filter-bar {
    background: transparent;
    flex-direction: column;
    margin: var(--space-xs);
    margin-top: 0;
    overscroll-behavior-x: contain;
}

/* Hide scrollbar for horizontal filter bar */
.filter-bar::-webkit-scrollbar {
    display: none;
}

/* Inner bar for filter tags (horizontal scroll on mobile, grid on desktop) */
.filter-bar-inner {
    display: flex;
    gap: 0.5em;
    border: solid 1px var(--border);
    border-radius: var(--radius-full);
    padding: 0.4em;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

/* Filter Button styles */
.filter-btn {
    padding: 8px 16px;
    white-space: nowrap;
    border: none;
    border-radius: 50px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

.filter-btn:hover {
    background: var(--blur-bg);
    color: var(--text);
}

.filter-btn.active {
    background: var(--accent);
    color: var(--text);
    transform: scale(1.05);
}



/*------------------------------------------
    Project Gallery Grid & Cards
------------------------------------------*/

/* Project card Container */
.project-card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    padding: 0 var(--space-sm);
    gap: var(--space-sm);
}

/* Project Card */

.project-link {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    height: 270px;
}

.project-card {
    max-width: 380px;
    background: var(--bg);
    border: solid 1px var(--border-muted);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-bottom: 1px solid var(--border);
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.project-card:hover {
    background: var(--bg-light);
}

/* Project Card Image */
.project-card-image {
    background: var(--bg-light);
    height: 50%;
    background-size: cover;
    background-position: center;
    z-index: 2;
    transition: transform 0.3s ease;
}

/* Project Card Content */
.project-card-content {
    height: 45%;
    padding: var(--space-sm);
    display: flex;
    flex-direction: column;
    text-align: center;
    justify-content: center;
    text-decoration: none;
    z-index: 1;
}

/* Project Card Title */
.project-card h3 {
    font: var(--h3);
    color: var(--text);
}

/* Project Card details */
.project-card p {
    margin: 0;
    font: var(--p);
    color: var(--text-muted);
}

/*------------------------------------------
    All Projects / Github 3D Button
------------------------------------------*/

.all-projects {
    background: transparent;
    width: 100%;
    display: flex;
    justify-content: center;
    margin: var(--space-sm) 0;
}

.github-link {
    width: fit-content;
    display: flex;
    justify-content: center;
    align-items: center;
}

.button-icon {
    display: flex;
    border: 3px var(--text) solid;
    width: fit-content;
    height: fit-content;
    cursor: pointer;
}

.icon {
    background: var(--text);
    padding: 10px 10px 5px 10px;
}
.icon i {
    width: 25px;
    height: 25px;
    color: var(--bg);
    font-size: 26px;
}

.cube {
    transition: all 0.4s;
    transform-style: preserve-3d;
    width: 200px;
    height: 20px;
}

/* 3D cube flip on hover */
.button-icon:hover .cube {
    transform: rotateX(90deg);
}

.side {
    position: absolute;
    height: 47px;
    width: 200px;
    display: flex;
    font-size: 0.8em;
    justify-content: center;
    align-items: center;
    letter-spacing: 0.5px;
    font-weight: bold;
}
.top {
    background: var(--accent);
    color: var(--text);
    transform: rotateX(-90deg) translate3d(0, 13.5px, 2em);
}
.front {
    background: var(--bg-dark);
    color: var(--text);
    transform: translate3d(0, 0, 1em);
}

/*------------------------------------------
    File Path (Breadcrumbs)
------------------------------------------*/

.file-path {
    min-height: 60px;
    color: var(--text);
    padding: var(--space-md);
    background: var(--bg-dark);
    font-size: .8rem;
    font-weight: 300;
    line-height: 1.7;
    flex-wrap: wrap;
    align-items: center;
    position: sticky;
    top: 0;
    display: flex;
    z-index: 1000;
}

.file-path a {
    color: var(--text);
}
.file-path a:hover {
    text-decoration: underline;
}
.file-path i {
    margin: 0 var(--space-md);
}

/*------------------------------------------
    Project Details Page Styles
------------------------------------------*/
.main-container {
    background: var(--bg-dark);
}
.project-details-container {
    min-height: 100vh;
    margin: 0 var(--space-xs);
    border-radius: var(--radius-sm);
    background: var(--bg-dark);
}

.project-details {
    max-width: 600px;
    margin: auto;
    color: var(--text);
    border-radius: var(--radius-sm);
    padding-bottom: var(--space-xxs);
}

/* Details header image/title */
.project-header img {
    width: 100%;
    aspect-ratio: 2/1;
    object-fit: cover;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.project-header h1 {
    font-size: 1.6rem;
    text-align: left;
    margin: var(--space-xs);
}

.meta {
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin: var(--space-md);
}

.project-description {
    font-size: 0.9rem;
    color: var(--text);
    margin: var(--space-xs);
    border-radius: var(--radius-md);
}
.project-description h4 {
    color: #7ae582;
}

.project-details h4 {
    margin-bottom: var(--space-sm);
}

/* Project goals/info/eval blocks */
.project-goals-container {
    margin: var(--space-md) var(--space-xs);
    padding: 3px;
    border-radius: var(--radius-md);
    box-shadow: #9741fc33 0 0 30px -5px;
    background-image: linear-gradient(144deg,#AF40FF, #5B42F3 50%,#00DDEB);
}
.project-goals {
    background: var(--bg-dark);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
}
.project-goals h4 {
    color: #ffd23f;
}
.project-goals ul {
    list-style: none;
    list-style-position: inside;
}

.project-evaluation {
    padding: var(--space-md);
}
.project-evaluation h4 {
    color: #73c507;
}
.project-evaluation p {
    margin-bottom: var(--space-xs);
    font-weight: 500;
    color: var(--secondary);
}

.project-evaluation img {
    width: 100%;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
}

.code-block {
    font-family: 'Fira Code', monospace;
    background: var(--bg);
    color: var(--text);
    padding: var(--space-sm);
    margin-bottom: var(--space-md);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Embedded video presentation */
.project-presentation {
    max-width: 100%;
    margin: var(--space-md);
    border-radius: var(--radius-md);
}
.project-presentation h4 {
    color: #48cae4;
}
.video-wrapper iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
}

/* Download Presentation */
.dwnld-presentation {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* PDF/Report Viewer */
.project-report-container {
    max-width: 100%;
    margin-bottom: var(--space-md);
    border-radius: var(--radius-md);
}
.project-report-container h4 {
    color: #a551ff;
    margin: var(--space-md) calc(var(--space-sm)*2);
}

.pdf-wrapper {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0 calc(var(--space-sm)*2);
    display: flex;
    overflow-x: auto;
    color: var(--text-muted);
    gap: var(--space-xs);
    scrollbar-width: none; /* Firefox */
    -webkit-overflow-scrolling: touch;
}
.pdf-wrapper::-webkit-scrollbar {
    display: none;
}
.pdf-wrapper iframe {
    width: 90%;
    aspect-ratio: 3/2;
    border: solid 2px #ffffff51;
    border-radius: var(--radius-md);
}


/*------------------------------------------
    Responsive / Desktop Grid Tweaks
------------------------------------------*/

@media (min-width: 768px) {
    .filter-bar {
        margin: var(--space-xs);
        margin-top: 0;
    }
    .filter-bar-inner {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
        width: 100%;
    }
}

@media screen and (min-width: 1024px) {
    main {
        position: relative;
    }

    /* file path  */
    .file-path {
        min-height: unset;
        padding: var(--space-md);
        font-weight: 300;
        display: flex;
        align-items: center;
        justify-content: left;
        top: 55px;
    }

    .project-card-container {
        gap: var(--space-sm);
        padding: 0 var(--space-sm);
    }

    /* Card hover (with image zoom) */
    .project-card:hover {
        transform: scale(1.04);
    }
    .project-card:hover .project-card-image {
        transform: scale(1.05);
    }

    /* Details layout refinements for desktop */
    .project-details-container {
        margin: unset;
        margin-right: var(--space-xs);
        border-radius: var(--radius-sm) var(--radius-sm) 0 0;
        background: var(--bg-dark);
    }
    .project-details {
        background: var(--bg);
        padding: var(--space-xs);
        border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    }
    .project-header img {
        display: none;
    }
    .project-video {
        padding: 0 var(--space-md);
    }
    .project-report-container {
        padding: 0;
        margin-right: var(--space-xs);
        margin-bottom: 0;
        border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    }
    .project-report {
        max-width: 600px;
        margin: auto;
        background: var(--bg);
        border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    }
    .project-report h4 {
        margin-top: 0;
    }
    .pdf-wrapper {
        margin: auto;
        flex-direction: column;
        gap: var(--space-xs);
        padding-bottom: var(--space-md);
    }
    .pdf-wrapper iframe {
        width: 100%;
        aspect-ratio: 16/9;
        border: solid 2px var(--text-muted);
        border-radius: var(--radius-md);
    }
}
