@import url("https://fonts.googleapis.com/css2?family=Tajawal&display=swap");
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Tajawal", sans-serif;
}
body {
  background: #f0f4f8;
  color: #333;
  transition: background 0.3s, color 0.3s;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.dark {
  background: #121212;
  color: #eee;
}

/* Navbar */
nav.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 30px;
  z-index: 1000;
  transition: background 0.3s;
}
body.dark nav.navbar {
  background: rgba(20, 20, 20, 0.9);
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
}
nav .logo {
  font-size: 1.6rem;
  font-weight: 700;
  color: #0077b6;
  cursor: default;
}
nav .lang-switcher button,
nav .toggle-dark {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1.3rem;
  margin-left: 12px;
  transition: color 0.3s;
  color: #0077b6;
}
body.dark nav .lang-switcher button,
body.dark nav .toggle-dark {
  color: #90caf9;
}
nav .lang-switcher {
  display: flex;
  align-items: center;
}

/* Hero */
header.hero {
  height: 100vh;
  background: url("https://images.unsplash.com/photo-1506744038136-46273834b3fb?auto=format&fit=crop&w=1600&q=80")
    no-repeat center/cover;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 20px;
  color: #fff;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.6);
}
body.dark header.hero {
  filter: brightness(0.7);
}
header.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 10px;
}
header.hero p {
  font-size: 1.5rem;
}

/* Search */
section.search-section {
  margin-top: -200px;
  padding: 20px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  z-index: 10;
  position: relative;
}
section.search-section input[type="text"],
section.search-section select,
section.search-section input[type="date"],
section.search-section button {
  padding: 12px 15px;
  border-radius: 8px;
  border: 1px solid #98e7ff;
  background: rgba(8, 4, 4, 0.1);
  font-size: 1rem;
  box-shadow: inset 0 2px 18px rgba(0, 225, 255, 0.5);
  min-width: 180px;
  transition: border-color 0.3s;
}
section.search-section input[type="text"]:focus,
section.search-section select:focus,
section.search-section input[type="date"]:focus {
  border-color: #0077b6;
  outline: none;
}
section.search-section input:hover,
button:hover,
select:hover {
  background-color: #6c9aff;
  color: blue;
}
section.search-section button {
  background: linear-gradient(45deg, #0077b6, #00b4d8);
  color: white;
  border: none;
  cursor: pointer;
  transition: background 0.3s;
  min-width: 120px;
}
section.search-section button:hover {
  background: #20b103;
  opacity: 0.5;
}

/* تفاصيل المكان */
.details-description {
  margin-top: 15px;
  line-height: 1.7;
  font-size: 1.05rem;
}

/* Upload */
#uploadInput {
  display: none;
}
label[for="uploadInput"] {
  padding: 12px 15px;
  background: rgba(0, 180, 216, 0.7);
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.3s;
  min-width: 120px;
  text-align: center;
}
label[for="uploadInput"]:hover {
  background: #0077b6;
}

/* Buttons Group */
.btn-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 10px;
  padding-top: 50px;
}
.btn-group button {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: rgba(0, 119, 182, 0.7);
  color: white;
  cursor: pointer;
  transition: background 0.3s;
  font-size: 1rem;
}
.btn-group button:hover {
  background: #00b4d8;
}

/* Results */
section.results {
  padding: 40px 20px 60px;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
article.card {
  background: white;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgb(0 0 0 / 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s;
  cursor: pointer;
  color: #333;
}
body.dark article.card {
  background: #222;
  color: #eee;
  box-shadow: 0 4px 15px rgb(255 255 255 / 0.1);
}
article.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.15);
}
article.card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-bottom: 1px solid #ddd;
  transition: filter 0.3s;
}
body.dark article.card img {
  filter: brightness(0.8);
  border-color: #444;
}
.card-body {
  padding: 15px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.card-body h3 {
  color: #0077b6;
  margin-bottom: 8px;
}
body.dark .card-body h3 {
  color: #90caf9;
}
.price {
  font-weight: bold;
  color: #00b894;
  margin: 8px 0;
}
.rating {
  color: #f1c40f;
  margin: 5px 0 12px;
}
button.btn {
  background: linear-gradient(45deg, #0077b6, #00b4d8);
  color: white;
  border: none;
  padding: 10px 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.3s;
}
button.btn:hover {
  background: linear-gradient(45deg, #005f7f, #0088b8);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
  z-index: 2000;
  padding: 20px;
  overflow-y: auto;
}
.modal.show {
  display: flex;
}
.modal-content {
  background: white;
  padding: 25px;
  border-radius: 15px;
  max-width: 400px;
  width: 100%;
  position: relative;
  box-shadow: 0 6px 15px rgb(0 0 0 / 0.2);
  color: #333;
}
article.card {
  min-height: 400px; /* ارتفاع ثابت */
}

.details-description {
  font-size: 0.9rem;
  line-height: 1.4;
  color: #555;
  margin: 8px 0;
  flex-grow: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2; 
  -webkit-box-orient: vertical;
}

body.dark .modal-content {
  background: #222;
  color: #eee;
  box-shadow: 0 6px 15px rgb(255 255 255 / 0.2);
}
.modal-content h2 {
  margin-bottom: 15px;
  color: #0077b6;
}
body.dark .modal-content h2 {
  color: #90caf9;
}
.modal-content input {
  width: 100%;
  padding: 10px;
  margin: 8px 0;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
}
body.dark .modal-content input {
  background: #333;
  border-color: #555;
  color: #eee;
}
.modal-content button {
  width: 100%;
  margin-top: 10px;
}
.close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 22px;
  cursor: pointer;
  color: #333;
  user-select: none;
  transition: color 0.3s;
}
body.dark .close {
  color: #eee;
}
.close:hover {
  color: #0077b6;
}

/* Footer */
footer.footer {
  margin-top: auto;
  background: #0077b6;
  color: white;
  text-align: center;
  padding: 20px 10px;
  font-size: 1rem;
  user-select: none;
}
footer.footer a {
  color: #aaddff;
  text-decoration: none;
  margin: 0 8px;
  transition: color 0.3s;
}
footer.footer a:hover {
  color: #d0f0ff;
}

/* Responsive */
@media (max-width: 992px) {
  section.results {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  header.hero h1 {
    font-size: 2.3rem;
  }
  header.hero p {
    font-size: 1.1rem;
  }
  nav.navbar {
    padding: 10px 20px;
  }
  section.search-section {
    flex-direction: column;
    align-items: center;
  }
  section.search-section input[type="text"],
  section.search-section select,
  section.search-section input[type="date"],
  section.search-section button,
  label[for="uploadInput"] {
    min-width: 100%;
  }
  .btn-group {
    justify-content: center;
  }
  section.results {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  section.results {
    grid-template-columns: 1fr !important;
  }
  article.card {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .modal-content {
    max-width: 90%;
    padding: 15px;
  }
  .card-body h3 {
    font-size: 1.1rem;
  }
  .card-body p {
    font-size: 0.95rem;
  }
  header.hero {
    height: 70vh;
  }
}
