@import url("https://fonts.googleapis.com/css2?family=Archivo:wght@300;400;500;600;700&display=swap");

:root {
  --color-primary: #348bf0;
  --color-primary-dark: #2563eb;
  --color-primary-light: rgba(52, 139, 240, 0.1);
  --color-secondary: #0e1b77;
  --color-dark: #0c0d0d;
  --color-gray: #b6b8ba;
  --color-gray-light: #f4f6f8;
  --color-background: #f8fafc;
  --color-card: #ffffff;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --color-info: #3b82f6;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);

  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --border-radius-xl: 20px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  background: linear-gradient(135deg, var(--color-background) 0%, #e2e8f0 100%);
  color: var(--color-dark);
  line-height: 1.6;
  min-height: 100vh;
}

/* Header com apenas o botão centralizado */
.header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.header-button-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.header-back-button {
  background: linear-gradient(
    135deg,
    var(--color-primary) 0%,
    var(--color-secondary) 100%
  );
  color: white;
  border: none;
  border-radius: var(--border-radius-lg);
  padding: 0.875rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: "Archivo", sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.header-back-button::before {
  content: "←";
  font-size: 1.1rem;
}

.header-back-button::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

.header-back-button:hover::after {
  left: 100%;
}

.header-back-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.header-back-button:active {
  transform: translateY(0);
}

/* Main Content */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
  min-height: calc(100vh - 100px);
}

.container {
  max-width: 900px;
  margin: 0 auto;
}

/* Search Section Moderna */
.search-section {
  text-align: center;
  margin-bottom: 4rem;
}

.search-section h2 {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(
    135deg,
    var(--color-dark) 0%,
    var(--color-gray) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
}

.search-section::after {
  content: "";
  display: block;
  width: 60px;
  height: 4px;
  background: linear-gradient(
    135deg,
    var(--color-primary) 0%,
    var(--color-secondary) 100%
  );
  margin: 1.5rem auto 2.5rem;
  border-radius: 2px;
}

.search-form {
  max-width: 600px;
  margin: 0 auto;
}

.search-input-container {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--color-card);
  border: 2px solid transparent;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
}

.search-input-container:focus-within {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-xl), 0 0 0 2px var(--color-primary-light);
  transform: translateY(-3px);
}

.search-input {
  flex: 1;
  padding: 1.25rem 1.5rem;
  border: none;
  outline: none;
  font-size: 1.1rem;
  font-family: "Archivo", sans-serif;
  font-weight: 500;
  background: transparent;
  color: var(--color-dark);
}

.search-input::placeholder {
  color: var(--color-gray);
  font-weight: 400;
}

