/* ============================================
   INFINITE SCROLL PORTFOLIO - STYLES
   Updated for JS-driven smooth animation
   ============================================ */

/* Wrapper */
.scroll-wrapper {
    position: relative;
    width: 100%;
    min-height: 90vh;
    background-image: url('../images/Project_Overview/Project_Overview_Scroll.png');
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Container */
.scroll-container {
    width: 100%;
    overflow: hidden;
    padding: 40px 0;
}

/* Track - holds all cards */
.scroll-track {
    display: flex;
    gap: 24px;
    width: max-content;
    height: 60vh;
    /* Hardware acceleration for smooth animation */
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    perspective: 1000px;
    -webkit-perspective: 1000px;
}

/* ============================================
   SCROLL BUTTONS
   ============================================ */

.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.scroll-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.scroll-btn:active {
    transform: translateY(-50%) scale(0.95);
    background: rgba(255, 255, 255, 0.25);
}

.scroll-btn.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.scroll-btn-left {
    left: 20px;
}

.scroll-btn-right {
    right: 20px;
}

.scroll-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: rgba(255, 255, 255, 0.7);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.3s ease;
    pointer-events: none;
}

.scroll-btn:hover svg {
    stroke: rgba(255, 255, 255, 0.95);
}

/* ============================================
   EDGE GRADIENTS
   ============================================ */

.edge-gradient {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100px;
    pointer-events: none;
    z-index: 5;
}

/* .edge-gradient-left {
    left: 0;
    background: linear-gradient(to right, #1a1a1a 0%, transparent 100%);
} */

/* .edge-gradient-right {
    right: 0;
    background: linear-gradient(to left, #1a1a1a 0%, transparent 100%);
} */

/* ============================================
   PROJECT CARDS
   ============================================ */

.project-card {
    display: flex;
    gap: 20px;
    border-radius: 12px;
    padding: 16px;
    margin: 0 0.5%;
    min-width: 50vw;
    height: 60vh;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3); */
    /* Prevent cards from being affected by parent transform */
    transform-style: preserve-3d;
}

.project-card:hover {
    transform: translateY(-4px);
    /* box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5); */
}

/* Card Image */
.card-image {
    width: 300px;
    height: 90%;
    min-width: 55%;
    border-radius: 8px;
    overflow: hidden;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    flex-shrink: 0;
    position: relative;
}

.card-image img {
    width: 90%;
    height: 90%;
    object-fit: cover;
    border-radius: 5px;
}

/* Card Content */
.card-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
    padding: 8px 0;
    max-width: 60%;
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-year {
    color: #888;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.card-title {
    color: #f2eae3;
    font-size: 30px;
    font-weight: 500;
    line-height: 1.3;
    margin: 0;
    padding-top: 20px;
}

/* Card Mockup */
.card-mockup {
    width: 80px;
    height: 80px;
    align-self: flex-end;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-bottom: 60px;
}

/* Custom mockup image */
.card-mockup .mockup-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Default laptop mockup (shown when no custom image) */
.laptop-mockup {
    width: 80px;
    height: 50px;
    background: #333;
    border-radius: 4px 4px 0 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.laptop-mockup::before {
    content: '';
    width: 70px;
    height: 40px;
    background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
    border-radius: 2px;
}

.laptop-mockup::after {
    content: '';
    position: absolute;
    bottom: -6px;
    width: 90px;
    height: 6px;
    background: #444;
    border-radius: 0 0 4px 4px;
}

/* ============================================
   IMAGE CLASSES
   ============================================ */

.card-image.front-elevation {
    background-image: url('../images/Project_Overview/Front-Elevation.png');
}

.card-image.rear-elevation {
    background-image: url('../images/Project_Overview/Rear-Elevation.png');
}

.card-image.site-layout,
.card-image.ground-floor,
.card-image.first-floor,
.card-image.second-floor {
    width: 450px;
    min-width: 65%;
    background-size: contain;
}

.card-image.site-layout {
    background-image: url('../images/Portfolio_Scroll_Section/Site-Plans.webp');
}

.card-image.ground-floor {
    background-image: url('../images/Portfolio_Scroll_Section/Ground-Floor-Plans.webp');
}

.card-image.first-floor {
    background-image: url('../images/Portfolio_Scroll_Section/First-Floor-Plans.webp');
}

.card-image.second-floor {
    background-image: url('../images/Portfolio_Scroll_Section/Second-Floor-Plans.webp');
}

/* ============================================
   PORTFOLIO SECTION TITLE
   ============================================ */

.portfolio-section-title {
    width: 100%;
    padding: 80px 20px;
    text-align: center;
    background-color: transparent;
    /* Reset any inherited margins/margins */
    margin: 0;
    box-sizing: border-box;
}

.portfolio-section-title .subtitle {
    /* color: rgba(255,255,255,0.9); */
    font-family: 'Montserrat', sans-serif;
    font-size: 34px;
    font-weight: 400;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin: 0 0 12px;
}

.portfolio-section-title h2 {
    /* color: #ffffff; */
    font-family: 'Montserrat', sans-serif;
    font-size: 56px;
    font-weight: 700;
    line-height: 1.05;
    margin: 0;
    letter-spacing: 0.5px;
    /* text-shadow: 0 4px 18px rgba(0,0,0,0.6); */
}

/* Line + Word-by-word horizontal animation */
.portfolio-section-title h2 .line {
    display: block; /* wrap each line */
    overflow: visible;
    margin: 6px 0;
}

.portfolio-section-title h2 .line .word {
    display: inline-block;
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    white-space: nowrap;
}

/* Animated state - words slide in from left (staggered via inline transition-delay) */
.portfolio-section-title.animate-in h2 .line .word {
    opacity: 1;
    transform: translateX(0);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .portfolio-section-title { padding: 48px 12px; }
    .portfolio-section-title h2 { font-size: 32px; }
    .portfolio-section-title .subtitle { font-size: 12px; margin-bottom: 8px; }
}

/* ============================================
   LANDSCAPE IMAGE ABOVE SCROLL
   ============================================ */

.landscape-image-container {
    width: 100%;
    padding: 0;
    margin: 0;
    overflow: hidden;
    position: relative;
    /* background-color: #0c0c0c; */
}

/* Top gradient blend to transition from the section above */
.landscape-image-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(to bottom,
        #f2eae3 0%,
        rgba(242, 234, 227, 0.5) 40%,
        rgba(242, 234, 227, 0.3) 70%,
        transparent 100%);
    z-index: 1;
    pointer-events: none;
}

