/* === Reset CSS === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* === Global Styles === */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
}

.container {
  max-width: 1200px;
  margin: auto;
  padding: 0 20px;
}

/* === Header === */
header {
  background-color: #0b3d91;
  color: #fff;
  padding: 15px 0;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav a {
  margin-left: 20px;
  color: #fff;
  font-weight: 500;
  transition: color 0.3s;
}

nav a:hover {
  color: #f4c542;
}

/* === Hero Section === */
.hero {
  background: url('/images/hero.jpg') center/cover no-repeat; /* Ensure path is correct */
  color: #fff;
  text-align: center;
  padding: 80px 20px;
  position: relative;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 20px;
}

.hero-subtitle {
  font-size: 1.2rem;
  margin-top: 10px;
}

.search-bar {
  background-color: rgba(255, 255, 255, 0.95);
  padding: 20px;
  border-radius: 10px;
  max-width: 900px;
  margin: 20px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.search-bar input,
.search-bar select,
.search-bar button {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.search-bar button {
  background-color: #f4c542;
  color: #000;
  cursor: pointer;
  font-weight: bold;
  border: none;
  transition: background-color 0.3s;
}

.search-bar button:hover {
  background-color: #e5b000;
}

/* === Property Cards === */
.properties {
  padding: 40px 20px;
}

.properties h2 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 2rem;
  color: #0b3d91;
}

.property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.property-card {
  background-color: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
}

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

.property-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.property-card .info {
  padding: 15px;
}

.property-card h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.property-card p {
  color: #666;
  font-size: 0.9rem;
}

/* === Welcome Section === */
.welcome-section {
  padding: 40px 20px;
  background-color: #ffffff;
  text-align: center;
}

.welcome-section h2 {
  font-size: 2rem;
  color: #0b3d91;
  margin-bottom: 30px;
}

.services-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.service-box {
  background-color: #f5f5f5;
  border-radius: 10px;
  padding: 20px;
  width: 280px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.3s;
}

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

.service-box h3 {
  color: #f4c542;
  margin-bottom: 10px;
}

/* === Form Sections (Login, Register, Profile, Publish) === */
.login-section,
.register-section,
.profile-section,
.publish-section {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 50px 20px;
  background-color: #f9f9f9;
  min-height: 80vh;
}

.login-container,
.register-container,
.profile-container,
.publish-section .container {
  background-color: #ffffff;
  padding: 30px;
  max-width: 400px;
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 0 12px rgba(0,0,0,0.1);
  text-align: center;
}

.publish-section .container {
  max-width: 700px;
  padding: 30px 40px;
}

.login-container h2,
.register-container h2,
.profile-container h2,
.profile-container h3,
.publish-section h2 {
  text-align: center;
  margin-bottom: 20px;
  color: #0b3d91;
}

.profile-container h2, .profile-container h3 {
  color: #2c3e50; /* Specific color for profile titles */
}

.login-form,
.register-form,
.profile-form,
.publish-form {
  display: flex;
  flex-direction: column;
}

.login-form label,
.register-form label,
.profile-form label,
.publish-form label {
  text-align: left;
  margin-bottom: 5px;
  color: #333;
  margin-top: 15px;
  font-weight: 600;
}

.login-form input,
.register-form input,
.profile-form input,
.profile-form textarea,
.publish-form input[type="text"],
.publish-form input[type="number"],
.publish-form select,
.publish-form textarea,
.publish-form input[type="file"] {
  width: 100%;
  padding: 10px;
  margin-bottom: 20px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
}

.login-form input:focus,
.register-form input:focus,
.profile-form input:focus,
.profile-form textarea:focus,
.publish-form input[type="text"]:focus,
.publish-form input[type="number"]:focus,
.publish-form select:focus,
.publish-form textarea:focus,
.publish-form input[type="file"]:focus {
  border-color: #007bff;
  outline: none;
}

.profile-form textarea,
.publish-form textarea {
  resize: vertical;
  min-height: 80px;
}

.login-form button,
.register-form button,
.profile-form button,
.publish-form button {
  padding: 12px;
  background-color: #0b3d91;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.3s;
  width: 100%;
  margin-top: 20px;
}

.profile-form button {
  background-color: #27ae60;
}

.publish-form button {
  background-color: #007bff;
}

.login-form button:hover,
.register-form button:hover {
  background-color: #092e70;
}

.profile-form button:hover {
  background-color: #219150;
}

.publish-form button:hover {
  background-color: #0056b3;
}

/* === Global Messages (Error/Success) === */
.error-message {
  color: #d9534f;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  padding: 10px 15px;
  border-radius: 5px;
  margin-bottom: 15px;
  font-weight: bold;
}

.success-message {
  color: #155724;
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  padding: 10px 15px;
  border-radius: 5px;
  margin-bottom: 15px;
  font-weight: bold;
}

.register-link,
.login-link {
  margin-top: 15px;
  font-size: 0.9rem;
}

.register-link a,
.login-link a {
  color: #0b3d91;
  text-decoration: none;
}

.register-link a:hover,
.login-link a:hover {
  text-decoration: underline;
}

.profil-apercu {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin: 10px auto;
  display: block;
}

/* === Dashboard Section === */
.dashboard-section {
  padding: 40px 20px;
  background-color: #f9f9f9;
}

.dashboard-container {
  max-width: 1200px;
  margin: auto;
}

.dashboard-container h2 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 2em;
  color: #333;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.dashboard-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  text-align: center;
  transition: transform 0.2s ease;
}

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

.dashboard-card h3 {
  margin-bottom: 10px;
  color: #2c3e50;
}

.dashboard-card p {
  font-size: 0.95em;
  color: #666;
  margin-bottom: 15px;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  background-color: #2e86de;
  color: white;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.3s ease;
}

.btn:hover {
  background-color: #1e6fc1;
}

.btn.danger {
  background-color: #e74c3c;
}

.btn.danger:hover {
  background-color: #c0392b;
}

/* === Mes annonces - section === */
.mes-annonces-section {
  padding: 40px 20px;
  background-color: #f9f9f9;
  min-height: 80vh;
}

.mes-annonces-section h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 30px;
  color: #333;
}

