body {
  font-family: sans-serif;
  margin: 0;
  background-color: #f4f4f4;
  color: #333;
  transition: background-color 0.3s, color 0.3s;
}

body.dark-mode {
  background-color: #333;
  color: #f4f4f4;
}

header {
  background-color: #fff;
  padding: 1rem;
  text-align: center;
  border-bottom: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

body.dark-mode header {
  background-color: #444;
  border-bottom: 1px solid #555;
}

h1 {
  margin: 0;
  color: #e87a90;
}

main {
  padding: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.search-container {
  display: flex;
  margin-bottom: 1rem;
}

#search-input {
  flex-grow: 1;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #fff;
  color: #333;
}

body.dark-mode #search-input {
  background-color: #555;
  color: #f4f4f4;
  border-color: #666;
}

#search-button {
  background-color: #e87a90;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 0.5rem;
}

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

.cafe-card {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 1rem;
}

body.dark-mode .cafe-card {
  background-color: #444;
  border-color: #555;
}


.cafe-card h2 {
  margin-top: 0;
  color: #e87a90;
}

footer {
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
  font-size: 0.8rem;
  color: #777;
}

body.dark-mode footer {
  color: #aaa;
}

/* Theme Switch */
.theme-switch-container {
  display: flex;
  align-items: center;
}

.theme-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.theme-switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #e87a90;
}

input:focus + .slider {
  box-shadow: 0 0 1px #e87a90;
}

input:checked + .slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
}
