/**
 * Unified Search Page Styling
 * Professional search bar with black-to-green gradient matching site branding
 */

/* =====================================================
   SEARCH CONTAINER
   ===================================================== */
.search-view-with-facets {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.search-view-with-facets .view-header {
  display: none;
}

/* =====================================================
   SEARCH BAR - Black to Green Gradient
   ===================================================== */
.search-view-with-facets .view-filters {
  background: linear-gradient(135deg, #1a1a1a 0%, #0c7e52 100%) !important;
  padding: 2rem !important;
  border-radius: 1rem !important;
  margin-bottom: 2rem !important;
  box-shadow: 0 20px 60px rgba(12, 126, 82, 0.3) !important;
  position: relative;
  overflow: hidden;
  border: none !important;
}

/* Decorative background pattern */
.search-view-with-facets .view-filters::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

/* =====================================================
   SEARCH BAR LAYOUT - Single row alignment
   ===================================================== */
.search-view-with-facets .view-filters {
  display: flex !important;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

/* The exposed form takes remaining space */
.search-view-with-facets .views-exposed-form {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  min-width: 0;
  position: relative;
  z-index: 1;
}

/* =====================================================
   FORM ITEMS - Consistent sizing
   ===================================================== */
.search-view-with-facets .form-item {
  margin: 0;
  display: flex;
  flex-direction: column;
}

/* All labels - consistent styling */
.search-view-with-facets .form-item > label,
.search-view-with-facets .form-item-search > label,
.search-view-with-facets .view-filters label {
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  color: rgba(255, 255, 255, 0.9) !important;
  margin-bottom: 0.5rem !important;
  line-height: 1 !important;
}

/* All inputs and selects - same height */
.search-view-with-facets input[type="text"],
.search-view-with-facets select {
  height: 44px;
  padding: 0 1rem;
  border: none;
  border-radius: 8px;
  background: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  color: #1f2937;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  box-sizing: border-box;
  transition: box-shadow 0.2s ease;
}

.search-view-with-facets input[type="text"]:focus,
.search-view-with-facets select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* =====================================================
   FACET BLOCKS - When moved into search bar
   ===================================================== */
#block-facet-cruise-type,
#block-facet-departure-port {
  margin: 0 !important;
  margin-right: 1rem !important;
  padding: 0 !important;
  background: none !important;
  box-shadow: none !important;
  border: none !important;
  position: relative;
  z-index: 1;
  flex: 0 0 180px;
}

#block-facet-cruise-type .block__title,
#block-facet-departure-port .block__title {
  display: none !important;
}

#block-facet-cruise-type .block__content,
#block-facet-departure-port .block__content {
  padding: 0 !important;
  margin: 0 !important;
}

#block-facet-cruise-type .facets-widget-dropdown,
#block-facet-departure-port .facets-widget-dropdown {
  margin: 0 !important;
  padding: 0 !important;
}

/* Hide the UL list and generated label */
#block-facet-cruise-type .js-facets-dropdown-links,
#block-facet-departure-port .js-facets-dropdown-links,
#facet_cruise_type_label,
#facet_departure_port_label {
  display: none !important;
}

/* Facet block structure - match form-item layout */
#block-facet-cruise-type,
#block-facet-departure-port {
  display: flex !important;
  flex-direction: column !important;
}

/* Facet labels */
#block-facet-cruise-type::before {
  content: "Cruise Type";
  display: block;
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  color: rgba(255, 255, 255, 0.9) !important;
  margin-bottom: 0.5rem !important;
  line-height: 1 !important;
  height: auto !important;
}

#block-facet-departure-port::before {
  content: "Departure Port";
  display: block;
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  color: rgba(255, 255, 255, 0.9) !important;
  margin-bottom: 0.5rem !important;
  line-height: 1 !important;
  height: auto !important;
}

/* Style the facet select dropdown */
#block-facet-cruise-type select.facets-dropdown,
#block-facet-departure-port select.facets-dropdown {
  width: 100% !important;
  height: 44px !important;
  padding: 0 2rem 0 1rem !important;
  border: none !important;
  border-radius: 8px !important;
  background-color: #fff !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%230c7e52' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.75rem center !important;
  font-size: 0.9rem !important;
  font-weight: 500 !important;
  color: #1f2937 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  cursor: pointer !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  box-sizing: border-box !important;
}

#block-facet-cruise-type select.facets-dropdown:focus,
#block-facet-departure-port select.facets-dropdown:focus {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

/* =====================================================
   SEARCH TEXT INPUT
   ===================================================== */
.search-view-with-facets .form-item-search {
  flex: 1;
  min-width: 200px;
}

