* {
  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;
  color: #1a1a2e;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 3rem;
}

.random-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.6rem 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.random-link:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

main {
  flex: 1;
}

.search-section {
  text-align: center;
  margin-bottom: 2.5rem;
}

.title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
}

.subtitle {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.1rem;
  margin-bottom: 2rem;
  font-weight: 400;
}

.search-form {
  max-width: 600px;
  margin: 0 auto;
}

.search-bar {
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: 50px;
  padding: 0.4rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transition: box-shadow 0.3s ease;
}

.search-bar:focus-within {
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.search-icon {
  color: #9ca3af;
  margin-left: 1rem;
  flex-shrink: 0;
}

#input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  color: #1a1a2e;
  background: transparent;
  min-width: 0;
}

#input::placeholder {
  color: #9ca3af;
}

.search-button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  border: none;
  border-radius: 50px;
  padding: 0.8rem 1.8rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.search-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.search-button:active {
  transform: translateY(0);
}

.results {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.result-card {
  display: block;
  background: #ffffff;
  border-radius: 12px;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border-left: 4px solid transparent;
}

.result-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border-left-color: #667eea;
}

.result-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 0.5rem;
  text-transform: capitalize;
}

.result-snippet {
  color: #4b5563;
  font-size: 0.95rem;
  line-height: 1.6;
}

.loading,
.empty-state {
  text-align: center;
  color: #ffffff;
  font-size: 1.1rem;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

footer {
  text-align: center;
  margin-top: 3rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

footer a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  transition: border-color 0.3s ease;
}

footer a:hover {
  border-bottom-color: #ffffff;
}

@media (max-width: 600px) {
  .title {
    font-size: 2rem;
  }

  .search-bar {
    flex-direction: column;
    border-radius: 20px;
    padding: 1rem;
    gap: 0.8rem;
  }

  .search-icon {
    display: none;
  }

  #input {
    width: 100%;
    text-align: center;
    padding: 0.6rem;
  }

  .search-button {
    width: 100%;
  }
}
