@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  list-style: none;
  text-decoration: none;
}

:root {
  --primary-color: black;
  --secondary-color: white;
  --border-grey-color: #e9e9e9;
  --background-color: #f7f7f7;
  --arrow-color: #b3b3b3;
}

.main-header {
  padding-bottom: 10px;
}

#card-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 20px;
  margin: 20px auto;
  justify-items: center;
}

.card-content {
  padding: 20px;
  font-family: "Verdana";
  color: #777;
}

.card-content h2 {
  margin-top: 0;
  font-size: 20px;
}

.card img {
  width: 100%;
}

.footer {
  display: flex;
  justify-content: center;
  background-color: rgba(126, 208, 231, 0.941);
  padding: 10px;
  gap: 10px;
}

.navbar {
  display: flex;
  justify-content: space-between;
  /* gap: 2rem; */
  padding: 1rem;
  background-color: rgba(126, 208, 231, 0.941);
}

.nav-section {
  display: flex;
  gap: 0.5rem;
}

.button-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

#search-input {
  /* width: 100%; */
  padding: 0.5rem;
  border-radius: 10px;
  border: 1px solid #ccc;
}

.button {
  white-space: nowrap;
  /* width: fit-content; */
  /* flex: 1; */
}

select.button {
  padding-right: 2rem;
}

.navbar input[type="text"] {
  padding: 7px;
  font-size: 15px;
  width: 250px;
  border-radius: 8px;
  border: 1px solid #ccc;
  outline: none;
}

.container {
  padding: 15px max(15px, min(120px, 5vw));
}

button {
  font-size: small;
  color: var(--secondary-color);
  background-color: var(--primary-color);
  border: none;
  padding: 10px 10px;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
}

.button::before {
  content: "";
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  transform: scaleX(0);
  background-color: rgba(244, 242, 242, 0.2);
  transition: all 0.3s ease-in;
  transform-origin: left;
  border-radius: 10px;
}

.button:hover::before {
  transform: scaleX(1);
}

.card {
  width: 100%;
  max-width: 400px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
}

.card-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
}

.card-content {
  padding: 24px;
}

.location {
  color: #666;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}

.title-container {
  text-align: center;
  padding: 40px 20px;
  background: linear-gradient(rgba(126, 208, 231, 0.3), transparent);
}

.main-title {
  font-size: 3.5rem;
  color: #333;
  font-family: "Roboto", sans-serif;
  font-weight: 700;
  line-height: 1.2;
  max-width: 1200px;
  margin: 0 auto;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.title {
  font-size: 1.5rem;
  color: #333;
  margin: 10px auto;
}

.description {
  color: #666;
  margin-bottom: 16px;
  line-height: 1.5;
}

.stats {
  display: flex;
  justify-content: space-between;
  padding: 16px 0;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
  margin-bottom: 16px;
}

.stat {
  text-align: center;
}

.stat-value {
  font-size: 1.2rem;
  font-weight: bold;
  color: #333;
}

.stat-label {
  font-size: 0.8rem;
  color: #666;
  margin-top: 4px;
}

.comments {
  margin-top: 16px;
}

.comment {
  background: #f8f9fa;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: #555;
}

.category-tag {
  display: inline-block;
  padding: 6px 12px;
  background: #e3f2fd;
  color: #1976d2;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 16px;
}

.control-bar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  margin: 15% auto;
  padding: 20px;
  width: 80%;
  max-width: 500px;
  position: relative;
  top: -20%;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: black;
}

#addPlaceForm {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 20px;
}

#addPlaceForm input,
#addPlaceForm textarea {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
}

#addPlaceForm textarea {
  min-height: 100px;
  resize: vertical;
}

.dropdown select {
  padding: 8px 15px;
  cursor: pointer;
  background-color: var(--primary-color);
  color: var(--secondary-color);
  border: none;
  border-radius: 10px;
  font-size: small;
}

.dropdown select:focus {
  outline: none;
}

.dropdown select option {
  background-color: white;
  color: black;
}

.card-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.card-actions .button {
  flex: 1;
}

.scale-down-center {
  -webkit-animation: scale-down-center 0.6s
    cubic-bezier(0.55, 0.085, 0.68, 0.53) reverse backwards;
  animation: scale-down-center 0.6s cubic-bezier(0.55, 0.085, 0.68, 0.53)
    reverse backwards;
}

@-webkit-keyframes scale-down-center {
  0% {
    -webkit-transform: scale(1);
    transform: scale(1);
  }
  100% {
    -webkit-transform: scale(0.5);
    transform: scale(0.5);
  }
}

@keyframes scale-down-center {
  0% {
    -webkit-transform: scale(1);
    transform: scale(1);
  }
  100% {
    -webkit-transform: scale(0.5);
    transform: scale(0.5);
  }
}

/* Custom select styling */
select.button {
  appearance: none;
  background-color: #ffffff;
  border: 2px solid #68ecf8;
  border-radius: 8px;
  padding: 8px 32px 8px 16px;
  font-size: 14px;
  cursor: pointer;
  color: #2c3e50;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2012%2012%22%3E%3Ctitle%3Edown-arrow%3C%2Ftitle%3E%3Cg%20fill%3D%22%23000000%22%3E%3Cpath%20d%3D%22M10.293%2C3.293%2C6%2C7.586%2C1.707%2C3.293A1%2C1%2C0%2C0%2C0%2C.293%2C4.707l5%2C5a1%2C1%2C0%2C0%2C0%2C1.414%2C0l5-5a1%2C1%2C0%2C1%2C0-1.414-1.414Z%22%20fill%3D%22%23000000%22%3E%3C%2Fpath%3E%3C%2Fg%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 12px top 50%;
  background-size: 12px auto;
  transition: all 0.3s ease;
}

select.button:hover {
  background-color: #f8f9fa;
  border-color: #52bfcb;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

select.button:focus {
  outline: none;
  border-color: #8ad5ee;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

select.button option {
  padding: 12px;
  background-color: #ffffff;
  color: #2c3e50;
}

select.button option:hover {
  background-color: #f8f9fa;
}

/* Responsive breakpoints */

@media (max-width: 1024px) {
  .navbar .nav-section:nth-of-type(1) {
    flex-direction: column;
  }
  #search-input {
    width: 100%;
  }
  .navbar .nav-section:nth-of-type(2) {
    flex-direction: column;
  }
  .main-title {
    font-size: 2.5rem;
  }

  #card-container {
    margin-top: -20px;
  }
  .modal-content {
    top: -12%;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 15px;
  }
  #card-container {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

/* For very small screens */
@media (max-width: 425px) {
  .modal-content {
    top: -2%;
  }
  #card-container {
    display: grid;
    grid-template-columns: 1fr; /* Single column for mobile */
  }

  .card {
    max-width: 100%; /* Allow cards to take full width */
    width: 100%;
  }

  .main-title {
    font-size: 1.8rem;
  }

  .navbar {
    flex-direction: column-reverse;
    align-items: center;
    gap: 10px;
  }

  .button-group {
    width: 100%;
  }

  select.button,
  .button {
    width: 100%;
    text-align: center;
  }
}
