/* --- Abas e Filtros --- */
.tabs, .filters {
  display: flex;
  gap: 10px;
  margin: 20px 0;
}

.tab-btn, .filter-btn {
  background: var(--light);
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 8px 15px;
  border-radius: 20px;
  cursor: pointer;
}

.tab-btn.active, .filter-btn.active {
  background: var(--primary);
  color: white;
}

/* --- Cards de Prêmios --- */
.premios-grid, .meus-premios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.premio-card {
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px;
  position: relative;
}
.premio-imagem-container {
    height: 180px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-bottom: 1px solid #eee;
}

.premio-imagem {
    max-width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.premio-card:hover .premio-imagem {
    transform: scale(1.05);
}

.premio-sem-imagem {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    color: var(--primary);
    font-size: 3rem;
    border-bottom: 1px solid #eee;
}


.premio-card.adquirido {
  border-left: 4px solid var(--success);
}

.premio-card.esgotado {
  opacity: 0.7;
}

.badge-adquirido, .badge-esgotado {
  position: absolute;
  top: -10px;
  right: 10px;
  background: var(--success);
  color: white;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
}

.badge-esgotado {
  background: var(--accent);
}

.premio-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
}

.premio-price {
  color: var(--primary);
  font-weight: bold;
}

.premio-stock {
  font-size: 12px;
  color: var(--dark);
}

/* --- Meus Prêmios --- */
.meu-premio-card {
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px;
}

.premio-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
}

.premio-date {
  font-size: 12px;
  color: var(--dark);
}

.voucher-code {
  font-family: monospace;
  background: var(--light);
  padding: 3px 5px;
  border-radius: 3px;
}

/* --- Resgate de Voucher --- */
.voucher-detail-container {
  max-width: 400px;
  margin: 0 auto;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.voucher-header {
  background: var(--primary);
  color: white;
  padding: 15px;
  text-align: center;
}

.voucher-body {
  padding: 20px;
  text-align: center;
}

.voucher-value {
  font-size: 2.5rem;
  color: var(--primary);
  font-weight: bold;
  margin: 10px 0;
}

.voucher-code-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 20px 0;
}

.voucher-footer {
  padding: 15px;
  text-align: center;
  border-top: 1px dashed #ddd;
}

/* --- Container Principal --- */
.container-premios {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* --- Cards de Títulos --- */
.titulos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.titulo-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    position: relative;
    transition: transform 0.2s;
}

.titulo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.titulo-card.ativo {
    border-left: 4px solid var(--success);
}

/* --- Elementos Internos --- */
.titulo-card h3 {
    color: var(--primary);
    margin-bottom: 10px;
}

.descricao {
    color: var(--dark);
    font-style: italic;
    min-height: 60px;
}

.preco-estoque {
    display: flex;
    justify-content: space-between;
    margin: 15px 0;
}

.preco {
    font-weight: bold;
    color: var(--primary);
}

.estoque {
    font-size: 0.9rem;
    color: var(--dark);
}

.estoque.esgotado {
    color: var(--accent);
    font-weight: bold;
}

/* --- Botões --- */
.btn-comprar, .btn-ativar {
    display: block;
    width: 100%;
    padding: 10px;
    text-align: center;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}

.btn-ativar {
    background: var(--secondary);
    color: var(--dark);
}

.btn-ver-meus {
    display: inline-block;
    margin-top: 30px;
    padding: 10px 20px;
    background: var(--info);
    color: white;
    border-radius: 4px;
}

/* --- Título Ativo --- */
.titulo-ativo-card {
    background: var(--light);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.badge-ativo {
    display: inline-block;
    padding: 5px 10px;
    background: var(--success);
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
}

/* .filters-container {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin: 20px 0;
      flex-wrap: wrap;
      gap: 15px;
    } */

    .filter-select {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .filter-select label {
      font-weight: bold;
      color: var(--primary);
    }

    .form-select-premios {
      padding: 8px 12px;
      border-radius: 6px;
      border: 1px solid #ddd;
      background-color: white;
      cursor: pointer;
      min-width: 200px;
    }

.htmx-indicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.9);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  z-index: 1000;
  text-align: center;
}

.loading-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px;
}

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

.htmx-request #htmx-indicator {
  display: block;
}

.titulos-grid {
  transition: opacity 0.3s ease;
}

.htmx-request .titulos-grid {
  opacity: 0.5;
}

select.htmx-request {
  background: url('loading-spinner.gif') no-repeat right center;
}


    @media (max-width: 768px) {
      .filters-container {
        flex-direction: column;
        align-items: flex-start;
      }
    }
