/* ==========================================================================
   FEUILLE DE STYLE POUR LA GALERIE D'IMAGES
   ========================================================================== */

/* --- STYLES DE LA GRILLE DE BASE --- */
.galerie-grille {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
}
.item-bloc {
    position: relative;
    aspect-ratio: 1 / 1.35;
    background-color: #1c1c1c;
    overflow: hidden;
    display: grid; /* Utilisation de grid pour superposer les éléments facilement */
	border: 1px solid rgb(84, 23, 23);
}
.item-preview-image,
.item-lien-achat, 
.custom-lightbox-trigger,
.item-non-disponible,
.paypal-item-purchase-container { /* Ajout pour la superposition */
    grid-area: 1 / 1 / 2 / 2;
    width: 100%; 
    height: 100%;
}
.item-preview-image {
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.item-bloc:hover > a > .item-preview-image {
    transform: scale(1.05);
}
.custom-lightbox-trigger {
    display: block;
}

/* --- FLOU ET INFOS SUPERPOSÉES --- */
.item-flou {
    filter: blur(24px);
    -webkit-filter: blur(24px);
    transform: scale(1.1);
}
.info-superposee {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    flex-direction: column; /* Pour aligner le prix et le bouton */
    align-items: center;
    justify-content: center;
    z-index: 5;
    background: rgba(0,0,0,0.2); /* Léger voile pour la lisibilité */
}
.item-prix {
    background-color: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    backdrop-filter: blur(5px);
}
.play-icon-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Centrage parfait */
    font-size: 60px; /* Grande taille, facile à voir */
    color: white;
    opacity: 0.7;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); /* Ombre pour la lisibilité */
    z-index: 6; /* Doit être au-dessus de l'image, mais sous les infos au survol */
    pointer-events: none; /* TRÈS IMPORTANT : Laisse passer le clic vers le lien en dessous */
    transition: opacity 0.3s ease;
}

/* --- STYLES DE L'OVERLAY D'ABONNEMENT --- */
.galerie-bloquee-wrapper {
    position: relative;
}
.galerie-grille-flou-fond {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    filter: brightness(0.6);
}
.item-bloc-fond {
    overflow: hidden;
    aspect-ratio: 1 / 1.35; 
}
.item-bloc-fond img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(24px);
    -webkit-filter: blur(24px);
    transform: scale(1.1);
}
.abonnement-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    z-index: 10;
    /* Initialement invisible */
    opacity: 0;
    visibility: hidden;
    /* Animation avec délai de 400ms */
    animation: delayedFadeIn 0.3s forwards ease-out;
    animation-delay: 0.3s;
}

@keyframes delayedFadeIn {
    to {
        opacity: 1;
        visibility: visible;
    }
}

.abonnement-overlay-content { background-color: rgba(0, 0, 0, 0.85); color: 
#ffffff; padding: 40px 50px; border-radius: 12px; text-align: center; max-width: 500px; width: 90%; border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); animation: fadeInScale 0.5s forwards ease-out; }
@keyframes fadeInScale { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.abonnement-overlay-content h2 { color: 
#ffffff; font-size: 2rem; margin-top: 0; margin-bottom: 15px; }
.abonnement-overlay-content p { font-size: 1.1rem; line-height: 1.6; margin-bottom: 25px; }
.abonnement-overlay-content .swpm-payment-button { background-color: 
#e50914 !important; color: white !important; padding: 12px 25px !important; font-size: 1rem !important; font-weight: bold !important; border-radius: 5px !important; transition: transform 0.2s ease, background-color 0.2s ease; }
.abonnement-overlay-content .swpm-payment-button:hover { transform: scale(1.05); }


/* --- STYLES POUR LE BOUTON DE LIKE --- */
.like-button { position: absolute; top: 8px; right: 8px; z-index: 5; background-color: rgba(0, 0, 0, 0.6); color: white; border: none; border-radius: 20px; padding: 5px 10px; font-size: 14px; cursor: pointer; display: flex; align-items: center; gap: 5px; transition: background-color 0.2s; backdrop-filter: blur(5px); }
.like-button:hover { background-color: rgba(0, 0, 0, 0.8); }
.like-button.liked { background-color: rgba(229, 9, 20, 0.8); }
.like-icon { font-size: 16px; }


/* ==========================================================================
   STYLES POUR LA LIGHTBOX (AJOUTÉS ET CORRIGÉS)
   ========================================================================== */

#spicy-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999; /* Z-index élevé pour être au-dessus de tout */
    padding: 20px;
    box-sizing: border-box;
}

#spicy-lightbox-overlay .spicy-lightbox-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#spicy-lightbox-overlay .spicy-lightbox-media-wrapper {
    max-width: 95vw;
    max-height: 95vh;
}

#spicy-lightbox-overlay .spicy-lightbox-media-wrapper img,
#spicy-lightbox-overlay .spicy-lightbox-media-wrapper video {
    max-width: 100%;
    max-height: 90vh; /* Laisse de la marge en haut et en bas */
    display: block;
    border-radius: 8px;
    object-fit: contain;
}

#spicy-lightbox-overlay .spicy-lightbox-close {
    position: absolute;
    top: -15px;
    right: -15px;
    background: white;
    color: black;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    line-height: 35px;
    text-align: center;
    cursor: pointer;
    z-index: 10;
}

