/**
 * BookMi Wizard - Styles pour l'upload d'images des chambres
 */

/* Container principal des images */
.room-images-container {
    margin-top: 20px;
}

/* Zone de drag & drop */
.room-images-container.drag-over {
    background-color: #f0f8ff;
    border: 2px dashed #0073aa;
    border-radius: 8px;
    padding: 20px;
}

/* Grille des images */
.room-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    min-height: 100px;
    padding: 15px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background-color: #fafafa;
    transition: all 0.3s ease;
}

.room-images-grid:empty::before {
    content: "Glissez-déposez vos images ici ou utilisez les boutons ci-dessous";
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-style: italic;
    text-align: center;
    line-height: 1.5;
    grid-column: 1 / -1;
}

/* Élément d'image individuel */
.room-image-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.room-image-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Container de l'image */
.image-container {
    position: relative;
    width: 100%;
    height: 120px;
    overflow: hidden;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.room-image-item:hover .image-container img {
    transform: scale(1.05);
}

/* Overlay avec boutons */
.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.room-image-item:hover .image-overlay {
    opacity: 1;
}

/* Bouton de suppression */
.remove-room-image {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #d63638;
    font-size: 16px;
    transition: background-color 0.2s ease;
}

.remove-room-image:hover {
    background: white;
    color: #a00;
}

/* Actions d'upload */
.room-images-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 15px;
}

.room-images-actions .button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.room-images-actions .button:hover {
    background: #005a87;
    color: white;
}

.room-images-actions .button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.room-images-actions .description {
    margin: 10px 0 0 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    flex-basis: 100%;
}

/* État de chargement */
.room-image-item.loading {
    background: #f9f9f9;
    border: 1px dashed #ccc;
}

.image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 120px;
    color: #666;
    font-size: 12px;
    text-align: center;
    padding: 10px;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsivité */
@media (max-width: 768px) {
    .room-images-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
        padding: 10px;
    }
    
    .image-container {
        height: 100px;
    }
    
    .room-images-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .room-images-actions .button {
        justify-content: center;
    }
}

/* Animation d'apparition pour les nouvelles images */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.room-image-item {
    animation: fadeInUp 0.3s ease;
}

/* Styles pour le compteur d'images dans l'onglet */
.tab-count {
    background: #0073aa;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    margin-left: 5px;
    min-width: 16px;
    text-align: center;
    display: inline-block;
}

.room-tab-btn.active .tab-count {
    background: white;
    color: #0073aa;
}

/* Messages d'erreur pour l'upload */
.upload-error {
    background: #ffeaa7;
    border: 1px solid #fdcb6e;
    color: #2d3436;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 13px;
}

.upload-success {
    background: #d1f2eb;
    border: 1px solid #52c41a;
    color: #2d3436;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 13px;
}