/**
 * Styles Photos Lavage - Gandalf
 * Isolé, n'affecte pas le reste de l'interface
 */

/* Galerie photos inline */
.lavage-photos-container {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 20px;
    margin: 15px 0;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.lavage-photos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.lavage-photos-header h4 {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
}

.protocole-badge {
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.protocole-conforme {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.protocole-non-conforme {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.photo-item {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    aspect-ratio: 4/3;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.photo-item:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    color: white;
    padding: 8px;
    font-size: 11px;
    text-align: center;
    line-height: 1.2;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s;
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 85%;
    margin-top: 3%;
    animation: zoomIn 0.3s;
    border-radius: 4px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 100000;
    transition: color 0.2s;
    user-select: none;
}

.lightbox-close:hover {
    color: #ccc;
}

.lightbox-caption {
    text-align: center;
    color: white;
    padding: 15px;
    font-size: 16px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.lightbox-nav button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    font-size: 30px;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
    user-select: none;
}

.lightbox-nav button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav button:active {
    transform: translateY(-50%) scale(0.95);
}

.lightbox-nav button:first-child {
    left: 20px;
}

.lightbox-nav button:last-child {
    right: 20px;
}

.photos-error,
.photos-info {
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    padding: 20px;
    font-style: italic;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive mobile */
@media (max-width: 768px) {
    .photos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .lightbox-nav button {
        padding: 8px 15px;
        font-size: 24px;
    }

    .lightbox-close {
        top: 10px;
        right: 15px;
        font-size: 30px;
    }

    .lightbox-content {
        max-width: 95%;
        max-height: 80%;
    }
}

@media (max-width: 480px) {
    .photos-grid {
        grid-template-columns: 1fr;
    }

    .lavage-photos-container {
        padding: 15px;
        margin: 10px 0;
    }

    .lavage-photos-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .photo-label {
        font-size: 10px;
        padding: 6px;
    }
}

/* Placeholder si image non chargée */
.photo-item img[src*="data:image/svg"] {
    background: #222;
}
