/* ==========================================================================
   🛸 PHOTO MODAL SYSTEM - SCI-FI CYBERPUNK DESIGN
========================================================================== */

.photo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--ultra-dark);
    display: none;
    z-index: 10000;
    backdrop-filter: blur(20px);

    /* Sci-fi particle background */
    background-image:
        radial-gradient(circle at 20% 30%, rgba(0, 212, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(168, 85, 247, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 60% 20%, rgba(6, 182, 212, 0.03) 0%, transparent 50%);
}

.photo-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    touch-action: pan-y pinch-zoom;
    overscroll-behavior: none;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        background: rgba(0, 5, 15, 0);
    }

    to {
        opacity: 1;
        background: var(--ultra-dark);
    }
}

/* Contenitore modal più slim */
.photo-modal-content {
    position: relative;
    width: 100vw;
    height: 100vh;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 🚀 PULSANTI CONTROL - DESIGN CYBERPUNK MINIMALE */
.photo-modal-close,
.photo-modal-info-toggle {
    position: absolute;
    background: var(--dark-glass);
    border: 1px solid var(--cyber-border);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    cursor: pointer;
    z-index: 10001;
    backdrop-filter: blur(15px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', 'SF Mono', monospace;

    /* Holographic effect */
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 4px 12px rgba(0, 0, 0, 0.3);
}

.photo-modal-close {
    top: 1.5rem;
    right: 1.5rem;
    font-size: 1.5rem;
    font-weight: 300;
}

.photo-modal-info-toggle {
    top: 1.5rem;
    left: 1.5rem;
    font-size: 1rem;
}

.photo-modal-close:hover,
.photo-modal-info-toggle:hover {
    border-color: var(--neon-cyan);
    background: rgba(5, 15, 25, 0.95);
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 8px 25px rgba(0, 212, 255, 0.2),
        0 0 20px rgba(0, 212, 255, 0.1);
}

.photo-modal-info-toggle.active {
    background: var(--hologram-bg);
    border-color: var(--neon-blue);
    color: var(--neon-blue);
    box-shadow:
        inset 0 1px 0 rgba(0, 212, 255, 0.3),
        0 0 25px rgba(0, 212, 255, 0.3);
}

/* Area principale photo */
.photo-modal-main {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    /* padding: 5rem 3rem; */
    padding: 0;
}

/* Immagine con bordo holographic sottile */
.modal-photo {
    /* max-width: calc(100vw - 6rem);
    max-height: calc(100vh - 10rem); */
    max-width: 100vw;
    max-height: 100vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    transition: all 0.3s ease;

    /* Sottile glow sci-fi */
    box-shadow:
        0 0 0 1px rgba(0, 212, 255, 0.2),
        0 20px 60px rgba(0, 0, 0, 0.4);

    filter: contrast(1.05) brightness(1.02);
}

.aethereal {
    opacity: 0.3;
}
.aethereal:hover {
    opacity: 1;
    transition: all .3s ease-in-out;
}

/* 🚀 NAVIGATION - DESIGN ULTRA SLIM */
.photo-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--dark-glass);
    border: 1px solid var(--cyber-border);
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.2rem;
    width: 44px;
    height: 44px;
    border-radius: 6px;
    cursor: pointer;
    backdrop-filter: blur(15px);
    transition: all 0.3s ease;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 300;

    /* Micro glow */
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 4px 12px rgba(0, 0, 0, 0.3);
}

.photo-nav:hover {
    background: rgba(5, 15, 25, 0.95);
    border-color: var(--neon-cyan);
    color: white;
    transform: translateY(-50%) translateX(0);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 8px 20px rgba(0, 212, 255, 0.15);
}

.photo-nav-prev {
    left: 1rem;
}

.photo-nav-next {
    right: 1rem;
}

.photo-nav:disabled {
    opacity: 0.2;
    cursor: not-allowed;
    background: rgba(0, 5, 15, 0.5);
    border-color: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.3);
}

.photo-nav:disabled:hover {
    transform: translateY(-50%);
    box-shadow: none;
}

