/* ==========================================================================
   POPUP OVERLAY (Professional Glassmorphism Modal + Slideshow)
   ========================================================================== */

/* Overlay - Full screen backdrop */
.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;           /* High but safe */
    opacity: 0;
    transition: opacity 0.4s ease;
}

.popup-overlay.active {
    display: flex;
    opacity: 1;
}

/* Popup Content Container */
.popup-content {
    position: relative;
    width: 92%;
    max-width: 1100px;
    height: 85vh;
    max-height: 780px;
    background: rgba(15, 23, 42, 0.75);   /* Slightly tinted dark glass */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.92);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.popup-overlay.active .popup-content {
    transform: scale(1);
}

/* Close Button */
.close-btn-tailwind {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    font-size: 1.4rem;
    font-weight: 600;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: all 0.25s ease;
    z-index: 10;
}

.close-btn-tailwind:hover {
    background: rgba(239, 68, 68, 0.9);
    color: white;
    transform: rotate(90deg);
}

/* Slideshow Container */
.slideshow-container {
    flex: 1;
    position: relative;
    width: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1.5rem 0;
}

.slideshow-container img.slide {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.slideshow-container img.slide.active {
    opacity: 1;
    pointer-events: auto;
}

/* Slide Controls */
.slide-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    padding-top: 1rem;
}

.slide-controls button {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #e2e8f0;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    min-width: 3.5rem;
}

.slide-controls button:hover {
    background: rgba(59, 130, 246, 0.4);
    border-color: #60a5fa;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.25);
}

.slide-controls button:active {
    transform: translateY(0);
}

/* Slide Counter */
.slide-counter {
    color: #94a3b8;
    font-size: 0.95rem;
    min-width: 4rem;
    text-align: center;
}

/* Project Title */
.popup-content h3 {
    color: #f1f5f9;
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    flex-shrink: 0;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */
@media (max-width: 1024px) {
    .popup-content {
        width: 94%;
        height: 80vh;
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .popup-content {
        width: 96%;
        height: 75vh;
        padding: 1.5rem;
    }

    .popup-content h3 {
        font-size: 1.5rem;
    }

    .slide-controls button {
        padding: 0.65rem 1.2rem;
        font-size: 1rem;
    }

    .close-btn-tailwind {
        top: 1rem;
        right: 1rem;
        width: 2.25rem;
        height: 2.25rem;
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .slide-controls {
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    .slide-controls button {
        flex: 1 1 auto;
    }
}