/* Hero Section for Find Professional Page */
.find-professional-hero {
  background: linear-gradient(rgba(150, 150, 150, 0.5), rgba(0, 0, 0, 0.5)),
    url("/assets/professionalHeroPhoto.jpeg") no-repeat top center/cover;
  color: var(--light-text-color);
  text-align: center;
  padding: 60px 15px;
}

.find-professional-hero h1 {
  color: var(--light-text-color);
  font-size: 2.2em;
  margin-bottom: 15px;
  font-weight: 700;
}

span {
  color: var(--secondary-color);
}

.find-professional-hero p {
  font-size: 1.1em;
  max-width: 600px;
  margin: 0 auto;
}

/* Search and Filter Section */
.search-filter-section {
  padding: 40px;
  text-align: center;
  background-color: var(--card-background);
}

.search-filter-section h2 {
  margin-bottom: 30px;
  color: var(--text-color);
  font-weight: 600;
}

.search-form-grid {
  display: flex;
  flex-direction: column; /* Stack form groups on mobile */
  gap: 20px; /* Space between form groups */
  max-width: 500px; /* Limit width of form on mobile */
  margin: 0 auto;
}

.form-group {
  text-align: left; /* Align labels/inputs */
}

.form-group label {
  display: block; /* Make labels block-level */
  margin-bottom: 8px;
  font-weight: bold;
  color: var(--text-color);
}

.form-group input[type="text"],
.form-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  font-size: 1em;
  font-family: var(--font-family-primary); /* Inherit font */
}

.search-buttons {
  display: flex;
  flex-direction: column; /* Stack buttons on mobile */
  gap: 10px;
  margin-top: 10px;
}

.search-buttons .btn {
  width: 100%; /* Full width for buttons */
}

/* Professional Listings Section */
.professional-listings-section {
  padding: 40px 0;
  background-color: var(--background-light);
  text-align: center;
}

.professional-listings-section h2 {
  margin-bottom: 30px;
  color: var(--text-color);
}

.professional-grid,
.inhouse-container {
  display: flex;
  flex-direction: column; /* Stack cards on mobile */
  gap: 25px; /* Space between cards */
  margin-top: 30px;
}

.professional-card,
.inhouse-card {
  background-color: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 25px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  text-align: center; /* Center content in card */
  display: flex;
  flex-direction: column;
  align-items: center; /* Center items vertically within the flex column */
  justify-content: space-between;
  height: 100%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: default;
}

.inhouse-card:hover,
.professional-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.card-buttons {
  display: flex;
  flex-direction: column; /* Stack buttons on mobile by default */
  margin-top: 20px; /* Space above buttons */
  width: 100%; /* Occupy full width within the card */
}

.card-buttons .btn {
  width: 100%; /* Make buttons full width on mobile */
  flex-grow: 1; /* Allows them to grow evenly if in a row (for larger screens) */
}

.inhouse-card .prof-photo,
.professional-card .prof-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 15px;
  border: 3px solid var(--primary-color);
}

.inhouse-card h3,
.professional-card h3 {
  margin-bottom: 5px;
  color: var(--text-color);
  font-weight: 500;
}

.inhouse-card .prof-title,
.professional-card .prof-title {
  font-style: italic;
  color: #666;
  margin-bottom: 10px;
}

.inhouse-card .prof-specs,
.inhouse-card .prof-location,
.professional-card .prof-specs,
.professional-card .prof-location {
  font-size: 0.9em;
  color: #555;
  margin-bottom: 8px;
  display: flex; /* For icon and text alignment */
  align-items: center;
  justify-content: center; /* Center text and icon */
  text-align: center;
  max-width: 100%; /* Prevent overflow on small screens */
  word-wrap: break-word; /* Allow long words to break */
  font-weight: 500;
}

.inhouse-card .prof-specs i,
.inhouse-card .prof-location i,
.professional-card .prof-specs i,
.professional-card .prof-location i {
  margin-right: 8px;
  color: var(--primary-color);
  font-size: 1.1em;
}

.inhouse-card .btn-sm,
.professional-card .btn-sm {
  padding: 8px 20px; /* Smaller button for cards */
  font-size: 0.9em;
  margin-top: 15px;
  width: auto; /* Allow it to size to content */
}

