:root {
  --primary: #667eea;
  --primary-dark: #764ba2;
  --secondary: #f093fb;
  --success: #4ade80;
  --danger: #ef4444;
  --warning: #f59e0b;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --radius: 8px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  min-height: 100vh;
  padding: 20px;
  color: var(--gray-800);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* HEADER */
.header {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 30px;
  overflow: hidden;
}

.header-content {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 40px 30px;
  text-align: center;
}

.header h1 {
  font-size: 2.5em;
  margin-bottom: 8px;
  font-weight: 700;
}

.header p {
  font-size: 1.1em;
  opacity: 0.9;
}

/* BUSCA SECTION */
.busca-section {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
  margin-bottom: 40px;
}

.busca-form {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-group .icon {
  font-size: 1.2em;
}

.form-group input,
.form-group select {
  padding: 12px 14px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 1em;
  transition: all 0.3s ease;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  background: var(--gray-50);
}

.form-group input[type="date"] {
  cursor: pointer;
}

.form-group small {
  font-size: 0.85em;
  color: var(--gray-500);
  margin-top: 4px;
}

/* FORM SECTIONS */
.form-section {
  border-top: 1px solid var(--gray-200);
  padding-top: 20px;
}

.section-title {
  display: block;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 15px;
  font-size: 1.05em;
}

.checkboxes-grid,
.radio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.checkbox-item,
.radio-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--gray-50);
}

.checkbox-item:hover,
.radio-item:hover {
  border-color: var(--primary);
  background: white;
}

.checkbox-item input,
.radio-item input {
  margin-right: 8px;
  cursor: pointer;
  width: 18px;
  height: 18px;
}

.checkbox-item input:checked ~ span,
.radio-item input:checked ~ span {
  color: var(--primary);
  font-weight: 600;
}

.checkbox-item span,
.radio-item span {
  flex: 1;
}

/* BOTÃO BUSCAR */
.btn-buscar {
  padding: 16px 30px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1.05em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-buscar:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.btn-buscar:active {
  transform: translateY(-1px);
}

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

/* CARREGANDO */
.carregando {
  text-align: center;
  padding: 60px 30px;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 40px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.carregando p {
  font-size: 1.1em;
  color: var(--gray-700);
  margin: 0;
}

/* RESULTADOS */
.resultados {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.resultado-section {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 25px;
}

.resultado-titulo {
  font-size: 1.4em;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid var(--gray-200);
  padding-bottom: 15px;
}

/* CARDS */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
  transform: translateY(-5px);
}

.card:hover::before {
  opacity: 1;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
  gap: 10px;
}

.card-titulo {
  font-size: 1.15em;
  font-weight: 700;
  color: var(--gray-800);
  flex: 1;
}

.card-badge {
  background: var(--primary);
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75em;
  font-weight: 600;
  white-space: nowrap;
}

.card-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9em;
  color: var(--warning);
}

.card-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 15px;
  font-size: 0.9em;
  color: var(--gray-600);
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-preco {
  font-size: 1.8em;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 15px;
  line-height: 1;
}

.card-preco-original {
  font-size: 0.6em;
  color: var(--gray-400);
  text-decoration: line-through;
}

.card-descricao {
  font-size: 0.9em;
  color: var(--gray-600);
  margin-bottom: 15px;
  flex: 1;
}

.card-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  font-size: 0.95em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.card-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.card-btn:active {
  transform: translateY(0);
}

/* MELHOR OPÇÃO */
.melhor-opcao {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 30px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: slideUp 0.5s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.melhor-opcao h3 {
  font-size: 1.3em;
  margin-bottom: 15px;
}

.melhor-opcao-detalhes {
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}

.detalhe-item {
  text-align: center;
}

.detalhe-label {
  font-size: 0.9em;
  opacity: 0.9;
  display: block;
  margin-bottom: 5px;
}

.detalhe-valor {
  font-size: 1.3em;
  font-weight: 700;
}

.melhor-preco {
  font-size: 2.5em;
  font-weight: 700;
  margin-bottom: 20px;
}

.melhor-preco-label {
  font-size: 0.8em;
  opacity: 0.9;
}

/* HISTÓRICO */
.historico-section {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 25px;
  margin-bottom: 30px;
}

.historico-section h2 {
  font-size: 1.3em;
  color: var(--gray-800);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid var(--gray-200);
  padding-bottom: 15px;
}

.historico-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
}

.historico-item {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  padding: 15px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s ease;
}

.historico-item:hover {
  background: white;
  border-color: var(--primary);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
  transform: translateY(-2px);
}

.historico-destino {
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 5px;
}

.historico-datas {
  font-size: 0.9em;
  color: var(--gray-600);
  margin-bottom: 5px;
}

.historico-data {
  font-size: 0.8em;
  color: var(--gray-400);
}

.historico-vazio {
  text-align: center;
  padding: 30px;
  color: var(--gray-500);
}

/* RESPONSIVO */
@media (max-width: 768px) {
  .header h1 {
    font-size: 2em;
  }

  .busca-section,
  .resultado-section,
  .historico-section {
    padding: 20px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .checkboxes-grid,
  .radio-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .melhor-opcao-detalhes {
    flex-direction: column;
  }

  .historico-list {
    grid-template-columns: 1fr;
  }
}

/* UTILITIES */
.text-center {
  text-align: center;
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}

.hidden {
  display: none !important;
}

.error-message {
  background: var(--danger);
  color: white;
  padding: 15px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.success-message {
  background: var(--success);
  color: white;
  padding: 15px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}
