/* css/portfolio.css */
/* ---------- PORTFOLIO SECTION (FILMSTRIP) ---------- */
.filmstrip-section {
    position: relative;
    background: radial-gradient(circle at 10% 20%, #0B0B18, #03030C);
    overflow: hidden;
    padding: 5rem 0 6rem;
}

.section-caption {
    text-align: center;
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #FFFFFF 0%, #FFDD65 80%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
    width: 100%;
}
.section-caption::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 3px;
    background: linear-gradient(90deg, #FFDD65, #FF49C0);
    border-radius: 4px;
}

.marquee-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(90deg, transparent, black 6%, black 94%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, black 6%, black 94%, transparent);
}

.marquee-track {
    display: flex;
    gap: 2rem;
    width: max-content;
    animation: scrollMarquee 45s linear infinite;
    will-change: transform;
}

@keyframes scrollMarquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ==========================================
   FIX: ONLY HOVER ON DESKTOP (NO TOUCH)
   ========================================== */
@media (hover: hover) and (pointer: fine) {
    .marquee-container:hover .marquee-track {
        animation-play-state: paused;
    }

    .film-card:hover {
        transform: translateY(-12px) scale(1.02);
        border-color: rgba(255, 221, 101, 0.6);
        box-shadow: 0 35px 50px -20px rgba(0,0,0,0.8);
        background: rgba(30, 30, 44, 0.95);
    }

    .film-card:hover .img-bg-blur {
        opacity: 0.8;
    }

    .film-card:hover .card-img-box img {
        transform: scale(1.06);
    }

    .card-btn-mini:hover {
        background: #FFDD65;
        color: #0A0A14;
        border-color: #FFDD65;
    }
}

.film-card {
    width: 330px;
    background: rgba(26, 26, 36, 0.85);
    backdrop-filter: blur(2px);
    border-radius: 2.5rem;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    flex-shrink: 0;
    border: 1px solid rgba(255, 221, 101, 0.2);
    box-shadow: 0 25px 40px -18px rgba(0,0,0,0.6);
}