.search-view-with-facets .form-item-search input[type="text"],
.search-view-with-facets .form-item-search input.form-text,
.search-view-with-facets .form-item-search input.form-element {
  width: 100%;
  padding-left: 1rem !important;
  background-image: none !important;
  background: #fff !important;
}

/* Remove any pseudo-element icons */
.search-view-with-facets .form-item-search::before,
.search-view-with-facets .form-item-search::after,
.search-view-with-facets .form-item-search input::before,
.search-view-with-facets .form-item-search input::after,
.search-view-with-facets .form-item-search label::before,
.search-view-with-facets .form-item-search label::after {
  display: none !important;
  content: none !important;
}

.search-view-with-facets .form-item-search .description {
  display: none;
}

/* =====================================================
   SORT CONTROLS - Hidden
   ===================================================== */
.search-view-with-facets .form-item-sort-by,
.search-view-with-facets .form-item-sort-order {
  display: none !important;
}

/* =====================================================
   SUBMIT BUTTON
   ===================================================== */
.search-view-with-facets .form-actions {
  margin: 0;
  align-self: flex-end;
}

.search-view-with-facets .form-actions input[type="submit"] {
  height: 44px;
  padding: 0 1.5rem;
  border: none;
  border-radius: 8px;
  background: #fff;
  color: #0c7e52;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.search-view-with-facets .form-actions input[type="submit"]:hover {
  background: #e6f7f0;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Reset button */
.search-view-with-facets .form-actions input[type="submit"][value="Reset"],
.search-view-with-facets .form-actions input[type="submit"][value="Clear"] {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  margin-left: 0.5rem;
}

.search-view-with-facets .form-actions input[type="submit"][value="Reset"]:hover,
.search-view-with-facets .form-actions input[type="submit"][value="Clear"]:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 900px) {
  .search-view-with-facets .view-filters {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  #block-facet-cruise-type,
  #block-facet-departure-port {
    flex: 1 1 100%;
  }

  .search-view-with-facets .views-exposed-form {
    flex-direction: column;
  }

  .search-view-with-facets .form-item-search {
    width: 100%;
  }

  .search-view-with-facets .form-actions {
    width: 100%;
  }

  .search-view-with-facets .form-actions input[type="submit"] {
    width: 100%;
  }
}

/* Mobile - Ultra Compact search bar */
@media (max-width: 768px) {
  .search-view-with-facets .view-filters {
    padding: 0.5rem !important;
    border-radius: 0.5rem !important;
    margin-bottom: 0.5rem !important;
    box-shadow: 0 4px 12px rgba(12, 126, 82, 0.15) !important;
  }

  /* Horizontal layout: search input + button side by side */
  .search-view-with-facets .views-exposed-form {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 0.5rem !important;
    align-items: center !important;
  }

  /* Search field takes remaining space */
  .search-view-with-facets .form-item-search {
    flex: 1 !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .search-view-with-facets .form-item {
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Hide labels on mobile to save space */
  .search-view-with-facets .form-item > label,
  .search-view-with-facets .form-item-search > label,
  .search-view-with-facets .form-item__label,
  .search-view-with-facets label {
    display: none !important;
  }

  /* Compact 36px height inputs */
  .search-view-with-facets input[type="text"],
  .search-view-with-facets select {
    height: 36px !important;
    font-size: 0.875rem !important;
    padding: 0 0.75rem !important;
    border-radius: 6px !important;
  }

  /* Compact 36px button inline with search */
  .search-view-with-facets .form-actions {
    margin: 0 !important;
    flex-shrink: 0 !important;
  }

  .search-view-with-facets .form-actions input[type="submit"] {
    height: 36px !important;
    font-size: 0.875rem !important;
    width: auto !important;
    padding: 0 1rem !important;
    border-radius: 6px !important;
    white-space: nowrap !important;
  }

  /* Hide sort controls, selects on mobile */
  .search-view-with-facets .form-item-sort-by,
  .search-view-with-facets .form-item-sort-order,
  .search-view-with-facets select {
    display: none !important;
  }

  /* Hide description on mobile */
  .search-view-with-facets .form-item__description,
  .search-view-with-facets .description {
    display: none !important;
  }

  /* Facet dropdowns - hide on mobile */
  #block-facet-cruise-type,
  #block-facet-departure-port {
    display: none !important;
  }
}

/* =====================================================
   RESULTS GRID - 3 columns max to match 1200px container
   ===================================================== */
.search-view-with-facets .view-content {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

/* Prevent grid items from overflowing */
.search-view-with-facets .view-content > .views-row,
.search-view-with-facets .view-content > article,
.search-view-with-facets .view-content .cruise-ship-card,
.search-view-with-facets .view-content .cruise-line-card {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

@media (max-width: 900px) {
  .search-view-with-facets .view-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .search-view-with-facets .view-content {
    grid-template-columns: 1fr;
  }
}