.whatsapp-text {
  font-weight: 700;
  color: var(--primary-color);
}

.initial-prompt {
  margin-top: 2rem;
}

.dynamic-message-area {
  width: 90%;
  margin: 0 auto;
}

.quote-text,
.quote-author {
  font-size: 1.3rem;
}

.quote-text {
  color: var(--primary-color);
  font-weight: 600;
}

.quote-author {
  color: var(--text-color);
}

.no-results {
  text-align: center;
  font-style: normal;
  font-weight: bold;
  color: var(--text-color); /* Stronger text color */
  background-color: rgba(
    255,
    193,
    7,
    0.1
  ); /* Very light accent yellow for a soft alert */
  /* Alternative if you prefer a subtle green: background-color: rgba(76, 175, 80, 0.1); */

  padding: 20px; /* Base padding for mobile */
  margin-top: 40px;
  border: 1px solid var(--accent-color); /* Border with accent color */
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);

  display: flex; /* Use flexbox to align content (icon + text) */
  flex-direction: column; /* Stack icon and text vertically on mobile */
  align-items: center; /* Center horizontally in the column */
  justify-content: center;
  gap: 10px; /* Space between icon and text */
  font-size: 0.95em;
}

.no-results::before {
  content: "\f05a"; /* Unicode for info-circle icon from Font Awesome */
  font-family: "Font Awesome 6 Free"; /* Ensure Font Awesome font is used */
  font-weight: 900; /* Use solid icon weight */
  font-size: 1.5em; /* Icon size for mobile */
  color: var(--accent-color); /* Icon color */
}

/* Loading Indicator */
.loading-indicator {
  text-align: center;
  padding: 20px;
  margin-top: 30px; /* Space from heading */
  margin-bottom: 30px; /* Space from grid */
  font-size: 1.1em;
  font-weight: bold;
  color: var(--secondary-color); /* Use a complementary color */
  background-color: var(--background-light); /* Or a very light background */
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex; /* Use flex to center icon and text */
  align-items: center;
  justify-content: center;
  gap: 15px; /* Space between icon and text */
  transition: opacity 0.3s ease; /* Smooth fade in/out */
}

.loading-indicator i {
  font-size: 1.8em; /* Size of the spinner icon */
  color: var(--secondary-color);
}

/* For smaller screens, adjust if needed (mobile-first) */
@media (max-width: 575px) {
  .loading-indicator {
    font-size: 1em;
    padding: 15px;
  }
  .loading-indicator i {
    font-size: 1.5em;
  }
}

/*MODALS CSS*/
/* --- Modal Styles --- */

.modal-overlay {
  display: none; /* Hidden by default */
  position: fixed; /* Stays in place even when scrolling */
  z-index: 1000; /* High z-index to appear on top of everything */
  left: 0;
  top: 0;
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  overflow: auto; /* Enable scroll if content is too long */
  background-color: rgba(
    0,
    0,
    0,
    0.6
  ); /* Black w/ opacity - the overlay effect */
  backdrop-filter: blur(
    5px
  ); /* Optional: A subtle blur effect behind the modal */
  padding: 20px; /* Padding around the content, for mobile spacing */
  box-sizing: border-box; /* Include padding in element's total width and height */

  /* For smooth fade-in/out */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: var(white);
  margin: 40px auto;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  position: relative;
  max-width: 90%;
  width: 400px;
  box-sizing: border-box;
  transform: translateY(-20px);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
  opacity: 1;
}

.close-modal-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  color: var(--text-color);
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  line-height: 1; /* Ensures 'x' is centered vertically */
}

.close-modal-btn:hover,
.close-modal-btn:focus {
  color: var(--accent-color);
}

.modal-content h2 {
  font-size: 1.5em; /* Smaller heading for mobile */
  color: var(--primary-color);
  margin-bottom: 5px;
}

.modal-content h2 span#professionalNameInModal {
  color: var(--secondary-color); /* Highlight the professional's name */
}

.modal-intro-text {
  font-size: 0.9em;
  color: var(--text-color);
  margin-bottom: 5px;
}

/* Form Group within Modal */
.booking-form .form-group {
  margin-bottom: 5px;
  text-align: left; /* Align labels/inputs left within the form */
}