.annonces-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 25px;
  max-width: 1200px;
  margin: 0 auto;
}

.annonce-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.annonce-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.annonce-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid #eee;
}

.annonce-image.placeholder {
  height: 200px;
  background: #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-style: italic;
  font-size: 1rem;
}

.annonce-info {
  padding: 20px 25px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.annonce-info h3 {
  margin: 0 0 12px 0;
  font-size: 1.5rem;
  color: #222;
  line-height: 1.2;
}

.annonce-info p {
  margin: 6px 0;
  color: #555;
  font-size: 1rem;
}

.annonce-info p strong {
  color: #333;
}

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

.btn-edit,
.btn-delete {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
  text-decoration: none;
  color: #fff;
  user-select: none;
}

.btn-edit {
  background-color: #4caf50;
}

.btn-edit:hover {
  background-color: #45a047;
}

.btn-delete {
  background-color: #e53935;
}

.btn-delete:hover {
  background-color: #d32f2f;
}

.mes-annonces-section p a.btn-primary {
  display: inline-block;
  padding: 12px 25px;
  background-color: #1976d2;
  color: #fff;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.mes-annonces-section p a.btn-primary:hover {
  background-color: #115293;
}

/* === Search and Listings === */
.search-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
  align-items: end;
}

.search-form input,
.search-form select,
.search-form button {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
}

.search-form button {
  background-color: #007bff;
  color: white;
  border: none;
  cursor: pointer;
}

.biens-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.bien-card {
  border: 1px solid #ddd;
  border-radius: 10px;
  overflow: hidden;
  background: white;
  display: flex;
  flex-direction: column;
}

.bien-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.bien-info {
  padding: 1rem;
}