.landscape-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    object-position: center center;
}

/* ============================================
   PORTFOLIO IMAGE LIGHTBOX MODAL (Click to Enlarge)
   ============================================ */

.portfolio-lightbox-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    font-family: Montserrat, system-ui, Arial;
    background: transparent;
}

.portfolio-lightbox-modal.show {
    display: flex;
}

.portfolio-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(6, 8, 10, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
    opacity: 0;
    animation: portfolioFadeIn 0.25s forwards;
}

.portfolio-lightbox-dialog {
    position: relative;
    width: 90vw;
    max-width: 900px;
    height: 85vh;
    max-height: 800px;
    background-color: rgba(31, 53, 51, 0.40);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.1);
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    animation: portfolioPopIn 0.3s 0.1s forwards;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: max-width 0.4s ease, max-height 0.4s ease;
}

/* Enlarged state for dialog */
.portfolio-lightbox-dialog.enlarged {
    max-width: 95vw;
    max-height: 95vh;
    width: 95vw;
    height: 95vh;
}

.portfolio-lightbox-close {
    position: absolute;
    right: 16px;
    top: 16px;
    width: 44px;
    height: 44px;
    border: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    color: #f2eae3;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.portfolio-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.portfolio-lightbox-close svg {
    width: 18px;
    height: 18px;
}

.portfolio-lightbox-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    height: 100%;
    flex: 1;
    min-height: 0;
}

.lightbox-title {
    color: #f2eae3;
    font-size: 24px;
    font-weight: 600;
    padding: 8px 0;
    padding-right: 50px;
    border-bottom: 1px solid rgba(242, 234, 227, 0.2);
    flex-shrink: 0;
}

/* Image wrapper - click to enlarge */
.lightbox-image-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 16px;
    position: relative;
    cursor: zoom-in;
    overflow: hidden;
    min-height: 0;
}

.portfolio-lightbox-dialog.enlarged .lightbox-image-wrapper {
    cursor: zoom-out;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
    transition: transform 0.4s ease;
}

/* Hide image when no src is set */
.lightbox-image:not([src]),
.lightbox-image[src=""] {
    display: none !important;
}

