/* ===== PROJECT DETAIL PAGE - REDESIGN ===== */

/* Page container - no padding, hero goes edge-to-edge */
.project-detail-page {
    padding: 0;
    margin: 0;
    width: 100%;
}

/* ---- HERO SECTION ---- */
.pd-hero {
    position: relative;
    width: 100%;
    height: 60vh;
    min-height: 400px;
    max-height: 700px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}

.pd-hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.pd-hero__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    will-change: transform;
}

.pd-hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        to bottom,
        rgba(10, 25, 47, 0.25) 0%,
        rgba(10, 25, 47, 0.55) 50%,
        rgba(10, 25, 47, 0.95) 100%
    );
}

.pd-hero__content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 5% 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 2rem;
}

.pd-hero__title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    color: var(--text-primary);
    line-height: 1.15;
    margin-bottom: 0.4rem;
}

.pd-hero__subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin: 0;
}

.pd-hero__actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.pd-hero__link {
    white-space: nowrap;
}

/* ---- BODY / CONTENT AREA ---- */
.pd-body {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 5% 2rem;
}

/* ---- SECTION COMMON ---- */
.pd-section {
    margin-bottom: 3.5rem;
}

.pd-section__title {
    font-size: 1.5rem;
    color: var(--text-accent);
    margin-bottom: 1.2rem;
    position: relative;
    padding-bottom: 0.6rem;
}

.pd-section__title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: var(--accent-blue);
}

.pd-section__content {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1.05rem;
}

.pd-section__content p {
    margin-bottom: 1rem;
}

.pd-section__content ul {
    padding-left: 1.5rem;
    margin: 1rem 0;
}

.pd-section__content li {
    margin-bottom: 0.5rem;
}

/* ---- CHALLENGES BLOCK ---- */
.pd-challenges__block {
    border-left: 3px solid var(--accent-blue);
    padding: 1.2rem 1.5rem;
    background: rgba(100, 255, 218, 0.03);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ---- VIDEO ---- */
.pd-video__player {
    border-radius: var(--radius-md);
    overflow: hidden;
    background-color: #000;
}

.pd-video__player video {
    width: 100%;
    display: block;
    max-height: 450px;
}

/* ---- TECH GRID ---- */
.pd-tech__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
}

.pd-tech__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1.2rem 0.8rem;
    background-color: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid rgba(100, 255, 218, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.pd-tech__item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(100, 255, 218, 0.25);
}

.pd-tech__item i {
    font-size: 2rem;
    color: var(--accent-blue);
}

.pd-tech__item span {
    font-size: 0.85rem;
    color: var(--text-accent);
    text-align: center;
}

/* ---- PROJECT NAVIGATION (prev/next) ---- */
.pd-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(100, 255, 218, 0.1);
}

.pd-nav__card {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 1.5rem;
    background-color: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid rgba(100, 255, 218, 0.08);
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.pd-nav__card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(100, 255, 218, 0.3);
}

.pd-nav__card--next {
    text-align: right;
}

.pd-nav__label {
    font-size: 0.8rem;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.pd-nav__card--next .pd-nav__label {
    justify-content: flex-end;
}

.pd-nav__title {
    font-size: 1.1rem;
    color: var(--text-accent);
    font-weight: 600;
    line-height: 1.3;
}

/* ---- ANIMATION STATES ---- */

/* CSS fallback: initial hidden state */
[data-animate] {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate].pd-visible {
    opacity: 1;
    transform: translateY(0);
}

/* When GSAP is active, it manages opacity/transform directly */
body.gsap-active [data-animate] {
    opacity: 1;
    transform: none;
    transition: none;
}

body.gsap-active .pd-tech__item {
    opacity: 1;
    transform: none;
}

/* Not found state */
.pd-not-found {
    text-align: center;
    padding: 4rem 2rem;
}

.pd-not-found p {
    color: var(--text-secondary);
    margin-top: 1rem;
}

/* ===== BUTTONS (kept from previous design) ===== */

.project-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin: 2rem auto 2rem;
    width: calc(100% - 4rem);
    max-width: calc(1200px - 4rem);
}

.back-projects {
    width: 100%;
    display: flex;
    justify-content: center;
}

.video-button {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    .pd-hero {
        height: 50vh;
        min-height: 320px;
    }

    .pd-hero__content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding-bottom: 2rem;
    }

    .pd-hero__actions {
        flex-wrap: wrap;
    }

    .pd-hero__title {
        font-size: clamp(1.6rem, 6vw, 2.4rem);
    }

    .pd-body {
        padding: 2rem 4% 1.5rem;
    }

    .pd-tech__grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }

    .pd-nav {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .pd-nav__card--next {
        text-align: left;
    }

    .pd-nav__card--next .pd-nav__label {
        justify-content: flex-start;
    }

    .project-buttons {
        width: calc(100% - 2rem);
    }

    .back-projects {
        width: calc(100% - 2rem);
        margin: 1.5rem auto 0;
    }
}

@media (max-width: 576px) {
    .pd-hero {
        height: 45vh;
        min-height: 280px;
    }

    .pd-hero__content {
        padding: 1.5rem 4% 1.5rem;
    }

    .pd-body {
        padding: 1.5rem 4% 1rem;
    }

    .pd-section {
        margin-bottom: 2.5rem;
    }

    .pd-section__title {
        font-size: 1.25rem;
    }

    .pd-tech__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

    .pd-tech__item {
        padding: 1rem 0.6rem;
    }

    .pd-tech__item i {
        font-size: 1.6rem;
    }

    .pd-nav__card {
        padding: 1rem;
    }

    .pd-video__player video {
        max-height: 300px;
    }
}