/* 🛸 PANNELLO INFO - DESIGN CYBERPUNK GLASS */
.photo-modal-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top,
            rgba(5, 15, 25, 0.95) 0%,
            rgba(5, 15, 25, 0.9) 70%,
            transparent 100%);
    backdrop-filter: blur(25px);
    color: white;
    font-family: 'Inter', 'SF Pro Display', system-ui;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    max-height: 45vh;
    overflow-y: auto;
    border-top: 1px solid var(--cyber-border);

    /* Holographic top edge */
    border-image: linear-gradient(90deg,
            transparent,
            var(--neon-blue),
            var(--neon-purple),
            transparent) 1;
}

.photo-modal-info.visible {
    transform: translateY(0);
}

/* Header minimale */
.photo-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem 0.8rem;
    border-bottom: 1px solid rgba(0, 212, 255, 0.15);
}

.photo-info-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
    color: var(--neon-cyan);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-family: 'JetBrains Mono', monospace;
}

.photo-counter {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    opacity: 0.7;
    font-weight: 400;
    padding: 0.25rem 0.6rem;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(0, 212, 255, 0.2);
    font-family: 'JetBrains Mono', monospace;
}

/* Content area */
.photo-info-content {
    padding: 1rem 2rem 2rem;
}

.photo-description {
    margin: 0 0 1.2rem 0;
    opacity: 0.85;
    line-height: 1.5;
    font-size: 0.95rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.9);
}

/* 🔬 METADATA SECTIONS - ULTRA CLEAN */
.metadata-section {
    margin-bottom: 1.2rem;
    padding: 0.8rem;
    background: rgba(0, 212, 255, 0.04);
    border-radius: 6px;
    border: 1px solid rgba(0, 212, 255, 0.08);
    backdrop-filter: blur(10px);
}

.metadata-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.metadata-row:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.metadata-label {
    font-weight: 500;
    font-size: 0.8rem;
    color: rgba(6, 182, 212, 0.9);
    min-width: 90px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metadata-value {
    font-size: 0.8rem;
    text-align: right;
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
    background: rgba(255, 255, 255, 0.06);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

/* 📱 RESPONSIVE ULTRA CLEAN */
@media (max-width: 768px) {

    .photo-modal-close,
    .photo-modal-info-toggle {
        width: 42px;
        height: 42px;
        top: 1rem;
    }

    .photo-modal-close {
        right: 1rem;
        font-size: 1.3rem;
    }

    .photo-modal-info-toggle {
        left: 1rem;
        font-size: 0.9rem;
    }

    .photo-nav {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .photo-modal-main {
        /* padding: 4rem 2rem; */
        padding: 0;
    }

    .modal-photo {
        /* max-width: calc(100vw - 4rem);
        max-height: calc(100vh - 8rem); */
        max-width: 100vw;
        max-height: 100vh;
    }

    .photo-info-header {
        padding: 1rem 1.5rem 0.8rem;
    }

    .photo-info-content {
        padding: 1rem 1.5rem 1.5rem;
    }

    .metadata-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .metadata-label {
        min-width: auto;
        width: 100%;
    }

    .metadata-value {
        text-align: left;
        width: 100%;
    }
}

/* Grid Layout */
.grid-layout {
    padding: var(--section-padding) 0;
}

.grid-container {
    max-width: var(--wide-content-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: repeat(2, 1fr);
    gap: 1rem;
    height: 600px;
}

.grid-3 .grid-item:first-child {
    grid-row: span 2;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    height: 500px;
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* Gallery Layout */
.gallery-layout {
    padding: var(--section-padding) 0;
}

.gallery-container {
    max-width: var(--wide-content-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.gallery-main {
    margin-bottom: 2rem;
}

.gallery-hero {
    width: 100%;
    height: 60vh;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
}

.gallery-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.thumbnail-item {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.thumbnail-item.active,
.thumbnail-item:hover {
    opacity: 1;
}

.thumbnail-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
}

.gallery-img-container img {
    cursor: pointer;
}

/* 🔀 SCROLLBAR CYBERPUNK */
.photo-modal-info::-webkit-scrollbar {
    width: 4px;
}

.photo-modal-info::-webkit-scrollbar-track {
    background: rgba(0, 212, 255, 0.05);
    border-radius: 2px;
}

.photo-modal-info::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--neon-cyan), var(--neon-blue));
    border-radius: 2px;
}

.photo-modal-info::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--neon-blue), var(--neon-purple));
}

/* 🌟 SUBTLE ANIMATIONS */
@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(0, 212, 255, 0.2);
    }

    50% {
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
    }
}

.photo-modal-info-toggle.active {
    animation: pulseGlow 2s infinite;
}