.search-button {
  padding: 1.25rem 1.5rem;
  background: linear-gradient(
    135deg,
    var(--color-primary) 0%,
    var(--color-secondary) 100%
  );
  color: white;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.search-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

.search-button:hover::before {
  left: 100%;
}

.search-button:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

.search-button:active {
  transform: scale(0.98);
}

/* Result Card - Design Moderno */
.results-section {
  margin-bottom: 4rem;
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.results-container {
  position: relative;
}

.result-card {
  background: var(--color-card);
  border-radius: var(--border-radius-xl);
  padding: 0;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(226, 232, 240, 0.8);
  overflow: hidden;
  position: relative;
  transition: all 0.3s ease;
}

.result-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(
    135deg,
    var(--color-primary) 0%,
    var(--color-secondary) 100%
  );
}

.result-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.result-header {
  background: linear-gradient(135deg, var(--color-gray-light) 0%, #f1f5f9 100%);
  padding: 2rem 2.5rem 1.5rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  position: relative;
}

.result-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-dark);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.result-title::before {
  content: "📄";
  font-size: 1.25rem;
}

.result-subtitle {
  font-size: 0.95rem;
  color: var(--color-gray);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.result-subtitle::before {
  content: "📅";
  font-size: 0.875rem;
}

/* Status Badge */
.status-badge {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius-lg);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-em-analise {
  background: rgba(249, 115, 22, 0.1);
  color: #ea580c;
  border: 1px solid rgba(249, 115, 22, 0.2);
}

.status-deferido {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-indeferido {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 3px solid rgba(239, 68, 68, 0.2);
}

/* Grid Moderno */
.result-grid {
  padding: 2.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.result-item {
  background: rgba(248, 250, 252, 0.5);
  padding: 1.5rem;
  border-radius: var(--border-radius-md);
  border: 1px solid rgba(226, 232, 240, 0.6);
  transition: all 0.3s ease;
  position: relative;
}

.result-item:hover {
  background: rgba(52, 139, 240, 0.02);
  border-color: rgba(52, 139, 240, 0.2);
  transform: translateY(-2px);
}

.result-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.result-value {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--color-dark);
  word-break: break-word;
  line-height: 1.4;
}

/* Ícones para diferentes tipos de dados */
.result-item[data-type="date"] .result-label::before {
  content: "📅";
}

.result-item[data-type="time"] .result-label::before {
  content: "🕒";
}

.result-item[data-type="type"] .result-label::before {
  content: "📋";
}

.result-item[data-type="instance"] .result-label::before {
  content: "🏛️";
}

.result-item[data-type="situation"] .result-label::before {
  content: "⚖️";
}

.result-item[data-type="vote"] .result-label::before {
  content: "🗳️";
}

.result-item[data-type="auto"] .result-label::before {
  content: "🚗";
}

.result-item[data-type="plate"] .result-label::before {
  content: "🏷️";
}

/* Loading moderno */
.loading-spinner {
  text-align: center;
  padding: 4rem;
}

.spinner {
  width: 3rem;
  height: 3rem;
  border: 4px solid rgba(52, 139, 240, 0.1);
  border-top: 4px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1.5rem;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading-spinner p {
  color: var(--color-gray);
  font-weight: 500;
  font-size: 1.1rem;
}

/* Error Message Moderna */
.error-message {
  background: linear-gradient(135deg, #fef2f2 0%, #fecaca 10%);
  border: 1px solid #fca5a5;
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  text-align: center;
  margin: 2rem 0;
  position: relative;
  overflow: hidden;
}

.error-message::before {
  content: "⚠️";
  font-size: 1.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

.error-message p {
  color: #dc2626;
  font-weight: 600;
  font-size: 1rem;
}

/* Responsive para o header com botão */
@media (max-width: 768px) {
  .header-content {
    padding: 0.875rem 1rem;
  }

  .header-back-button {
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    width: 100%;
    max-width: 280px;
  }

  .main-content {
    padding: 2rem 1rem;
  }

  .search-section h2 {
    font-size: 2rem;
  }

  .result-grid {
    grid-template-columns: 1fr;
    padding: 1.5rem;
    gap: 1.5rem;
  }

  .result-header {
    padding: 1.5rem 1.5rem 1rem;
  }

  .status-badge {
    position: static;
    margin-top: 1rem;
    display: inline-block;
  }
}

@media (max-width: 480px) {
  .header-content {
    padding: 0.75rem 0.5rem;
  }

  .header-back-button {
    padding: 0.625rem 1rem;
    font-size: 0.8rem;
    max-width: 100%;
  }

  .search-input-container {
    flex-direction: column;
  }

  .search-input {
    width: 100%;
    text-align: center;
  }

  .search-button {
    width: 100%;
    padding: 0.75rem;
  }
}

/* Animações de microinteração */
.fade-in {
  animation: fadeInUp 0.6s ease forwards;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.result-item:hover .result-label {
  color: var(--color-primary);
}

.result-item:hover .result-value {
  color: var(--color-dark);
}

/* Scroll suave */
html {
  scroll-behavior: smooth;
}

/* Focus states melhorados */
.search-input:focus,
.search-button:focus,
.header-back-button:focus {
  outline: 1px solid var(--color-primary);
  outline-offset: 1px;
}

.header-back-button {
  background: linear-gradient(
    135deg,
    var(--color-primary) 0%,
    var(--color-secondary) 100%
  );
  color: white;
  border: none;
  border-radius: var(--border-radius-lg);
  padding: 0.875rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: "Archivo", sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  text-decoration: none; /* Remove sublinhado do link */
}
/* Search Input com Placeholder Moderno */
.search-input-container {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--color-card);
  border: 2px solid #e2e8f0;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
  max-width: 500px;
  margin: 0 auto;
}

.search-input-container:focus-within {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-xl), 0 0 0 2px var(--color-primary-light);
  transform: translateY(-3px);
}

.search-input {
  flex: 1;
  padding: 1.25rem 1.5rem;
  border: none;
  outline: none;
  font-size: 1.1rem;
  font-family: "Archivo", sans-serif;
  font-weight: 500;
  background: transparent;
  color: var(--color-dark);
  width: 100%;
}

/* Placeholder Estilizado */
.search-input::placeholder {
  color: #696b8a;
  font-weight: 400;
  font-size: 1rem;
  opacity: 1;
  transition: all 0.3s ease;
}

.search-input:focus::placeholder {
  opacity: 0.6;
  transform: translateY(-2px);
}

/* Suporte cross-browser para placeholder */
.search-input::-webkit-input-placeholder {
  color: #696b8a;
  font-weight: 400;
  opacity: 1;
}

.search-input::-moz-placeholder {
  color: #696b8a;
  font-weight: 400;
  opacity: 1;
}

.search-input:-ms-input-placeholder {
  color: #696b8a;
  font-weight: 400;
  opacity: 1;
}

/* Floating Label Effect (Opcional) */
.search-form {
  position: relative;
  max-width: 500px;
  margin: 0 auto;
}

.floating-label {
  position: absolute;
  top: 50%;
  left: 1.5rem;
  transform: translateY(-50%);
  color: #696b8a;
  font-size: 1rem;
  font-weight: 400;
  pointer-events: none;
  transition: all 0.3s ease;
  background: white;
  padding: 0 0.5rem;
  z-index: 1;
}

.search-input:focus + .floating-label,
.search-input:not(:placeholder-shown) + .floating-label {
  top: 0;
  left: 1rem;
  transform: translateY(-50%);
  font-size: 0.75rem;
  color: var(--color-primary);
  font-weight: 500;
}

/* Helper Text */
.input-helper {
  font-size: 0.875rem;
  color: #696b8a;
  margin-top: 0.5rem;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.search-input:focus ~ .input-helper {
  opacity: 1;
}

/* Feedback Visual em Tempo Real */
.search-input.valid {
  border-color: #10b981;
  background-color: rgba(16, 185, 129, 0.02);
}

.search-input.invalid {
  border-color: #ef4444;
  background-color: rgba(239, 68, 68, 0.02);
}

/* Ícone de Status */
.input-status-icon {
  position: absolute;
  right: 4rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  font-size: 1.2rem;
}

.search-input.valid ~ .input-status-icon.valid-icon {
  opacity: 1;
  color: #10b981;
}

.search-input.invalid ~ .input-status-icon.invalid-icon {
  opacity: 1;
  color: #ef4444;
}
