/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

/* Center whole app */
body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #f3f4f6;
}

/* Main container */
main {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.heading {
  text-align: center;
  margin-bottom: 18px;
  font-size: 22px;
  font-weight: 600;
  color: #1f2937;
  text-transform: uppercase;
}

/* Input + button */
.inpt-container {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

/* Input */
.inpt-container input {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  outline: none;
}

.inpt-container input:focus {
  border-color: #2563eb;
}

/* Button */
#searchBtn {
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: #2563eb;
  color: white;
  cursor: pointer;
  transition: 0.2s;
}

#searchBtn:hover {
  background: #1d4ed8;
}

/* Result card */
.result-container {
  margin-top: 10px;
}

/* Profile card */
.card {
  text-align: center;
}

.card img {
  width: 100px;
  border-radius: 50%;
  margin-bottom: 10px;
}

.card h2 {
  font-size: 18px;
  margin-bottom: 5px;
}

.card p {
  font-size: 14px;
  color: #6b7280;
}

.stats {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  gap: 10px;
}

.stats div {
  flex: 1;
  text-align: center;
  padding: 6px;
  border-radius: 8px;
  background: #f9fafb;
}

/* Number */
.stat-number {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: #111827;
}

/* Label */
.stat-label {
  font-size: 13px;
  color: #6b7280;
  display: block;
  margin-top: 3px;
}

.message-container {
  margin-top: 15px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
  display: none;
}

/* Error  */
.message-container.error {
  background-color: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/*  Loading  */
.message-container.loading {
  background-color: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

/* Responsive  */

/* Small devices (phones) */

@media (max-width: 380px) {
  .stats {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px;
    align-items: flex-start;
  }

  main {
    max-width: 100%;
    padding: 15px;
    border-radius: 10px;
  }

  .heading {
    font-size: 18px;
  }

  .inpt-container {
    flex-direction: column;
  }

  #searchBtn {
    width: 100%;
  }

  .card img {
    width: 80px;
  }

  @media (max-width: 480px) {
    .stats {
      flex-direction: row; /* keep row */
      gap: 6px;
    }

    .stat-number {
      font-size: 14px;
    }

    .stat-label {
      font-size: 11px;
    }
  }
}

/* Tablets */
@media (min-width: 481px) and (max-width: 768px) {
  main {
    max-width: 500px;
  }

  .card img {
    width: 90px;
  }
}
