/* Reset e configurações base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  line-height: 1.6;
  color: #333;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  background: #ffffff;
  min-height: 100vh;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
  position: relative;
}

/* Header */
.header {
  background: linear-gradient(135deg, #00304e 0%, #069a8e 100%);
  color: white;
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.header::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(180deg);
  }
}

.header-content {
  position: relative;
  z-index: 2;
}

.header-logo {
  margin-bottom: 1rem;
}

.logo-img {
  max-height: 60px;
  max-width: 200px;
  height: auto;
  width: auto;
  opacity: 0.95;
  filter: brightness(1.1);
}

.header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header p {
  font-size: 0.95rem;
  opacity: 0.9;
  font-weight: 300;
}

/* Search Container */
.search-container {
  padding: 1.5rem 1.5rem 0;
  background: #ffffff;
  margin-top: -0.5rem;
  border-radius: 1rem 1rem 0 0;
  position: relative;
  z-index: 3;
}

.search-form {
  position: relative;
}

.search-input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 1rem;
  color: #9ca3af;
  font-size: 1rem;
  z-index: 2;
}

.search-input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.75rem;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #f9fafb;
  font-family: inherit;
}

.search-input:focus {
  outline: none;
  border-color: #069a8e;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(6, 154, 142, 0.1);
}

.clear-search {
  position: absolute;
  right: 1rem;
  color: #9ca3af;
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.2s ease;
}

.clear-search:hover {
  color: #ef4444;
}

/* Search Instructions */
.search-instructions {
  padding: 2rem 1.5rem;
  text-align: center;
  color: #374151;
}

.instruction-icon {
  font-size: 2.5rem;
  color: #069a8e;
  margin-bottom: 1rem;
}

.search-instructions h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #1f2937;
}

.search-instructions p {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 0.5rem;
  color: #6b7280;
}

/* Search Warning */
.search-warning {
  padding: 1rem 1.5rem;
  background: #fef3cd;
  color: #92400e;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-left: 4px solid #f59e0b;
  margin: 0 1.5rem;
  border-radius: 0 0.5rem 0.5rem 0;
}

/* Search Results Info */
.search-results-info {
  padding: 1rem 1.5rem;
  background: #ecfdf5;
  color: #065f46;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-left: 4px solid #069a8e;
  margin: 0 1.5rem;
  border-radius: 0 0.5rem 0.5rem 0;
}

/* Moradores Container */
.moradores-container {
  padding: 1rem 1.5rem 2rem;
  flex: 1;
}

/* Address Group */
.address-group {
  margin-bottom: 2rem;
}

.address-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  border-radius: 0.75rem;
  margin-bottom: 1rem;
  font-weight: 500;
  color: #374151;
  font-size: 0.95rem;
  border: 1px solid #d1d5db;
}

.address-header i {
  color: #6b7280;
  font-size: 1.1rem;
}

/* Morador Card */
.morador-card {
  background: #ffffff;
  border-radius: 1rem;
  padding: 1.25rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #f1f5f9;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  transition: all 0.3s ease;
}

.morador-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border-color: #e2e8f0;
}

.morador-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.morador-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #e6fffa 0%, #b2f5ea 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #00304e;
  flex-shrink: 0;
}

.morador-details {
  flex: 1;
  min-width: 0;
}

.morador-nome {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.25rem;
  word-wrap: break-word;
  word-break: break-word;
  line-height: 1.3;
  max-width: 100%;
}

.morador-telefone {
  font-size: 0.9rem;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.morador-telefone i {
  font-size: 0.8rem;
  color: #9ca3af;
}

/* WhatsApp Button */
.whatsapp-btn {
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: white;
  text-decoration: none;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
  flex-shrink: 0;
  align-self: flex-start;
  min-width: fit-content;
}

.whatsapp-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
}

.whatsapp-btn:active {
  transform: translateY(0);
}

.whatsapp-btn i {
  font-size: 1.1rem;
}

.whatsapp-btn span {
  display: none;
}

/* Welcome State */
.welcome-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #6b7280;
}

.welcome-icon {
  font-size: 4rem;
  color: #069a8e;
  margin-bottom: 1.5rem;
  opacity: 0.8;
}

.welcome-state h3 {
  font-size: 1.5rem;
  color: #00304e;
  margin-bottom: 1rem;
  font-weight: 600;
}

.welcome-state p {
  font-size: 1rem;
  line-height: 1.6;
  color: #6b7280;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #6b7280;
}

.empty-icon {
  font-size: 4rem;
  color: #d1d5db;
  margin-bottom: 1.5rem;
}

.empty-state h3 {
  font-size: 1.25rem;
  color: #374151;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.empty-state p {
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Quick Actions */
.quick-actions {
  padding: 1rem 1.5rem;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.admin-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  text-decoration: none;
  color: #374151;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.admin-link:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

/* Footer */
.footer {
  background: #f8fafc;
  padding: 1.5rem;
  text-align: center;
  color: #6b7280;
  font-size: 0.85rem;
  border-top: 1px solid #e2e8f0;
}

.footer p {
  margin-bottom: 0.25rem;
}

.footer i {
  color: #ef4444;
  font-size: 0.8rem;
}

/* Media Queries */
@media (max-width: 399px) {
  .morador-card {
    padding: 1rem;
  }

  .morador-info {
    min-width: 0;
    flex: 1;
  }

  .morador-details {
    min-width: 0;
  }

  .morador-nome {
    font-size: 1rem;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
  }

  .whatsapp-btn {
    padding: 0.6rem 0.8rem;
    font-size: 0.8rem;
  }
}

@media (min-width: 400px) {
  .whatsapp-btn span {
    display: inline;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 600px;
  }

  .header {
    padding: 2.5rem 2rem 2rem;
  }

  .search-container {
    padding: 2rem 2rem 0;
  }

  .moradores-container {
    padding: 1.5rem 2rem 2.5rem;
  }

  .search-results-info {
    margin: 0 2rem;
  }

  .quick-actions {
    padding: 1.5rem 2rem;
  }

  .footer {
    padding: 2rem;
  }
}

/* Animações para carregamento */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.morador-card {
  animation: fadeInUp 0.6s ease forwards;
}

.morador-card:nth-child(2) {
  animation-delay: 0.1s;
}
.morador-card:nth-child(3) {
  animation-delay: 0.2s;
}
.morador-card:nth-child(4) {
  animation-delay: 0.3s;
}
.morador-card:nth-child(5) {
  animation-delay: 0.4s;
}

/* Loading state */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid #e5e7eb;
  border-top: 3px solid #4f46e5;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
