/* Only style elements within project container */
.projects-container * {margin:0;padding:0;box-sizing:border-box}
.projects-container{
    font-family:'Inter',system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Ubuntu,'Helvetica Neue',Arial,sans-serif;
    /*background:linear-gradient(135deg,#667eea 0%,#764ba2 100%);*/
    color:#333;position:relative;padding:2rem 0;
}
.sticky-wrapper{position:relative;}
.project-row {
    position: relative;
    width: 100%;
    height: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch; 
    margin-bottom: 3rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
    opacity: 1;
    transform: scale(1);
    transition: all 0.5s ease;
}


.project-content{
    padding:3rem 2rem;height:100%;min-height:500px;display:flex;flex-direction:column;justify-content:center;background:#000;color:#fff
}
.location-info{display:flex;align-items:center;gap:.5rem;margin-bottom:1rem;color:#ffd700;font-weight:500}
.location-icon{width:16px;height:16px;fill:currentColor}
.project-title{font-size:4rem;font-weight:800;margin-bottom:2rem;color:#fff;line-height:1.1}
.project-subtitle{opacity:.85;font-size:1.2rem;margin-bottom:1rem}
.project-description{font-size:1.1rem;line-height:1.6;margin-bottom:3rem;color:rgba(255,255,255,.8);max-width:400px}
.project-buttons{display:flex;gap:1rem;align-items:center;margin-top:20px;flex-wrap:wrap}
.download-icon{width:20px;height:20px;margin-right:.5rem}
.btn{
    padding:.8rem 1.5rem;border:2px solid #ffd700;background:transparent;color:#ffd700;border-radius:8px;font-weight:600;
    text-decoration:none;transition:all .3s ease;cursor:pointer;font-size:.9rem;display:inline-flex;align-items:center;gap:.5rem;position:relative;overflow:hidden;
    white-space:nowrap;min-height:44px;min-width:44px;justify-content:center
}
.btn::before{content:'';position:absolute;top:0;left:-100%;width:100%;height:100%;background:#ffd700;transition:left .3s ease;z-index:-1}
.btn:hover::before,.btn:active::before{left:0}
.btn:hover,.btn:active{background-color: #e4ed64;text-decoration: none;color:#000}
.project-image{height:100%;position:relative;overflow:hidden}
.project-image img{width:100%;height:100% !important;object-fit:cover;object-position:center}

/* Enhanced Mobile Styles */
@media (max-width:1024px){
    .project-content{padding:3rem 2rem}
    .project-title{font-size:3.5rem}
}

@media (max-width:768px){
    .project-row{
        grid-template-columns:1fr;grid-template-rows:1fr 1fr;
    }
    .project-content{
        padding:2rem 1.5rem;min-height:300px;justify-content:flex-start;padding-top:3rem
    }
    /*.project-image{height:300px}*/
    .project-title{font-size:2.8rem;margin-bottom:1.5rem;line-height:1.2}
    .project-subtitle{font-size:1.1rem}
    .project-buttons{
        flex-direction:row;gap:.8rem;margin-top:1.5rem
    }
    .btn{
        font-size:.85rem;padding:.7rem 1.2rem;flex:1;max-width:150px
    }
    .location-info{font-size:.9rem}
}

@media (max-width:480px){
    .project-content{padding:1.5rem 1rem;padding-top:2rem}
    .project-title{font-size:2.2rem;margin-bottom:1rem}
    .project-subtitle{font-size:1rem}
    .project-buttons{
        flex-direction:column;gap:.6rem;width:100%
    }
    .btn{
        width:100%;max-width:none;padding:.8rem 1rem;font-size:.8rem
    }
    .download-icon{width:16px;height:16px}
    .location-info{font-size:.8rem}
    .location-icon{width:14px;height:14px}
}

/* ============== ENHANCED FLIPBOOK MODAL ============== */
.modal{
    position:fixed;inset:0;display:none;place-items:center;background:rgba(0,0,0,.9);
    z-index:999999;padding:2vmin;backdrop-filter:blur(4px);
    pointer-events:none;
    overflow-y:auto;
}
.modal.open{display:grid;pointer-events:auto;}
.modal-inner{
    width:min(95vw,1200px);height:min(90vh,800px);position:relative;display:flex;flex-direction:column;gap:16px;
    background:rgba(15,15,15,.95);border-radius:20px;padding:20px;backdrop-filter:blur(15px);
    border:1px solid rgba(255,255,255,.1);box-shadow:0 30px 80px rgba(0,0,0,.6)
}
.modal-topbar{
    display:flex;justify-content:space-between;align-items:center;color:#fff;font-weight:600;
    flex-wrap:wrap;gap:12px
}
.modal-title{font-size:1.1rem;opacity:.9}

/* Book Container - Open Book Layout */
.book-wrap{
    position:relative;flex:1;background:linear-gradient(135deg,#2a2a2a,#1a1a1a);border-radius:20px;padding:20px;
    box-shadow:0 25px 70px rgba(0,0,0,.6), inset 0 0 0 1px rgba(255,255,255,.08);min-height:400px
}

.book{
    position:relative;width:100%;height:100%;perspective:2500px;border-radius:16px;overflow:visible;
    touch-action:manipulation;display:flex;align-items:center;justify-content:center
}

/* Book Spine */
.book-spine{
    position:absolute;left:50%;top:10%;width:8px;height:80%;background:linear-gradient(to bottom,#8b4513,#654321);
    transform:translateX(-50%);border-radius:4px;z-index:1000;
    box-shadow:0 0 20px rgba(0,0,0,.5), inset 0 0 4px rgba(255,255,255,.1)
}

/* Left Page (Fixed) */
.left-page{
    position:absolute;left:10%;top:10%;width:40%;height:80%;
    background:#f9f9f7;border-radius:8px 0 0 8px;
    box-shadow:-5px 0 15px rgba(0,0,0,.3);z-index:100;
    overflow:hidden
}

/* Right Pages (Flippable) */
.right-pages{
    position:absolute;right:10%;top:10%;width:40%;height:80%;
    transform-style:preserve-3d;perspective:2000px
}

.book_right_page{
    position:absolute;top:0;left:0;width:100%;height:100%;
    transform-origin:left center;transition:transform .8s cubic-bezier(.25,.46,.45,.94);
    border-radius:0 8px 8px 0;cursor:pointer;user-select:none;
    background:#f9f9f7;overflow:hidden
}

.book_right_page:not(.flipped){z-index:calc(100 - var(--page-index))}
.book_right_page.flipped{z-index:calc(50 - var(--page-index));transform:rotateY(-180deg)}

.page-content{
    position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
    overflow:hidden;border-radius:inherit;backface-visibility:hidden
}

.page-front{transform:rotateY(0deg)}
.page-back{transform:rotateY(180deg)}

.book_right_page img{
    width:100%;height:100% !important;object-fit:cover;pointer-events:none;
    border-radius:inherit
}

.page-placeholder{
    width:100%;height:100%;display:flex;align-items:center;justify-content:center;
    background:linear-gradient(135deg,#f8f9fa,#e9ecef);color:#6c757d;
    font-size:1.2rem;font-weight:300;border-radius:inherit
}

/* Page Shadow Effects */
.book_right_page::before{
    content:'';position:absolute;left:-5px;top:0;width:5px;height:100%;
    background:linear-gradient(to right,rgba(0,0,0,.4),transparent);
    filter:blur(1px);z-index:1001
}

.book_right_page.flipped::before{display:none}

/* Left Page Image */
.left-page img{
    width:100%;height:100% !important;object-fit:cover;border-radius:inherit
}

.left-page-placeholder{
    width:100%;height:100%;display:flex;align-items:center;justify-content:center;
    background:linear-gradient(135deg,#f8f9fa,#e9ecef);color:#6c757d;
    font-size:1.2rem;font-weight:300;border-radius:inherit
}

/* Enhanced Controls */
.controls{
    width: 100%;position:absolute;bottom:-10px;left:50%;transform:translateX(-50%);
    display:flex;gap:12px;pointer-events:none;justify-content: space-between;

}
.ctrl-btn{
    pointer-events:auto;border:none;border-radius:50px;padding:12px 20px;
    background:rgba(255,255,255,.95);cursor:pointer;font-weight:700;color:#333;
    box-shadow:0 10px 30px rgba(0,0,0,.3);display:inline-flex;align-items:center;gap:8px;
    min-height:48px;justify-content:center;touch-action:manipulation;
    backdrop-filter:blur(10px);transition:all .3s ease
}
.ctrl-btn:hover{background:#fff;transform:translateY(-2px);color:#000 !important;}
.ctrl-btn:active{transform:translateY(0) scale(.95);color:#000 !important;}
.ctrl-btn[disabled]{opacity:.4;cursor:not-allowed;transform:none}
.ctrl-btn[disabled]:hover{background:rgba(255,255,255,.95);transform:none}

.ctrl-group{display:flex;gap:8px;flex-wrap:wrap}
.ghost{
    display:inline-flex;align-items:center;gap:6px;padding:10px 16px;
    border:1px solid rgba(255,255,255,.4);color:#fff;background:rgba(255,255,255,.1);
    border-radius:10px;cursor:pointer;font-size:.9rem;backdrop-filter:blur(10px);
    min-height:40px;touch-action:manipulation;white-space:nowrap;
    transition:all .3s ease
}
.ghost:hover{background:rgba(255,255,255,.2)}
.ghost:active{background:rgba(255,255,255,.15);transform:scale(.95)}

.close-btn{
    background:rgba(255,59,48,.9);color:#fff;border:none;border-radius:10px;
    padding:10px 16px;cursor:pointer;backdrop-filter:blur(10px);
    min-height:40px;touch-action:manipulation;transition:all .3s ease
}
.close-btn:hover{background:rgba(255,59,48,1);transform:translateY(-1px)}
.close-btn:active{background:rgba(255,59,48,.8);transform:scale(.95)}

.hint{
    color:#aaa;font-size:.85rem;text-align:center;margin-top:12px;opacity:.8
}

/* Mobile Modal Adjustments */
@media (max-width:768px){
    .modal{padding:1vmin}
    .modal-inner{
        width:98vw;height:95vh;gap:12px;padding:16px;border-radius:16px
    }
    .book-wrap{padding:16px;border-radius:16px}
    .book{border-radius:12px}
    .left-page, .right-pages{top:8%;height:84%}
    .left-page{left:8%;width:42%}
    .right-pages{right:8%;width:42%}
    .controls{gap:8px}
    .ctrl-btn{padding:5px 16px;font-size:.9rem;min-height: 35px;}
    .ghost{font-size:.8rem;padding:8px 12px}
    .hint{font-size:.8rem}
}

@media (max-width:480px){
    .modal-inner{padding:12px;border-radius:12px}
    .book-wrap{padding:12px;border-radius:12px}
    .left-page, .right-pages{top:6%;height:88%}
    .left-page{left:6%;width:44%}
    .right-pages{right:6%;width:44%}
    .ctrl-group{flex-direction:column;gap:8px;width:100%}
    .ghost{width:100%;justify-content:center}
    .ctrl-btn{padding:5px 14px;font-size:.85rem;min-height: 30px;}
    .book_right_page{transition:transform .6s cubic-bezier(.25,.46,.45,.94)}
}

/* Loading and transition states */
.book_right_page img, .left-page img{
    transition:opacity .3s ease;
}
.book_right_page img:not([src]), .left-page img:not([src]){
    opacity:0;
}

/* Improved touch feedback */
@media (hover:none){
    .btn:hover::before{left:-100%}
    .btn:hover{color:#ffd700}
    .ctrl-btn:hover{transform:none}
    .ghost:hover{background:rgba(255,255,255,.1)}
}

/* No projects found styling */
.cps-no-projects {
    padding: 3rem;
    text-align: center;
    background: #f8f9fa;
    border-radius: 12px;
    margin: 2rem 0;
}