/* ==========================================
   ESTILOS DA ÁREA DO CLIENTE
   ========================================== */

/* Galeria de Fotos */
.galeria-container {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  padding: 20px 0 120px 0;
}

/* Item de seleção */
.selecao-item {
  cursor: pointer;
  position: relative;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  aspect-ratio: 1;
  border: 3px solid transparent;
}

.selecao-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.selecao-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.selecao-item:hover img {
  transform: scale(1.03);
}

/* Overlay de seleção */
.selecao-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, transparent 40%, transparent 60%, rgba(0,0,0,0.4) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
  pointer-events: none;
}

.selecao-item:hover::before {
  opacity: 1;
}

/* Ocultar checkbox padrão */
.selecao-item input[type="checkbox"],
.selecao-item input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 5;
  cursor: pointer;
  margin: 0;
}

/* Indicador de seleção customizado */
.selecao-item .select-indicator {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  z-index: 10;
  transition: all 0.3s ease;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.8);
}

.selecao-item:hover .select-indicator {
  opacity: 1;
  transform: scale(1);
}

.selecao-item .select-indicator svg {
  width: 18px;
  height: 18px;
  fill: white;
  opacity: 0;
  transform: scale(0);
  transition: all 0.2s ease;
}

/* Item selecionado */
.selecao-item.selected {
  border-color: #C41E3A;
  box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.25), 0 12px 24px rgba(0, 0, 0, 0.15);
}

.selecao-item.selected::before {
  opacity: 1;
  background: linear-gradient(180deg, rgba(196, 30, 58, 0.3) 0%, transparent 50%);
}

.selecao-item.selected .select-indicator {
  opacity: 1;
  transform: scale(1);
  background: linear-gradient(135deg, #C41E3A, #9B1B30);
  border-color: #C41E3A;
}

.selecao-item.selected .select-indicator svg {
  opacity: 1;
  transform: scale(1);
}

/* Número de ordem (para álbum) */
.selecao-item .selection-order {
  position: absolute;
  bottom: 12px;
  right: 12px;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  background: linear-gradient(135deg, #C41E3A, #9B1B30);
  color: white;
  border-radius: 14px;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 0;
  transform: scale(0);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(196, 30, 58, 0.4);
}

.selecao-item.selected .selection-order {
  opacity: 1;
  transform: scale(1);
}

/* Botão de zoom */
.selecao-item .zoom-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.selecao-item:hover .zoom-btn {
  opacity: 1;
  transform: scale(1);
}

.selecao-item .zoom-btn:hover {
  background: white;
  transform: scale(1.1);
}

.selecao-item .zoom-btn svg {
  width: 18px;
  height: 18px;
  fill: #1A1A2E;
}

/* ==========================================
   BARRA DE AÇÕES FLUTUANTE
   ========================================== */
.action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  padding: 16px 24px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-bar.visible {
  transform: translateY(0);
}

.action-bar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 800px;
  gap: 20px;
}

.action-bar-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.selection-count {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.selection-count .current {
  font-size: 2rem;
  font-weight: 800;
  color: #C41E3A;
  line-height: 1;
}

.selection-count .separator {
  color: #9CA3AF;
  font-size: 1.2rem;
}

.selection-count .max {
  font-size: 1.2rem;
  font-weight: 600;
  color: #1A1A2E;
}

.selection-label {
  color: #6B7280;
  font-size: 0.9rem;
}

/* Barra de progresso */
.progress-bar-container {
  flex: 1;
  max-width: 200px;
  height: 8px;
  background: #E5E7EB;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #C41E3A, #E85A71);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-bar.full {
  background: linear-gradient(90deg, #10B981, #34D399);
}

.progress-bar.over {
  background: linear-gradient(90deg, #EF4444, #F87171);
}

.action-bar-buttons {
  display: flex;
  gap: 12px;
}

.btn-clear {
  padding: 12px 20px;
  background: #F3F4F6;
  color: #374151;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-clear:hover {
  background: #E5E7EB;
}

.btn-confirm {
  padding: 12px 28px;
  background: linear-gradient(135deg, #C41E3A, #9B1B30);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  box-shadow: 0 4px 15px rgba(196, 30, 58, 0.3);
}

.btn-confirm:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(196, 30, 58, 0.4);
}

.btn-confirm:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ==========================================
   TOAST NOTIFICATIONS
   ========================================== */
.toast-container {
  position: fixed;
  top: 100px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 16px 24px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 350px;
}

.toast.show {
  transform: translateX(0);
}

.toast-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-icon svg {
  width: 14px;
  height: 14px;
  fill: white;
}

.toast.success .toast-icon {
  background: #10B981;
}

.toast.error .toast-icon {
  background: #EF4444;
}

.toast.warning .toast-icon {
  background: #F59E0B;
}

.toast-message {
  flex: 1;
  font-size: 0.95rem;
  color: #1A1A2E;
  font-weight: 500;
}

/* ==========================================
   LIGHTBOX MELHORADO
   ========================================== */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(10px);
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  max-width: 90%;
  max-height: 85%;
  position: relative;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 1.8rem;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.lightbox-actions {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
}

.lightbox-actions .btn {
  padding: 14px 32px;
  font-size: 1rem;
}

/* ==========================================
   INSTRUÇÕES DE SELEÇÃO
   ========================================== */
.selection-instructions {
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 4px solid #F59E0B;
}

.selection-instructions svg {
  width: 24px;
  height: 24px;
  fill: #D97706;
  flex-shrink: 0;
}

.selection-instructions p {
  color: #92400E;
  font-size: 0.95rem;
  margin: 0;
}

/* ==========================================
   RESPONSIVO
   ========================================== */
@media (max-width: 768px) {
  .galeria-container {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    padding-bottom: 100px;
  }
  
  .selecao-item {
    border-radius: 12px;
    border-width: 2px;
  }
  
  .selecao-item .select-indicator {
    width: 26px;
    height: 26px;
    top: 8px;
    left: 8px;
    opacity: 1;
    transform: scale(1);
    border-width: 2px;
  }
  
  .selecao-item .select-indicator svg {
    width: 14px;
    height: 14px;
  }
  
  .selecao-item .zoom-btn {
    width: 30px;
    height: 30px;
    top: 8px;
    right: 8px;
  }
  
  .selecao-item .selection-order {
    bottom: 8px;
    right: 8px;
    min-width: 24px;
    height: 24px;
    font-size: 0.75rem;
  }
  
  .action-bar {
    padding: 12px 16px;
  }
  
  .action-bar-content {
    flex-direction: column;
    gap: 12px;
  }
  
  .action-bar-info {
    width: 100%;
    justify-content: space-between;
  }
  
  .progress-bar-container {
    display: none;
  }
  
  .action-bar-buttons {
    width: 100%;
  }
  
  .action-bar-buttons .btn-confirm {
    flex: 1;
  }
  
  .selection-count .current {
    font-size: 1.5rem;
  }
  
  .toast {
    left: 20px;
    right: 20px;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .galeria-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}
