/**
 * Image Gallery Styles for Mapster
 * Dual rating system and image gallery components
 */

/* Dual Rating System */
.dual-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}

.rating-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rating-stars {
    font-size: 16px;
    line-height: 1;
}

.google-rating-parentheses {
    color: #4285f4;
    font-weight: 600;
    font-size: 14px;
    margin-left: 4px;
}

.rating-count {
    color: #666;
    font-size: 12px;
    font-style: italic;
}

.google-only .rating-stars {
    color: #4285f4;
}

/* Image Gallery Container */
.image-gallery {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Loading State */
.gallery-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #666;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

/* Empty State */
.gallery-empty {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.gallery-empty p {
    margin-bottom: 20px;
    font-size: 16px;
}

/* Error State */
.gallery-error {
    text-align: center;
    padding: 60px 20px;
    color: #dc3545;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.error-message {
    margin-bottom: 20px;
    font-size: 16px;
}

/* Gallery Content */
.gallery-content {
    position: relative;
}

/* Hero Image Container */
.hero-image-container {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    background: #f8f9fa;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.hero-image:hover {
    transform: scale(1.02);
}

/* Hero Star Overlay - Étoile en filigrane gris clair simple */
.hero-star-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: transparent;
    box-shadow: none !important;
    outline: none !important;
    border: none !important;
}

.hero-star-overlay:hover {
    opacity: 0.7;
}

.hero-star-overlay:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Étoile vide (outline) par défaut */
.hero-star-overlay .star-icon {
    fill: none;
    stroke: #d3d3d3;
    stroke-width: 2px;
}

/* Étoile pleine quand active */
.hero-star-overlay.active .star-icon {
    fill: #d3d3d3;
    stroke: #d3d3d3;
}

/* Image Overlay - Désactivé */
.image-overlay {
    display: none;
}

.image-counter {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.image-actions {
    display: flex;
    gap: 8px;
}

.set-hero-btn {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.set-hero-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

.set-hero-btn.active {
    background: #ffc107;
    color: #000;
}

/* Navigation Arrows */
.navigation-arrows {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 16px;
    pointer-events: none;
}

.nav-arrow {
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    pointer-events: auto;
    opacity: 0;
}

.hero-image-container:hover .nav-arrow {
    opacity: 1;
}

.nav-arrow:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.nav-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Thumbnails Container */
.thumbnails-container {
    padding: 16px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.thumbnails-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 0;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.thumbnails-scroll::-webkit-scrollbar {
    height: 6px;
}

.thumbnails-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.thumbnails-scroll::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.thumbnails-scroll::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Thumbnail Items */
.thumbnail {
    position: relative;
    width: 80px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.thumbnail:hover {
    transform: scale(1.05);
    border-color: #007bff;
}

.thumbnail.active {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.thumbnail.hero {
    border-color: #ffc107;
}

.thumbnail.hero.active {
    border-color: #ffc107;
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.25);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #ffc107;
    color: #000;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-star-overlay {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
    }
    
    .hero-star-overlay .star-icon {
        width: 24px;
        height: 24px;
    }
    
    .hero-image-container {
        height: 300px;
    }
    
    .image-overlay {
        padding: 12px;
    }
    
    .navigation-arrows {
        padding: 0 12px;
    }
    
    .nav-arrow {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
    
    .thumbnails-container {
        padding: 12px;
    }
    
    .thumbnail {
        width: 60px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .hero-image-container {
        height: 250px;
    }
    
    .image-overlay {
        padding: 8px;
    }
    
    .image-counter {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    .set-hero-btn {
        font-size: 10px;
        padding: 4px 8px;
    }
    
    .thumbnails-container {
        padding: 8px;
    }
    
    .thumbnail {
        width: 50px;
        height: 38px;
    }
    
    .thumbnails-scroll {
        gap: 8px;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1.5;
}

.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
    border-color: #545b62;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

/* Animation for smooth transitions */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-content {
    animation: fadeIn 0.3s ease-out;
}

/* Focus styles for accessibility */
.nav-arrow:focus,
.thumbnail:focus,
.set-hero-btn:focus,
.btn:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .image-overlay {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .nav-arrow {
        background: #000;
        border: 2px solid #fff;
    }
    
    .thumbnail {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .hero-image,
    .thumbnail,
    .nav-arrow,
    .set-hero-btn,
    .image-overlay {
        transition: none;
    }
    
    .loading-spinner {
        animation: none;
    }
    
    .gallery-content {
        animation: none;
    }
}