/* --- Portfolio Module: "Immersive Media Browser" Styles --- */

#portfolio-module {
    padding-bottom: 40px; /* Extra space for carousel elements */
}

/* --- Carousel Container --- */
.portfolio-carousel-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-top: 2rem;
    perspective: 1200px;
    overflow: hidden;
}

.portfolio-carousel-container .swipe-hint {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9rem;
    color: var(--muted-text);
    pointer-events: none;
    animation: swipe-hint-pulse 2s infinite;
    display: flex;
    align-items: center;
    gap: 6px;
}

@keyframes swipe-hint-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.portfolio-carousel {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.portfolio-carousel-item {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 60%;
    aspect-ratio: 16 / 9;
    background-color: #000;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    cursor: pointer;
}

.portfolio-carousel-item img,
.portfolio-carousel-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portfolio-carousel-item.active {
    cursor: pointer;
}

.portfolio-carousel-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    transition: background 0.6s ease;
}

.portfolio-carousel-item.active::after {
    background: rgba(0,0,0,0);
}

.portfolio-carousel-item .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0,0,0,0.6);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    pointer-events: none;
}

.portfolio-carousel-item .play-icon svg {
    width: 30px;
    height: 30px;
}

/* --- Carousel Navigation --- */
.carousel-nav {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none; /* Let clicks pass through */
}

.carousel-nav-btn {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    pointer-events: all; /* Make buttons clickable */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.carousel-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.carousel-nav-btn svg {
    width: 24px;
    height: 24px;
}

@media (max-width: 768px) {
    #portfolio-module .carousel-nav {
        display: none;
    }
}

/* --- Carousel Info Panel --- */
.portfolio-info-panel {
    position: static;
    margin-top: 20px;
    text-align: center;
    transition: opacity 0.6s ease;
    width: 100%;
}

.portfolio-info-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 5px;
}

.portfolio-info-skills {
    color: var(--muted-text);
}


/* --- Lightbox for Fullscreen View --- */
#lightbox-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s;
    backdrop-filter: blur(10px);
}

#lightbox-container.visible {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 80%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-media {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.lightbox-media img,
.lightbox-media video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.lightbox-info-panel {
    color: white;
    text-align: center;
}

.lightbox-btn-close {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 40px;
    height: 40px;
    color: white;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease;
}
.lightbox-btn-close:hover {
    transform: rotate(90deg);
}

.lightbox-btn-close svg {
    width: 24px;
    height: 24px;
}
