/**
 * Sélecteur de photos 2 ÉTAPES pour livres/albums
 * VERSION BLEU (#0073aa)
 * 🔧 CORRIGÉ : Classes harmonisées avec le JavaScript
 */

/* Overlay et modal - IDs spécifiques 2steps */
#pcp-photo-selector-2steps-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999999;
    animation: fadeIn 0.3s;
}

#pcp-photo-selector-2steps-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    z-index: 9999999;
    animation: fadeIn 0.2s ease-out;
	/* FIX RESPONSIVE */
    display: flex !important;
    flex-direction: column !important;
}

/* 🔧 En-tête - CLASSES PARTAGÉES (sans 2steps) */
#pcp-photo-selector-2steps-modal .pcp-selector-header {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    align-items: center;
    gap: 20px;
	flex-shrink: 0;
}

#pcp-photo-selector-2steps-modal .pcp-selector-title {
    flex: 1;
    min-width: 0;
}

#pcp-photo-selector-2steps-modal .pcp-selector-title h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#pcp-photo-selector-2steps-modal .pcp-selector-title p {
    margin: 5px 0 0 0;
    font-size: 14px;
    opacity: 0.9;
    color: white;
}

/* Indicateur d'étape */
#pcp-selector-2steps-step-indicator {
    display: inline-block;
    background: rgba(255, 215, 0, 0.25);
    color: #ffd700;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

/* Compteur - CORRIGÉ */
#pcp-photo-selector-2steps-modal .pcp-selector-counter {
    background: rgba(255, 255, 255, 0.2);
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    color: white;
    text-align: center;
    min-width: 90px;
    flex-shrink: 0;
    line-height: 1.3;
}

#pcp-photo-selector-2steps-modal .pcp-selector-counter span {
    display: block;
    font-size: 12px;
    font-weight: 500;
    opacity: 0.9;
}

#pcp-photo-selector-2steps-modal .pcp-selector-counter.complete {
    background: #4CAF50;
}

#pcp-photo-selector-2steps-modal .pcp-selector-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 28px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

#pcp-photo-selector-2steps-modal .pcp-selector-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* 🔧 Grille de photos - CLASSES PARTAGÉES */
#pcp-photo-selector-2steps-modal .pcp-selector-body {
    padding: 20px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

#pcp-photo-selector-2steps-modal .pcp-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

/* Photos - CLASSES SPÉCIFIQUES 2steps */
.pcp-selector-2steps-photo {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s;
}

.pcp-selector-2steps-photo:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.pcp-selector-2steps-photo.selected {
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.3);
}

.pcp-selector-2steps-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pcp-selector-2steps-photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 115, 170, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
    font-weight: 700;
}

.pcp-selector-2steps-photo.selected .pcp-selector-2steps-photo-overlay {
    display: flex;
}

.pcp-selector-2steps-photo-number {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #0073aa;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.pcp-selector-2steps-photo.selected .pcp-selector-2steps-photo-number {
    display: flex;
}

/* 🔧 Footer avec boutons - CLASSES PARTAGÉES */
#pcp-photo-selector-2steps-modal .pcp-selector-footer {
    padding: 20px 30px;
    background: #f5f5f5;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
	flex-shrink: 0;
}

#pcp-photo-selector-2steps-modal .pcp-selector-info {
    font-size: 14px;
    color: #666;
}

#pcp-photo-selector-2steps-modal .pcp-selector-actions {
    display: flex;
    gap: 15px;
}

#pcp-photo-selector-2steps-modal .pcp-selector-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

#pcp-photo-selector-2steps-modal .pcp-selector-btn-cancel {
    background: white;
    color: #666;
    border: 2px solid #ddd;
}

#pcp-photo-selector-2steps-modal .pcp-selector-btn-cancel:hover {
    background: #f5f5f5;
}

#pcp-photo-selector-2steps-modal .pcp-selector-btn-prev,
#pcp-photo-selector-2steps-modal .pcp-selector-btn-next,
#pcp-photo-selector-2steps-modal .pcp-selector-btn-validate {
    background: #0073aa;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 115, 170, 0.4);
}

#pcp-photo-selector-2steps-modal .pcp-selector-btn-prev:hover,
#pcp-photo-selector-2steps-modal .pcp-selector-btn-next:hover,
#pcp-photo-selector-2steps-modal .pcp-selector-btn-validate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 115, 170, 0.6);
}

#pcp-photo-selector-2steps-modal .pcp-selector-btn-prev:disabled,
#pcp-photo-selector-2steps-modal .pcp-selector-btn-next:disabled,
#pcp-photo-selector-2steps-modal .pcp-selector-btn-validate:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

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

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

/* Responsive */
@media (max-width: 768px) {
    #pcp-photo-selector-2steps-modal {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
        border-radius: 0 !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    #pcp-photo-selector-2steps-modal .pcp-selector-header {
        padding: 10px 15px;
        flex-shrink: 0;
    }
    
    #pcp-photo-selector-2steps-modal .pcp-selector-title h3 {
        font-size: 14px;
    }
    
    #pcp-photo-selector-2steps-modal .pcp-selector-body {
        flex: 1;
        overflow-y: auto;
        padding: 10px;
    }
    
    #pcp-photo-selector-2steps-modal .pcp-selector-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    #pcp-photo-selector-2steps-modal .pcp-selector-footer {
        flex-shrink: 0;
        padding: 10px !important;
        overflow: hidden !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
	#pcp-photo-selector-2steps-modal .pcp-selector-info {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    font-size: 11px !important;
    margin-bottom: 8px !important;
}
	
    #pcp-photo-selector-2steps-modal .pcp-selector-actions {
        display: flex !important;
        flex-wrap: wrap !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        gap: 5px !important;
    }
    
    #pcp-photo-selector-2steps-modal .pcp-selector-btn {
        flex: 1 1 30% !important;
        min-width: 60px !important;
        max-width: 100% !important;
        padding: 8px 5px !important;
        font-size: 11px !important;
        border-radius: 20px !important;
        white-space: nowrap !important;
    }	
}
