/**
 * TopoclimbCH JavaScript Components Styles - Extended
 * Styles supplémentaires pour les nouveaux composants modernes
 */

/* ===== PHOTO GALLERY COMPONENT ===== */
.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.upload-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.upload-btn {
    display: flex;
    align-items: center;
    gap: 8px;
}

.upload-progress {
    min-width: 200px;
}

.upload-progress .progress {
    height: 6px;
    margin-bottom: 4px;
}

.gallery-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.view-controls .btn-group .btn {
    padding: 6px 12px;
}

.gallery-content {
    min-height: 200px;
    position: relative;
}

/* Layout Grid */
.grid-layout .gallery-grid {
    display: grid;
    grid-template-columns: repeat(var(--columns, auto-fit), minmax(200px, 1fr));
    gap: var(--gap, 12px);
}

/* Layout Masonry */
.masonry-layout .gallery-grid {
    columns: var(--columns, 4);
    column-gap: var(--gap, 12px);
}

.masonry-layout .photo-item {
    break-inside: avoid;
    margin-bottom: var(--gap, 12px);
}

/* Layout Carousel */
.carousel-layout .gallery-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: var(--gap, 12px);
    padding: 0 12px;
}

.carousel-layout .photo-item {
    flex: 0 0 300px;
    scroll-snap-align: start;
}

.photo-item {
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.photo-item.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.photo-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #f3f4f6;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.photo-container:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.photo-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.photo-container:not(.loaded) img {
    opacity: 0;
}

.photo-container.loaded img {
    opacity: 1;
}

.photo-container.error img {
    opacity: 0.3;
}

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 12px;
}

.photo-container:hover .photo-overlay {
    opacity: 1;
}

.photo-info {
    color: white;
    margin-top: auto;
}

.photo-title {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
}

.photo-caption {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
    line-height: 1.3;
}

.photo-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.photo-actions .btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.photo-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #6b7280;
    font-size: 24px;
}

.photo-container.loaded .photo-loading {
    display: none;
}

/* Empty State */
.empty-gallery {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    text-align: center;
    color: #6b7280;
}

.empty-content {
    max-width: 300px;
}

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

.empty-content h5 {
    margin-bottom: 8px;
    color: #374151;
}

/* Gallery Loading State */
.gallery-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #6b7280;
}

.loading-spinner {
    text-align: center;
}

.loading-spinner i {
    font-size: 24px;
    margin-bottom: 12px;
}

/* Lightbox Modal */
.photo-lightbox .modal-content {
    border: none;
}

.photo-lightbox .modal-header {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
}

.photo-lightbox .modal-title {
    font-size: 16px;
    font-weight: 500;
}

.lightbox-actions {
    display: flex;
    align-items: center;
}

.photo-lightbox .modal-body {
    height: 70vh;
    background: #000;
    position: relative;
}

.lightbox-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 25px;
    font-size: 18px;
    transition: background 0.3s ease;
    backdrop-filter: blur(10px);
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.photo-lightbox .modal-footer {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lightbox-caption {
    font-size: 14px;
    flex: 1;
}

.lightbox-counter {
    font-size: 12px;
}

/* Gallery Statistics */
.gallery-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: #6b7280;
    margin-top: 16px;
}

.photos-count {
    font-weight: 500;
}

/* ===== MODERN FORM COMPONENTS ===== */
.suggestion-card,
.preview-card,
.assistance-panel {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
}

.suggestion-card {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-suggestion {
    background: none;
    border: none;
    color: #0d6efd;
    text-decoration: underline;
    padding: 0;
    cursor: pointer;
}

.btn-suggestion:hover {
    color: #0a58ca;
}

.preview-card {
    display: flex;
    align-items: center;
    gap: 8px;
}

.code-display {
    font-family: 'Courier New', monospace;
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
}

.assistance-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    outline: none;
}

.toggle-icon {
    transition: transform 0.2s ease;
}

.assistance-panel[open] .toggle-icon {
    transform: rotate(180deg);
}

.assistance-content {
    margin-top: 12px;
}

.assistance-intro {
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
}

.assistance-list {
    margin: 8px 0;
    padding-left: 20px;
}

.assistance-list li {
    margin-bottom: 4px;
    font-size: 13px;
}

.assistance-actions {
    margin-top: 12px;
}

.btn-assistance {
    background: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-assistance:hover {
    background: #dee2e6;
}

/* Auto-save Indicator */
.autosave-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1050;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    border-left: 4px solid #6c757d;
}

.autosave-indicator.show {
    transform: translateX(0);
}

.autosave-indicator.success {
    border-left-color: #28a745;
}

.autosave-indicator.warning {
    border-left-color: #ffc107;
}

.autosave-indicator.info {
    border-left-color: #17a2b8;
}

.indicator-content {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

/* Field Validation */
.field-errors {
    margin-top: 4px;
}

.field-error {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    margin-bottom: 2px;
}

.char-counter {
    font-size: 11px;
    text-align: right;
    margin-top: 4px;
}

.char-counter .progress {
    height: 3px;
    margin-top: 2px;
}

/* Progress Indicators */
.submission-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: white;
}

.progress-content {
    text-align: center;
    max-width: 300px;
}

.progress-spinner {
    font-size: 24px;
    margin-bottom: 12px;
}

.progress-text {
    margin: 0;
    font-size: 16px;
}

.progress-detail {
    margin: 4px 0 0 0;
    font-size: 14px;
    opacity: 0.8;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .gallery-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .gallery-controls {
        justify-content: center;
    }
    
    .masonry-layout .gallery-grid {
        columns: 2;
    }
    
    .carousel-layout .photo-item {
        flex: 0 0 250px;
    }
    
    .photo-lightbox .modal-body {
        height: 60vh;
    }
    
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
}

@media (max-width: 480px) {
    .masonry-layout .gallery-grid {
        columns: 1;
    }
    
    .carousel-layout .photo-item {
        flex: 0 0 200px;
    }
    
    .autosave-indicator {
        right: 10px;
        top: 10px;
        padding: 8px 12px;
    }
    
    .suggestion-card,
    .preview-card,
    .assistance-panel {
        padding: 8px;
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    .photo-container {
        background: #374151;
    }
    
    .suggestion-card,
    .preview-card,
    .assistance-panel {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .code-display {
        background: #4b5563;
        color: #f9fafb;
    }
    
    .btn-assistance {
        background: #4b5563;
        border-color: #6b7280;
        color: #f9fafb;
    }
    
    .btn-assistance:hover {
        background: #6b7280;
    }
    
    .autosave-indicator {
        background: #374151;
        color: #f9fafb;
    }
    
    .empty-content h5 {
        color: #f9fafb;
    }
    
    .gallery-header {
        border-color: #4b5563;
    }
    
    .submission-progress {
        background: rgba(31, 41, 55, 0.9);
    }
}