#spicy-lightbox-overlay .spicy-lightbox-options {
    position: absolute;
    bottom: 15px;
    right: 15px;
    z-index: 10;
}

#spicy-lightbox-overlay .spicy-lightbox-options .dots {
    width: 35px;
    height: 35px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    cursor: pointer;
}

#spicy-lightbox-overlay .spicy-lightbox-options .dots svg {
    width: 20px;
    height: 20px;
}

#spicy-lightbox-overlay .spicy-lightbox-options .report-button {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
    background-color: rgba(20, 20, 20, 0.9);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    white-space: nowrap;
    backdrop-filter: blur(5px);
}




/* Container pour l'image avec watermark */
.watermarked-image-container {
	position: relative;
	display: inline-block;
	max-width: 100%;
	max-height: 100%;
	overflow: hidden;
}

.watermarked-image-container img {
	display: block;
	max-width: 100%;
	max-height: 90vh;
	width: auto;
	height: auto;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	pointer-events: none;
}

/* Overlay de watermark */
.watermark-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	z-index: 10;
}

/* Texte du watermark principal */
.watermark-text {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) rotate(-45deg);
	font-size: 4vw;
	font-weight: bold;
	color: rgba(255, 255, 255, 0.3);
	text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
	white-space: nowrap;
	letter-spacing: 0.5em;
	font-family: Arial, sans-serif;
	user-select: none;
}

/* Email de l'utilisateur */
.watermark-email {
	position: absolute;
	top: 60%;
	left: 50%;
	transform: translate(-50%, -50%) rotate(-45deg);
	font-size: 2vw;
	font-weight: normal;
	color: rgba(255, 255, 255, 0.25);
	text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
	white-space: nowrap;
	font-family: Arial, sans-serif;
	user-select: none;
}

/* Pattern de watermarks répétés avec email */
.watermark-pattern {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-image: repeating-linear-gradient(
		45deg,
		transparent,
		transparent 100px,
		rgba(255, 255, 255, 0.05) 100px,
		rgba(255, 255, 255, 0.05) 200px
	);
}

/* Emails répétés en pattern */
.watermark-pattern::before {
	content: attr(data-email);
	position: absolute;
	top: 20px;
	right: 20px;
	font-size: 12px;
	color: rgba(255, 255, 255, 0.3);
	font-family: Arial, sans-serif;
	user-select: none;
}

.watermark-pattern::after {
	content: attr(data-email);
	position: absolute;
	bottom: 20px;
	left: 20px;
	font-size: 12px;
	color: rgba(255, 255, 255, 0.3);
	font-family: Arial, sans-serif;
	user-select: none;
}

/* Pattern d'emails répétés sur toute l'image */
.watermark-overlay::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 200%;
	height: 200%;
	background-image: 
		repeating-linear-gradient(
			-45deg,
			transparent,
			transparent 150px,
			rgba(255, 255, 255, 0.02) 150px,
			rgba(255, 255, 255, 0.02) 151px
		);
	transform: translate(-25%, -25%);
}

/* Désactive le clic droit sur toute la lightbox */
.spicy-lightbox-media-wrapper {
	position: relative;
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	-khtml-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

/* Pour les écrans mobiles */
@media (max-width: 768px) {
	.watermark-text {
		font-size: 8vw;
		letter-spacing: 0.3em;
	}

	.watermark-email {
		font-size: 4vw;
	}

	.watermark-pattern::before,
	.watermark-pattern::after {
		font-size: 10px;
	}
}

/* Animation subtile du watermark */
@keyframes watermarkPulse {
	0%, 100% {
		opacity: 0.3;
	}
	50% {
		opacity: 0.4;
	}
}

.watermark-text, .watermark-email {
	animation: watermarkPulse 4s ease-in-out infinite;
}

