/* Style global de la page Matrix / Galerie */
.matrix-body {
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    background: #08080a;
    font-family: 'Inter', sans-serif;
    color: #fff;
    min-height: 100vh;
}

.crt-screen {
    position: relative;
    width: 100vw;
    min-height: 100vh;
}

.crt-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.15) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.015), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.015));
    background-size: 100% 4px, 4px 100%;
    pointer-events: none;
    z-index: 200;
}

/* Mur d'images fluide */
.infinity-wall {
    width: 100%;
    padding: 80px 40px 100px 40px;
    box-sizing: border-box;
    z-index: 1;
}

.wall-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
    max-width: 1600px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* Élément d'affiche individuelle */
.wall-item {
    position: relative;
    aspect-ratio: 3/4;
    background: #111115;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    filter: brightness(0.85) contrast(0.95);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.wall-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    transition: transform 0.5s ease;
}

.wall-item:hover {
    filter: brightness(1.05) contrast(1);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-8px) scale(1.02);
    z-index: 10;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 15px rgba(255, 255, 255, 0.1);
}

.wall-item:hover img {
    transform: scale(1.05);
}

.wall-item.selected {
    border-color: #fff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
}

/* PANNEAU D'INFORMATION HUD LATÉRAL (Sur la grille) */
.hud-info-panel {
    position: fixed;
    top: 40px;
    left: 40px;
    width: 380px;
    background: rgba(12, 12, 15, 0.9);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 30px;
    box-sizing: border-box;
    z-index: 300;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    transform: translateX(-130%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.hud-info-panel.active {
    transform: translateX(0);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.tech-tag {
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
}

.score-badge {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 400;
}

.panel-content h1 {
    font-size: 1.5rem;
    letter-spacing: 1px;
    margin-bottom: 12px;
    color: #fff;
    font-weight: 300;
}

.pill-container {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.mini-pill {
    font-size: 0.65rem;
    padding: 4px 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    letter-spacing: 1px;
}

.panel-content p {
    font-size: 0.85rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 30px;
    font-weight: 300;
}

.panel-actions {
    display: flex;
    gap: 12px;
}

.hud-btn {
    flex: 1;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    color: #fff;
    padding: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hud-btn:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
}

.close-panel-btn {
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.6);
}

.close-panel-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* BARRE HUD INFÉRIEURE */
.hud-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 50px;
    background: rgba(8, 8, 10, 0.92);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    box-sizing: border-box;
    z-index: 250;
}

.bar-left, .bar-right, .bar-center {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #00ff88;
    border-radius: 50%;
    box-shadow: 0 0 10px #00ff88;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

.tech-text {
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.6);
}

.exit-matrix-link {
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.3);
    padding-bottom: 2px;
    transition: border-color 0.2s;
}

.exit-matrix-link:hover {
    border-color: #fff;
}

/* MODALE DE ZOOM AVEC HUD D'INSPECTION AVANCÉ */
.poster-modal {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 1000;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    padding: 0 40px;
    box-sizing: border-box;
    opacity: 0; 
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.poster-modal.active { 
    opacity: 1; 
    pointer-events: auto; 
}

.modal-backdrop {
    position: absolute; 
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(3, 3, 6, 0.94);
    backdrop-filter: blur(20px);
}

.modal-content-box {
    position: relative; 
    z-index: 1001;
    max-width: 60vw; 
    max-height: 85vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* CONTENEUR DE L'IMAGE ET PERSPECTIVE 3D */
.modal-image-wrapper {
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9), 0 0 15px rgba(255, 255, 255, 0.05);
    overflow: hidden;
    perspective: 1000px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-image-wrapper img {
    max-width: 60vw;
    max-height: 80vh;
    object-fit: contain;
    display: block;
}

/* ROTATION 3D SUR L'IMAGE */
#modalImg {
    transition: transform 0.1s ease-out;
    transform-style: preserve-3d;
    will-change: transform;
    cursor: grab;
}

#modalImg:active {
    cursor: grabbing;
}

/* HUD LATÉRAUX EN MODALE */
.modal-hud-left, .modal-hud-right {
    position: relative;
    z-index: 1001;
    width: 220px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.72rem;
    pointer-events: none;
}

.modal-hud-left {
    align-items: flex-start;
}

.modal-hud-right {
    align-items: flex-end;
    text-align: right;
}

.hud-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 14px;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
}

