/**
 * PhotoClass Pro - Gift Selector CSS
 * Styles pour la sélection de photos pour les cadeaux
 */

/* =====================================================
   BANDEAU FIXE EN HAUT
   ===================================================== */

#pcp-gift-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.pcp-gift-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    max-width: 1400px;
    margin: 0 auto;
    gap: 20px;
}

.pcp-gift-banner-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.pcp-gift-banner-text {
    flex: 1;
}

.pcp-gift-banner-text strong {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
}

.pcp-gift-banner-hint {
    font-size: 13px;
    opacity: 0.9;
}

.pcp-gift-banner-counter {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 20px;
    font-weight: bold;
    flex-shrink: 0;
}

#pcp-gift-banner.complete .pcp-gift-banner-counter {
    background: #4CAF50;
    animation: pulse 0.5s ease;
}

.pcp-gift-banner-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.pcp-gift-btn-validate,
.pcp-gift-btn-cancel {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pcp-gift-btn-validate {
    background: #4CAF50;
    color: white;
}

.pcp-gift-btn-validate:hover:not(:disabled) {
    background: #45a049;
    transform: scale(1.05);
}

.pcp-gift-btn-validate:disabled {
    background: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
}

.pcp-gift-btn-validate.ready {
    animation: glow 1s ease-in-out infinite alternate;
}

.pcp-gift-btn-cancel {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.pcp-gift-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

/* Ancienne zone de prévisualisation (supprimée, remplacée par inline) */
#pcp-gift-selected-preview {
    display: none !important;
}

/* Message de succès */
.pcp-gift-banner-success {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 15px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.pcp-gift-banner-success-icon {
    font-size: 40px;
}

.pcp-gift-banner-success-text strong {
    display: block;
    font-size: 18px;
    margin-bottom: 5px;
}

.pcp-gift-banner-success-text span {
    font-size: 14px;
    opacity: 0.9;
}

/* =====================================================
   PANNEAU DANS LA LIGHTBOX
   ===================================================== */

.pcp-gift-panel {
    padding: 20px;
    text-align: center;
}

.pcp-gift-panel-header {
    margin-bottom: 20px;
}

.pcp-gift-panel-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.pcp-gift-panel-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.pcp-gift-panel-subtitle {
    display: inline-block;
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
}

.pcp-gift-panel-status {
    background: #f0f0f0;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

.pcp-gift-panel-action {
    margin-bottom: 20px;
}

.pcp-gift-btn-choose {
    display: block;
    width: 100%;
    padding: 15px 20px;
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pcp-gift-btn-choose:hover:not(.disabled) {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 115, 170, 0.4);
}

.pcp-gift-btn-remove {
    display: block;
    width: 100%;
    padding: 15px 20px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pcp-gift-btn-remove:hover {
    background: #e74c3c;
}

.pcp-gift-panel-full {
    padding: 15px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: 500;
}

.pcp-gift-btn-validate-lb {
    display: block;
    width: 100%;
    padding: 15px 20px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pcp-gift-btn-validate-lb:hover {
    background: #45a049;
    transform: scale(1.02);
}

.pcp-gift-panel-selected {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.pcp-gift-panel-selected-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.pcp-gift-panel-selected-list {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.pcp-gift-panel-thumb {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid #0073aa;
}

.pcp-gift-panel-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =====================================================
   MARQUAGE DES PHOTOS DANS LA GRILLE
   ===================================================== */

body.pcp-gift-selection-mode .photoclass-masonry-item.pcp-gift-selected {
    position: relative;
}

body.pcp-gift-selection-mode .photoclass-masonry-item.pcp-gift-selected::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: #4CAF50;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

body.pcp-gift-selection-mode .photoclass-masonry-item.pcp-gift-selected img {
    border: 3px solid #4CAF50;
}

/* =====================================================
   ANIMATIONS
   ===================================================== */

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes glow {
    from { box-shadow: 0 0 5px #4CAF50, 0 0 10px #4CAF50; }
    to { box-shadow: 0 0 10px #4CAF50, 0 0 20px #4CAF50, 0 0 30px #4CAF50; }
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 768px) {
    .pcp-gift-banner-content {
        flex-wrap: wrap;
        padding: 12px 15px;
        gap: 10px;
    }
    
    .pcp-gift-banner-icon {
        font-size: 24px;
    }
    
    .pcp-gift-banner-text strong {
        font-size: 14px;
    }
    
    .pcp-gift-banner-hint {
        display: none;
    }
    
    .pcp-gift-banner-counter {
        padding: 8px 15px;
        font-size: 16px;
    }
    
    .pcp-gift-banner-actions {
        width: 100%;
        justify-content: center;
    }
    
    .pcp-gift-btn-validate,
    .pcp-gift-btn-cancel {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .pcp-gift-preview-item {
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .pcp-gift-banner-text {
        text-align: center;
    }
    
    .pcp-gift-banner-counter {
        order: -1;
        width: 100%;
        text-align: center;
    }
}

/* =====================================================
   🆕 INDICATION FORMAT REQUIS (style compact, bleu)
   ===================================================== */

.pcp-gift-format-hint {
    display: inline-block;
    margin-top: 5px;
    padding: 4px 12px;
    background: rgba(100, 181, 246, 0.3);
    border: 1px solid rgba(100, 181, 246, 0.5);
    border-radius: 15px;
    font-size: 12px;
    color: #fff;
    font-weight: 500;
}

/* =====================================================
   🆕 PHOTOS SÉLECTIONNÉES INLINE (dans le bandeau)
   ===================================================== */

.pcp-gift-selected-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 15px;
}

.pcp-gift-preview-inline-item {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: visible;
    border: 2px solid #4CAF50;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.pcp-gift-preview-inline-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.pcp-gift-preview-inline-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    background: #e74c3c;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, background 0.2s ease;
}

.pcp-gift-preview-inline-remove:hover {
    background: #c0392b;
    transform: scale(1.1);
}

/* =====================================================
   🆕 PHOTOS INCOMPATIBLES DANS LA GRILLE
   ===================================================== */

body.pcp-gift-selection-mode .photoclass-masonry-item.pcp-gift-incompatible {
    position: relative;
    opacity: 0.5;
    pointer-events: none;
}

body.pcp-gift-selection-mode .photoclass-masonry-item.pcp-gift-incompatible img {
    filter: grayscale(50%);
}

.pcp-gift-incompatible-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.pcp-gift-incompatible-overlay span {
    background: rgba(255, 107, 107, 0.9);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

/* =====================================================
   🆕 MESSAGE INCOMPATIBLE DANS LA LIGHTBOX
   ===================================================== */

.pcp-gift-panel-incompatible {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
    border: 2px solid #ffcdd2;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    text-align: center;
    color: #c62828;
    font-weight: 500;
}

.pcp-gift-panel-incompatible small {
    display: block;
    margin-top: 5px;
    font-weight: 400;
    opacity: 0.8;
}

.pcp-gift-btn-choose.disabled {
    background: #ccc !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

.pcp-gift-btn-choose.disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}
