/* ================================
   ESTILOS DO SELETOR DE TEMAS
   ================================ */

.tema-selector-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 999;
}

.tema-selector-backdrop.aberto {
  opacity: 1;
  visibility: visible;
}

.tema-selector {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 2px solid var(--border);
  border-radius: 24px 24px 0 0;
  padding: 24px;
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(500px);
  transition: transform 0.3s ease;
  z-index: 1000;
}

.tema-selector.aberto {
  transform: translateY(0);
}

@media (min-width: 768px) {
  .tema-selector {
    position: fixed;
    bottom: auto;
    top: 50%;
    left: 50%;
    right: auto;
    max-width: 500px;
    width: 90%;
    border-radius: 20px;
    transform: translate(-50%, calc(-50% + 500px));
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  }
  
  .tema-selector.aberto {
    transform: translate(-50%, -50%);
  }
}

.tema-selector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.tema-selector-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.close-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease;
}

.close-btn:hover {
  color: var(--text);
}

.tema-selector-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tema-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.tema-option:hover {
  background: var(--surface2);
  border-color: var(--accent);
}

.tema-option.ativo {
  background: var(--surface2);
  border-color: var(--accent);
}

.tema-preview {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.tema-option:hover .tema-preview {
  transform: scale(1.1);
}

.tema-info {
  flex: 1;
  min-width: 0;
}

.tema-nome {
  font-weight: 600;
  color: var(--text);
  font-size: 15px;
  margin-bottom: 4px;
}

.tema-desc {
  font-size: 13px;
  color: var(--muted);
}

.tema-check {
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
  margin-left: auto;
}

/* Botão para abrir seletor (opcional) */
.tema-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  color: var(--bg);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(var(--accent), 0.3);
  transition: all 0.3s ease;
  z-index: 100;
}

.tema-btn:hover {
  background: var(--accent2);
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(var(--accent), 0.4);
}

.tema-btn:active {
  transform: scale(0.95);
}

/* Animação de loading */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.tema-loading {
  display: inline-block;
  animation: spin 1s linear infinite;
}