.card-img-wrapper {
    position: relative;
    margin: 1.4rem 1.4rem 0.8rem 1.4rem;
    border-radius: 1.8rem;
    padding: 3px;
    background: linear-gradient(135deg, #FFDD65, #FF49C0, #8E59FF);
}

.img-bg-blur {
    position: absolute;
    inset: 0;
    border-radius: 1.8rem;
    background: linear-gradient(135deg, #FFDD65, #FF49C0, #8E59FF);
    filter: blur(14px);
    opacity: 0.5;
    z-index: 0;
    transition: opacity 0.3s;
}

.card-img-box {
    position: relative;
    z-index: 2;
    border-radius: 1.6rem;
    overflow: hidden;
    aspect-ratio: 1 / 1;
}

.card-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.card-content-compact {
    padding: 0 1.4rem 1.6rem 1.4rem;
}

.film-card-title {
    color: #FFDD65;
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0.5rem 0 0.5rem 0;
    letter-spacing: -0.3px;
    white-space: nowrap;
    overflow-x: hidden;
    text-overflow: ellipsis;
}

.film-card-desc {
    color: #E2E4F0;
    font-size: 0.85rem;
    line-height: 1.45;
    opacity: 0.9;
    margin-bottom: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mini-list {
    margin: 0.75rem 0;
}

.mini-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #cfd9f0;
    font-size: 0.73rem;
    margin-bottom: 8px;
}

.mini-list-item i {
    color: #FFDD65;
    font-size: 10px;
    background: rgba(255,255,240,0.1);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.card-btn-mini {
    margin-top: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255, 221, 101, 0.4);
    padding: 8px 20px;
    border-radius: 40px;
    color: #FFDD65;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.25s;
    text-decoration: none;
    backdrop-filter: blur(2px);
}

/* ---------- EXPANDED OVERLAY & MODAL ---------- */
.expanded-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 3, 12, 0.92);
    backdrop-filter: blur(20px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

.expanded-overlay.active {
    opacity: 1;
    visibility: visible;
}

.expanded-card {
    max-width: 1100px;
    width: 90%;
    background: #12121C;
    border-radius: 2.5rem;
    overflow-y: auto;
    max-height: 88vh;
    position: relative;
    transform: scale(0.96);
    transition: transform 0.4s ease-out;
    border: 1px solid rgba(255, 221, 101, 0.3);
    box-shadow: 0 40px 70px rgba(0,0,0,0.5);
}

.expanded-overlay.active .expanded-card {
    transform: scale(1);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 26px;
    background: rgba(20, 20, 32, 0.8);
    width: 44px;
    height: 44px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    color: #FFDD65;
    z-index: 20;
    transition: 0.2s;
    border: 1px solid rgba(255,221,101,0.4);
    backdrop-filter: blur(4px);
}

.close-modal:hover {
    background: #FFDD65;
    color: #12121C;
    transform: rotate(90deg);
}

.expanded-content-wrapper {
    display: flex;
    gap: 2.2rem;
    padding: 2rem;
    flex-wrap: wrap;
}

.expanded-img-area {
    flex: 1.1;
    min-width: 260px;
}

.expanded-img-wrap {
    border-radius: 1.8rem;
    padding: 5px;
    background: linear-gradient(135deg, #FFDD65, #FF49C0, #8E59FF);
}

.expanded-img-inner {
    border-radius: 1.6rem;
    overflow: hidden;
    aspect-ratio: 1/1;
}

.expanded-img-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.expanded-text-area {
    flex: 1.4;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.expanded-title {
    color: #FFDD65;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.expanded-desc {
    color: #E0E4F0;
    font-size: 1rem;
    line-height: 1.5;
    text-align: left;
}

.expanded-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0.5rem 0;
}

.expanded-list-item {
    display: flex;
    align-items: center;
    background: rgba(255,255,245,0.05);
    padding: 6px 20px 6px 12px;
    border-radius: 60px;
    gap: 10px;
    backdrop-filter: blur(2px);
    border: 0.5px solid rgba(255,221,101,0.2);
}

.expanded-list-item .icon-badge {
    background: #FFDD65;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0A0A14;
}

.btn-expand {
    background: transparent;
    border: 1.5px solid #FFDD65;
    color: #FFDD65;
    padding: 12px 34px;
    border-radius: 50px;
    font-weight: 700;
    transition: 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.btn-expand:hover {
    background: #FFDD65;
    color: #12121C;
    box-shadow: 0 4px 14px rgba(255,221,101,0.3);
}

.mobile-fade .expanded-img-area,
.mobile-fade .expanded-text-area > * {
    opacity: 0;
    transform: translateY(18px);
    animation: modalFadeUp 0.5s forwards;
}
.mobile-fade .expanded-img-area { animation-delay: 0.05s; }
.mobile-fade .expanded-text-area h2 { animation-delay: 0.1s; }
.mobile-fade .expanded-text-area p { animation-delay: 0.2s; }
.mobile-fade .expanded-text-area .expanded-list { animation-delay: 0.3s; }
.mobile-fade .expanded-text-area .expanded-btn { animation-delay: 0.4s; }

@keyframes modalFadeUp {
    to { opacity: 1; transform: translateY(0); }
}

.desktop-slide .expanded-img-area {
    opacity: 0;
    animation: slideFromLeft 0.5s ease forwards;
}
.desktop-slide .expanded-text-area > * {
    opacity: 0;
    animation: slideFromRight 0.5s ease forwards;
}
.desktop-slide .expanded-text-area h2 { animation-delay: 0.05s; }
.desktop-slide .expanded-text-area p { animation-delay: 0.15s; }
.desktop-slide .expanded-text-area .expanded-list { animation-delay: 0.25s; }
.desktop-slide .expanded-text-area .expanded-btn { animation-delay: 0.35s; }

@keyframes slideFromLeft {
    0% { opacity: 0; transform: translateX(-60px); }
    100% { opacity: 1; transform: translateX(0); }
}
@keyframes slideFromRight {
    0% { opacity: 0; transform: translateX(60px); }
    100% { opacity: 1; transform: translateX(0); }
}

/* ---------- FILMSTRIP MOBILE OPTIMIZATION ---------- */
@media (max-width: 768px) {
    /* CRITICAL FIX: Disable will-change on mobile to stop the scroll "reset" */
    .marquee-track {
        will-change: auto !important; 
    }

    .filmstrip-section {
        padding: 3rem 0 4rem !important;
    }
    
    .section-caption {
        font-size: 1.5rem !important;
        margin-bottom: 2rem !important;
    }
    
    .section-caption::after {
        width: 50px !important;
        bottom: -8px !important;
    }
    
    .marquee-track {
        gap: 1rem !important;
    }
    
    .film-card {
        width: 220px !important;
        border-radius: 1.5rem !important;
    }
    
    .card-img-wrapper {
        margin: 0.8rem 0.8rem 0.5rem 0.8rem !important;
        border-radius: 1.2rem !important;
        padding: 2px !important;
    }
    
    .img-bg-blur {
        border-radius: 1.2rem !important;
        filter: blur(10px) !important;
    }
    
    .card-img-box {
        border-radius: 1rem !important;
    }
    
    .card-content-compact {
        padding: 0 0.8rem 1rem 0.8rem !important;
    }
    
    .film-card-title {
        font-size: 1rem !important;
        margin: 0.3rem 0 0.3rem 0 !important;
    }
    
    .film-card-desc {
        font-size: 0.72rem !important;
        margin-bottom: 0.5rem !important;
        -webkit-line-clamp: 2 !important;
        line-clamp: 2 !important;
    }
    
    .mini-list {
        margin: 0.4rem 0 !important;
    }
    
    .mini-list-item {
        font-size: 0.65rem !important;
        margin-bottom: 5px !important;
        gap: 6px !important;
    }
    
    .mini-list-item i {
        font-size: 8px !important;
        width: 14px !important;
        height: 14px !important;
    }
    
    .card-btn-mini {
        padding: 6px 14px !important;
        font-size: 0.7rem !important;
        margin-top: 0.5rem !important;
    }
}

/* ---------- VERY SMALL MOBILE (iPhone SE) ---------- */
@media (max-width: 380px) {
    .film-card {
        width: 180px !important;
    }
    
    .card-img-wrapper {
        margin: 0.6rem 0.6rem 0.4rem 0.6rem !important;
    }
    
    .film-card-title {
        font-size: 0.9rem !important;
    }
    
    .film-card-desc {
        font-size: 0.65rem !important;
    }
}

/* ---------- EXPANDED MODAL MOBILE ---------- */
@media (max-width: 768px) {
    .expanded-card {
        width: 95% !important;
        max-height: 90vh !important;
        border-radius: 1.5rem !important;
    }
    
    .expanded-content-wrapper {
        padding: 1.2rem !important;
        gap: 1.2rem !important;
    }
    
    .expanded-title {
        font-size: 1.6rem !important;
    }
    
    .expanded-desc {
        font-size: 0.9rem !important;
    }
    
    .close-modal {
        top: 12px !important;
        right: 12px !important;
        width: 38px !important;
        height: 38px !important;
    }
}