/**
 * QR Gallery Styles - Compatible avec Elementor Hello Theme
 * Brique 5 - Intégration Elementor + Téléchargements
 */

/* ========================================
   Container Principal
   ======================================== */
.qr-gallery-container {
  max-width: 100%;
  margin: 0 auto;
}

/* ========================================
   Header & Meta
   ======================================== */
.qr-gallery-header {
  margin-bottom: 1.5rem;
}

.qr-gallery-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  color: #333;
}

.qr-gallery-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
  font-size: 0.95rem;
  color: #666;
}

.qr-gallery-count,
.qr-gallery-expiration {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.qr-gallery-expiration.expired {
  color: #dc3545;
  font-weight: 600;
}

.qr-gallery-expiration.expiring-soon {
  color: #ff9800;
  font-weight: 600;
}

/* ========================================
   Grid Layout
   ======================================== */
.qr-gallery-grid {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

/* Colonnes responsives */
.qr-gallery-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.qr-gallery-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.qr-gallery-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* Responsive - Tablette */
@media (max-width: 1024px) {
  .qr-gallery-cols-4 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
  .qr-gallery-cols-3,
  .qr-gallery-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .qr-gallery-grid {
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .qr-gallery-cols-2,
  .qr-gallery-cols-3,
  .qr-gallery-cols-4 {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   Gallery Item (Figure)
   ======================================== */
.qr-gallery-item {
  margin: 0;
  position: relative;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.qr-gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* ========================================
   Image Wrapper & Image
   ======================================== */
.qr-gallery-image-wrapper {
  position: relative;
  width: 100%;
  padding-top: 75%; /* Aspect ratio 4:3 */
  overflow: hidden;
  background: #f5f5f5;
}

.qr-gallery-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.qr-gallery-item:hover .qr-gallery-image {
  transform: scale(1.05);
}

/* ========================================
   Download Overlay
   ======================================== */
.qr-gallery-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;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.qr-gallery-item:hover .qr-gallery-overlay {
  opacity: 1;
}

.qr-gallery-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: #4CAF50;
  color: #fff !important;
  text-decoration: none !important;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.3s ease, transform 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.qr-gallery-download-btn:hover {
  background: #45a049;
  transform: scale(1.05);
}

.qr-gallery-download-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ========================================
   Caption
   ======================================== */
.qr-gallery-caption {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: #666;
  text-align: center;
  background: #fff;
}

.qr-gallery-filesize {
  display: block;
  font-size: 0.75rem;
  color: #999;
  margin-top: 0.25rem;
}

/* ========================================
   Actions (Download All)
   ======================================== */
.qr-gallery-actions {
  text-align: center;
  padding: 2rem 0;
  border-top: 1px solid #e0e0e0;
  margin-top: 1rem;
}

.qr-gallery-download-all {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2.5rem;
  background: #2196F3;
  color: #fff !important;
  text-decoration: none !important;
  border-radius: 6px;
  font-weight: 700;
  font-size: 1.1rem;
  transition: background 0.3s ease, transform 0.2s ease;
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.qr-gallery-download-all:hover {
  background: #1976D2;
  transform: scale(1.03);
  box-shadow: 0 6px 16px rgba(33, 150, 243, 0.4);
}

.qr-gallery-download-all svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.qr-gallery-zip-size {
  display: inline-block;
  margin-left: 0.5rem;
  font-weight: 400;
  opacity: 0.9;
  font-size: 0.95rem;
}

/* ========================================
   États vides
   ======================================== */
.qr-gallery-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: #999;
}

.qr-gallery-empty svg {
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  opacity: 0.3;
}

/* ========================================
   Compatibilité Elementor
   ======================================== */

/* Reset des marges Elementor si nécessaire */
.elementor-widget-shortcode .qr-gallery-container {
  margin-top: 0;
}

/* Support du mode sombre Elementor (si activé) */
@media (prefers-color-scheme: dark) {
  .qr-gallery-container {
    color: #e0e0e0;
  }

  .qr-gallery-title {
    color: #fff;
  }

  .qr-gallery-item {
    background: #2a2a2a;
  }

  .qr-gallery-caption {
    background: #2a2a2a;
    color: #ccc;
  }
}

/* ========================================
   Loading state (optionnel)
   ======================================== */
.qr-gallery-loading {
  text-align: center;
  padding: 3rem;
  color: #999;
}

.qr-gallery-loading::after {
  content: '...';
  animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}