.hud-label {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.65rem;
    letter-spacing: 1px;
}

.hud-value {
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 1px;
    font-weight: bold;
}

.hud-value.highlight {
    color: #00ff88;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
}

.hud-code-block {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.6rem;
    line-height: 1.5;
    margin-top: 5px;
    word-break: break-all;
}

.hud-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 3px;
    overflow: hidden;
}

.hud-bar-fill {
    height: 100%;
    background: #fff;
    box-shadow: 0 0 6px #fff;
}

.modal-close {
    position: absolute; 
    top: -40px; 
    right: 0;
    background: none; 
    border: none; 
    color: #fff;
    font-family: 'Inter', sans-serif; 
    font-size: 0.8rem;
    letter-spacing: 2px; 
    cursor: pointer;
}

/* ARRIÈRE-PLAN HOLOGRAPHIQUE SUBTIL */
.hologram-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    filter: grayscale(30%) contrast(120%) brightness(0.7) drop-shadow(0 0 20px rgba(0, 255, 136, 0.2));
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s ease-out;
    transform: scale(1.08);
}

.hologram-bg.active {
    opacity: 0.18;
    transform: scale(1);
}

.hologram-bg::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(
        rgba(0, 255, 136, 0.05) 50%, 
        rgba(0, 0, 0, 0.4) 50%
    );
    background-size: 100% 4px;
    pointer-events: none;
}

/* ARRIÈRE-PLAN GLOBAL AVEC GRILLE ET MICRO-HUD */
.gallery-hud-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.bg-grid-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 20vw 25vh;
}

.crosshair {
    position: absolute;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.25);
    transform: translate(-50%, -50%);
}

.crosshair.ch-1 { top: 25vh; left: 20vw; }
.crosshair.ch-2 { top: 25vh; left: 80vw; }
.crosshair.ch-3 { top: 75vh; left: 20vw; }
.crosshair.ch-4 { top: 75vh; left: 80vw; }

.hud-tag {
    position: absolute;
    font-family: 'Courier New', monospace;
    font-size: 0.6rem;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
}

.tag-top-left { top: 16px; left: 24px; }
.tag-top-center { top: 16px; left: 50%; transform: translateX(-50%); }
.tag-top-right { top: 16px; right: 24px; }

/* ==========================================
   ANIMATION HOLOGRAM GLITCH (CHARGEMENT GALERIE)
========================================== */
.wall-item.holo-glitch-init {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    animation: holoAppear 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.holo-glitch-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.holo-scanline {
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 30%;
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(255, 255, 255, 0.212),
        transparent
    );
    pointer-events: none;
    animation: scanlinePass 10s ease-in-out infinite;
}

@keyframes holoAppear {
    0% {
        opacity: 0;
        transform: translateY(25px) scale(0.9);
        filter: brightness(3) opacity(0.3) contrast(200%) drop-shadow(0 0 15px #00ff88);
        clip-path: inset(40% 0 35% 0);
    }
    20% {
        opacity: 0.8;
        transform: translateY(-5px) scale(1.02) skewX(-10deg);
        filter: brightness(2) hue-rotate(90deg);
        clip-path: inset(10% 0 65% 0);
    }
    40% {
        opacity: 0.5;
        transform: translateY(3px) scale(0.98) skewX(8deg);
        filter: brightness(1.5) hue-rotate(-90deg);
        clip-path: inset(70% 0 5% 0);
    }
    60% {
        opacity: 0.9;
        transform: translateY(-2px) scale(1.01) skewX(-2deg);
        filter: brightness(1.2);
        clip-path: inset(0 0 0 0);
    }
    80% {
        opacity: 0.95;
        transform: translateY(0) scale(1);
        filter: brightness(1.1);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: brightness(0.85) contrast(0.95);
        clip-path: inset(0 0 0 0);
    }
}

@keyframes scanlinePass {
    0% {
        top: -30%;
    }
    50%, 100% {
        top: 130%;
    }
}

