/*
====================================
   Lightbox Styles - Enhanced Version
   
   Modification: Arrière-plan plus visible/transparent
====================================
*/

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    /* Arrière-plan plus blanc, moins transparent */
    background-color: rgba(255, 255, 255, 0.88);
    display: none;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    /* Pas de flou sur l'arrière-plan */
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image-container {
    position: relative;
    max-width: 85%;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    width: 85vw;
    max-width: 100%;
    height: 85vh;
    max-height: 85vh;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    -webkit-touch-callout: none;
    user-select: none;
}

.lightbox-image.loaded {
    opacity: 1;
    transform: scale(1);
}

/* ── Protection lightbox ── */
.lightbox-image-container {
    -webkit-user-select: none;
    user-select: none;
}
/* Bloquer pointer events sur l'<img> → impossible de clic-droit dessus */
.lightbox-image {
    pointer-events: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
}
/* Shield DOM réel — couvre toute la zone image, bloque clic droit et drag */
.lightbox-shield {
    position: absolute;
    inset: 0;
    z-index: 20;
    cursor: default;
    -webkit-user-select: none;
    user-select: none;
    pointer-events: none;
}



/* Loading Spinner */
.lightbox-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Close Button - Symbole arrondi */
.lightbox-close {
    position: absolute;
    top: 2.5rem;
    right: 2.5rem;
    width: 40px;
    height: 40px;
    background-color: transparent;
    border: none;
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.lightbox-close:hover {
    transform: scale(1.2);
    opacity: 0.7;
}

.lightbox-close svg {
    width: 32px;
    height: 32px;
    stroke-width: 2.5;
}

/* Navigation Arrows - Flèches arrondies */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-color: transparent;
    border: none;
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.lightbox-nav:hover {
    transform: translateY(-50%) scale(1.2);
    opacity: 0.7;
}

.lightbox-prev {
    left: 2.5rem;
}

.lightbox-next {
    right: 2.5rem;
}

.lightbox-nav svg {
    width: 32px;
    height: 32px;
    stroke-width: 2.5;
}

/* Image Counter - Masqué */
.lightbox-counter {
    display: none;
}

/* Lightbox Actions (for private galleries) */
.lightbox-actions {
    position: absolute;
    bottom: 2.5rem;
    right: 2.5rem;
    display: flex;
    gap: 1rem;
    z-index: 10;
}

.lightbox-action-btn {
    width: 40px;
    height: 40px;
    background-color: transparent;
    border: none;
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.lightbox-action-btn:hover {
    transform: scale(1.2);
    opacity: 0.7;
}

.lightbox-action-btn svg {
    width: 28px;
    height: 28px;
}

/* Tooltip */
.lightbox-action-btn::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background-color: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    font-size: 0.85rem;
    white-space: nowrap;
    border-radius: 5px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox-action-btn:hover::before {
    opacity: 1;
}

/* Share Modal */
.share-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #ffffff;
    border-radius: 10px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: none;
    z-index: 20;
}

.share-modal.active {
    display: block;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.share-modal h3 {
    margin: 0 0 1.5rem;
    font-size: 1.5rem;
    font-weight: 500;
}

.share-options {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.share-option {
    flex: 1;
    padding: 1rem;
    border: 2px solid var(--color-border);
    border-radius: 5px;
    background-color: #f8f8f8;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.share-option:hover {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #ffffff;
}

.share-option svg {
    width: 32px;
    height: 32px;
    margin-bottom: 0.5rem;
}

.share-email-form {
    display: none;
}

.share-email-form.active {
    display: block;
}

.share-email-form input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--color-border);
    border-radius: 5px;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.share-email-form input:focus {
    outline: none;
    border-color: var(--color-accent);
}

.share-modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.share-modal-actions button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel {
    background-color: #f0f0f0;
    color: var(--color-text);
}

.btn-cancel:hover {
    background-color: #e0e0e0;
}

.btn-send {
    background-color: var(--color-primary);
    color: #ffffff;
}

.btn-send:hover {
    background-color: var(--color-accent);
}

/* Responsive Design */
@media (max-width: 768px) {
    .lightbox-close {
        top: 1rem;
        right: 1rem;
        width: 35px;
        height: 35px;
    }
    
    .lightbox-close svg {
        width: 28px;
        height: 28px;
    }
    
    .lightbox-nav {
        width: 35px;
        height: 35px;
    }
    
    .lightbox-nav svg {
        width: 28px;
        height: 28px;
    }
    
    .lightbox-prev {
        left: 1rem;
    }
    
    .lightbox-next {
        right: 1rem;
    }
    
    .lightbox-actions {
        bottom: 1rem;
        right: 1rem;
        flex-direction: column;
    }
    
    .share-modal {
        padding: 1.5rem;
    }
    
    .share-options {
        flex-direction: column;
    }
    
    .lightbox-image-container {
        max-width: 90%;
        max-height: 80vh;
    }
    
    .lightbox-image {
        height: 80vh;
        max-height: 80vh;
    }
}

@media (max-width: 480px) {
    .lightbox-image-container {
        max-width: 95%;
    }
    
    .lightbox-nav {
        width: 30px;
        height: 30px;
    }
    
    .lightbox-nav svg {
        width: 24px;
        height: 24px;
    }
    
    .lightbox-action-btn {
        width: 35px;
        height: 35px;
    }
    
    .lightbox-action-btn svg {
        width: 24px;
        height: 24px;
    }
}