.bien-info h3 {
  margin: 0.5rem 0;
}

.bien-info .btn {
  margin-top: 0.5rem;
  display: inline-block;
  background: #28a745;
  color: white;
  padding: 8px 12px;
  text-decoration: none;
  border-radius: 6px;
}

/* === Property Details Section === */
.details-section {
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 2rem;
}

.details-info {
  margin-top: 1rem;
  padding: 1.5rem;
  background: #f9f9f9;
  border-radius: 10px;
  line-height: 1.6;
  box-shadow: 0 1px 5px rgba(0,0,0,0.05);
}

.details-info p {
  margin: 0.5rem 0;
}

.details-date {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #777;
}

/* === Carousel === */
.carousel-wrapper {
  position: relative;
  overflow: hidden;
  margin: 1rem auto;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  max-width: 100%;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
}

.carousel-slide,
.carousel-item {
  min-width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
}

.carousel-slide img,
.carousel-item img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  display: block;
  border-radius: 10px;
  cursor: zoom-in;
  transition: transform 0.3s ease;
}

.carousel-slide img:hover,
.carousel-item img:hover {
  transform: scale(1.01);
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  font-size: 2rem;
  padding: 0.5rem;
  cursor: pointer;
  z-index: 2;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.carousel-btn:hover {
  background-color: rgba(0, 0, 0, 0.7);
}

.carousel-btn.prev,
.carousel-btn.left {
  left: 10px;
}

.carousel-btn.next,
.carousel-btn.right {
  right: 10px;
}

/* === Lightbox Zoom Image === */
.lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  cursor: zoom-out;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
  transition: transform 0.3s ease;
}

/* === Contact Section === */
.contact-section {
  background-color: #f8f9fa;
  padding: 2rem 1rem;
}

.contact-form {
  max-width: 600px;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form input,
.contact-form textarea {
  padding: 0.8rem;
  border: 1px solid #ccc;
  border-radius: 8px;
}

.contact-form button {
  background-color: #007bff;
  color: #fff;
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s ease;
}

.contact-form button:hover {
  background-color: #0056b3;
}

.interet-form input {
  width: 100%;
  padding: 0.7rem;
  margin: 0.5rem 0;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.interet-form button {
  background-color: #007bff;
  color: white;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.contact-admin {
  margin-top: 2rem;
}

/* === Responsive Media Queries === */

/* Tablets and smaller desktops */
@media (max-width: 768px) {
  header .container {
    flex-direction: column;
    text-align: center;
  }

  nav {
    margin-top: 10px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .search-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-bar input,
  .search-bar select,
  .search-bar button {
    width: 100%;
  }

  .services-grid {
    flex-direction: column;
    align-items: center;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .login-container,
  .register-container,
  .profile-container,
  .publish-section .container {
    padding: 25px;
  }
}

/* Mobile devices */
@media (max-width: 500px) {
  .container {
    padding: 0 15px;
  }

  .hero {
    padding: 60px 15px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .properties,
  .welcome-section,
  .mes-annonces-section,
  .dashboard-section {
    padding: 30px 15px;
  }

  .property-grid,
  .annonces-list,
  .biens-grid {
    grid-template-columns: 1fr;
  }

  .annonce-info h3 {
    font-size: 1.25rem;
  }

  .annonce-info p {
    font-size: 0.9rem;
  }

  .annonce-actions {
    flex-direction: column;
  }

  .btn-edit,
  .btn-delete {
    width: 100%;
  }

  .publish-section .container {
    padding: 20px 20px;
  }

  .publish-form button {
    font-size: 16px;
    padding: 12px 0;
  }

  .search-form {
    grid-template-columns: 1fr;
  }

  .carousel-slide img,
  .carousel-item img {
    height: 300px;
  }
}

/* Very small screens (optional, for finer control) */
@media (max-width: 375px) {
  .hero h1 {
    font-size: 1.5rem;
  }
  .hero-subtitle {
    font-size: 0.9rem;
  }
}