/* Hint text */
.lightbox-hint {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(242, 234, 227, 0.6);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 16px;
    border-radius: 20px;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.portfolio-lightbox-dialog.enlarged .lightbox-hint {
    opacity: 0;
}

@keyframes portfolioPopIn {
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes portfolioFadeIn {
    to {
        opacity: 1;
    }
}

/* Closing animations */
.portfolio-lightbox-modal.closing .portfolio-lightbox-overlay {
    animation: portfolioFadeOut 0.25s forwards;
}

.portfolio-lightbox-modal.closing .portfolio-lightbox-dialog {
    animation: portfolioPopOut 0.25s forwards;
}

@keyframes portfolioFadeOut {
    to {
        opacity: 0;
    }
}

@keyframes portfolioPopOut {
    to {
        transform: translateY(20px) scale(0.95);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .portfolio-lightbox-overlay,
    .portfolio-lightbox-dialog {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* Make card-image clickable */
.card-image {
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.card-image:hover {
    transform: scale(1.02);
}

/* Custom cursor for card images */
.card-image::after {
    content: 'Open';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    /* color: #0c0c0c; */
    color: white;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    pointer-events: none;
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.card-image:hover::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

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

/* Tablet breakpoint */
@media (max-width: 1024px) {
    /* Scroll wrapper height for tablets */
    .scroll-wrapper {
        min-height: 90vh;
    }

    /* Landscape image - fixed height with aspect ratio preserved (clipped) */
    .landscape-image-container {
        height: 35vh;
        overflow: hidden;
    }

    .landscape-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center center;
    }

    .portfolio-section-title {
        padding: 40px 20px;
    }

    .portfolio-section-title h2 {
        font-size: 32px;
    }
}

/* Mobile breakpoint */
@media (max-width: 768px) {
    /* Scroll wrapper height for mobile */
    .scroll-wrapper {
        min-height: 90vh;
    }

    .project-card {
        min-width: 50vw;
        height: 60vh;
        padding: 12px;
        gap: 16px;
    }

    .card-image {
        width: 250px;
    }

    /* Floor plan images responsive */
    .card-image.site-layout,
    .card-image.ground-floor,
    .card-image.first-floor,
    .card-image.second-floor {
        width: 300px;
        min-width: 55%;
    }

    .card-title {
        font-size: 18px;
    }

    .card-mockup {
        width: 65px;
        height: 65px;
    }

    .laptop-mockup {
        width: 60px;
        height: 38px;
    }

    .laptop-mockup::before {
        width: 52px;
        height: 30px;
    }

    .laptop-mockup::after {
        width: 70px;
        height: 5px;
    }

    .scroll-btn {
        width: 40px;
        height: 40px;
    }

    .scroll-btn-left {
        left: 10px;
    }

    .scroll-btn-right {
        right: 10px;
    }

    .scroll-btn svg {
        width: 16px;
        height: 16px;
    }

    .edge-gradient {
        width: 60px;
    }

    /* Portfolio lightbox modal responsive */
    .portfolio-lightbox-dialog {
        width: 95vw;
        height: 90vh;
        max-height: none;
        padding: 16px;
    }

    .portfolio-lightbox-dialog.enlarged {
        width: 98vw;
        height: 98vh;
    }

    .lightbox-title {
        font-size: 20px;
    }

    .lightbox-image-wrapper {
        padding: 12px;
    }

    .lightbox-hint {
        font-size: 12px;
        padding: 6px 12px;
        bottom: 16px;
    }

    .portfolio-lightbox-close {
        width: 36px;
        height: 36px;
        right: 10px;
        top: 10px;
    }

    .portfolio-lightbox-close svg {
        width: 16px;
        height: 16px;
    }

    /* Smaller custom cursor on mobile */
    .card-image::after {
        width: 55px;
        height: 55px;
        font-size: 10px;
    }
}

/* Small mobile breakpoint */
@media (max-width: 480px) {
    /* Scroll wrapper height for small mobile */
    .scroll-wrapper {
        min-height: 90vh;
    }

    .portfolio-section-title {
        padding: 30px 0px;
    }

    .portfolio-section-title h2 {
        font-size: 24px;
    }

    .project-card {
        min-width: 80vw;
        height: 50vh;
        padding: 10px;
        gap: 12px;
    }

    .card-image {
        width: 200px;
    }

    .card-image.site-layout,
    .card-image.ground-floor,
    .card-image.first-floor,
    .card-image.second-floor {
        width: 280px;
        min-width: 50%;
    }

    .card-title {
        font-size: 14px;
        padding-top: 10px;
    }

    .card-year {
        font-size: 12px;
    }

    .card-mockup {
        width: 50px;
        height: 50px;
    }

    /* Portfolio lightbox modal small mobile */
    .portfolio-lightbox-dialog {
        width: 96vw;
        height: 95vh;
        padding: 12px;
        border-radius: 10px;
    }

    .portfolio-lightbox-dialog.enlarged {
        width: 99vw;
        height: 99vh;
    }

    .portfolio-lightbox-content {
        gap: 12px;
    }

    .lightbox-title {
        font-size: 16px;
        padding: 6px 0;
        padding-right: 40px;
    }

    .lightbox-image-wrapper {
        padding: 8px;
    }

    .lightbox-hint {
        font-size: 11px;
        padding: 5px 10px;
        bottom: 12px;
    }

    .portfolio-lightbox-close {
        width: 32px;
        height: 32px;
        right: 8px;
        top: 8px;
    }

    .portfolio-lightbox-close svg {
        width: 14px;
        height: 14px;
    }

    .card-image::after {
        width: 45px;
        height: 45px;
        font-size: 9px;
    }

    .scroll-btn {
        width: 35px;
        height: 35px;
    }

    .scroll-btn svg {
        width: 14px;
        height: 14px;
    }
}