.booking-form label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: var(--text-color);
  font-size: 0.9em; /* Smaller label font */
}

.booking-form input[type="text"],
.booking-form input[type="email"],
.booking-form input[type="tel"],
.booking-form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  box-sizing: border-box; /* Crucial for width: 100% with padding */
  font-size: 1em;
  font-family: inherit; /* Use page font */
}

.booking-form textarea {
  resize: vertical; /* Allow vertical resizing only */
  min-height: 80px;
}

.booking-form input:focus,
.booking-form textarea:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.2); /* Example with RGB variable */
}

.booking-form .btn-primary {
  width: 100%; /* Full width submit button on mobile */
  margin-top: 20px;
  padding: 12px 20px; /* Adjust padding if needed */
}

/* --- Find Professional Page Specific Media Queries for Larger Screens (Mobile-First) --- */

@media (min-width: 576px) {
  .find-professional-hero h1 {
    font-size: 2.5em;
  }

  .search-form-grid {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 700px;
  }
  .form-group {
    flex: 1 1 calc(50% - 20px);
    max-width: calc(50% - 20px);
  }
  .search-buttons {
    flex-direction: row;
    justify-content: center;
    flex: 1 1 100%;
    margin-top: 20px;
  }
  .search-buttons .btn {
    width: auto;
    min-width: 160px;
    margin: 0 5px;
  }

  /* Professional cards: 2 columns */
  .inhouse-container,
  .professional-grid {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
  }

  .inhouse-container {
    margin-bottom: 40px;
  }

  .professional-card {
    flex: 1 1 calc(50% - 30px);
    max-width: calc(50% - 30px);
  }

  .initial-prompt {
    margin: 0, 0, 20px, 0;
  }

  /*MODALS*/
  .modal-content {
    max-width: 500px; /* Wider for tablets */
    padding: 30px;
  }
  .modal-content h2 {
    font-size: 1.7em;
  }
  .booking-form label {
    font-size: 1em;
  }
  .booking-form .btn-primary {
    width: auto; /* Button can be smaller than full width */
    min-width: 200px; /* Example min width */
  }
}

/* Medium Devices / Tablets (e.g., min-width 768px) */
@media (min-width: 768px) {
  .find-professional-hero {
    padding: 80px 20px;
  }
  .find-professional-hero h1 {
    font-size: 3em;
  }

  .search-filter-section h2,
  .professional-listings-section h2 {
    font-size: 2.2em;
  }

  .search-form-grid {
    flex-wrap: nowrap;
  }
  .form-group {
    flex: 1;
    max-width: none;
  }
  .search-buttons {
    flex: 0 0 auto;
    margin-top: 0;
    margin-left: 20px;
    align-items: center;
  }
  .search-buttons .btn {
    width: auto;
  }
  .search-buttons {
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .no-results {
    padding: 30px 40px; /* More generous padding */
  }

  .inhouse-card,
  .professional-card {
    flex: 1 1 calc(33.333% - 30px);
    max-width: calc(33.333% - 30px);
  }

  .card-buttons .btn {
    min-width: 150px; /* Potentially larger buttons */
  }

  /*MODALS*/
  .modal-content {
    max-width: 600px; /* Wider for desktops */
    padding: 20px;
  }
  .modal-content h2 {
    font-size: 2em;
  }
}

/* Large Devices / Desktops (e.g., min-width 992px) */
@media (min-width: 992px) {
  .find-professional-hero {
    padding: 100px 20px;
  }
  .find-professional-hero h1 {
    font-size: 3.5em;
  }

  .search-filter-section h2,
  .professional-listings-section h2 {
    font-size: 2.5em;
  }

  .form-group {
    flex: 1 1 auto;
  }
  .search-form-grid {
    justify-content: space-between;
    max-width: 900px;
  }
  .search-buttons {
    flex-direction: row;
  }

  /* Professional cards: 4 columns */
  .professional-card {
    flex: 1 1 calc(25% - 30px);
    max-width: calc(25% - 30px);
  }
}

/* Extra Large Devices (e.g., min-width 1200px) */
@media (min-width: 1200px) {
  /* Adjust if necessary for even larger screens */
}
