/* Acuo Travel Agent - Main Styles
 *
 * This file contains the primary CSS styles for the Acuo Travel Agent plugin.
 * It defines the filter form, package grid, and card styles along with responsive behavior.
 *
 * @package Acuo_Travel_Agent
 * @version 1.0.0
 */

/**
 * Filter Container
 *
 * Main container for the travel filter form.
 */
 
.acuo-travel-filter {
  margin-bottom: 30px;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgb(0 0 0 / 0.05);
}

/**
 * Filter Form
 *
 * Form element that contains the filter controls.
 */
.acuo-filter-form {
  width: 100%;
}

/**
 * Filter Row
 *
 * Flexbox container for filter form elements.
 * Uses CSS variables for customizable alignment.
 */
.acuo-filter-row {
  display: flex;
  flex-wrap: wrap;
  margin: -10px;
  justify-content: var(--filter-row-justify, flex-start);
}

/**
 * Filter Row in Filter Container
 *
 * Specific styling for filter rows inside the main filter container.
 */
.acuo-travel-filter .acuo-filter-row {
  justify-content: var(--filter-row-justify, flex-start) !important;
}

/**
 * Filter Row Alignment Variants
 *
 * Classes to control the horizontal alignment of filter form elements.
 */
.acuo-filter-row.align-left {
  justify-content: flex-start !important;
}
.acuo-filter-row.align-center {
  justify-content: center !important;
}
.acuo-filter-row.align-right {
  justify-content: flex-end !important;
}
.acuo-filter-row.align-space-between {
  justify-content: space-between !important;
}

/**
 * Filter Column
 *
 * Individual column within the filter row.
 */
.acuo-filter-column {
  flex: 1;
  padding: 10px;
  min-width: 200px;
}

/**
 * Filter Form Labels
 *
 * Styling for form labels with customizable color and alignment.
 */
.acuo-filter-form label {
  display: block !important;
  margin-bottom: 8px !important;
  font-weight: 600 !important;
  color: var(--label-color, #333) !important;
  text-align: var(--label-text-align, left) !important;
}

/**
 * Select Dropdowns
 *
 * Styling for select elements with customizable properties.
 */
.acuo-select {
  width: 100% !important;
  padding: 10px !important;
  border: var(--select-border, 1px solid #ddd) !important;
  border-radius: 4px !important;
  background-color: var(--select-bg, #fff) !important;
  color: var(--select-color, #333) !important;
  min-height: 42px !important;
}

/**
 * Text Alignment Utility Classes
 *
 * Utility classes for controlling text alignment.
 */
.acuo-text-left {
  text-align: left !important;
}
.acuo-text-center {
  text-align: center !important;
}
.acuo-text-right {
  text-align: center !important ;
}

/**
 * Filter Button
 *
 * Styling for the filter/search button.
 */
.acuo-filter-button {
  display: inline-block;
  margin-top: 24px;
  padding: 12px 24px;
  background-color: #0073aa;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  transition: background-color 0.3s;
}

/**
 * Filter Button Hover State
 */
.acuo-filter-button:hover {
  background-color: #005a87;
}

/**
 * Packages Grid Container
 *
 * Container for the travel packages grid.
 */
.acuo-packages-grid {
  margin-top: 30px;
}

/**
 * Grid Layout
 *
 * CSS Grid container for package cards.
 */
.acuo-grid {
  display: grid;
  grid-gap: 30px;
}

/**
 * Grid Item
 *
 * Individual grid item with hover animation.
 */
.acuo-grid-item {
  transition: transform 0.3s;
}

/**
 * Grid Item Hover State
 */
.acuo-grid-item:hover {
  transform: translateY(-5px);
}

/**
 * Package Card
 *
 * Card layout for each travel package.
 */
.acuo-package-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgb(0 0 0 / 0.1);
  background-color: #fff;
  transition: box-shadow 0.3s;
}

/**
 * Package Card Hover State
 */
.acuo-package-card:hover {
  box-shadow: 0 5px 15px rgb(0 0 0 / 0.15);
}

/**
 * Package Image Container
 *
 * Container for the package image with aspect ratio preservation.
 */
.acuo-package-image {
  position: relative;
  overflow: hidden;
  padding-top: 60%;
}

/**
 * Package Image
 *
 * Styles for the actual image element with object-fit for proper scaling.
 */
.acuo-package-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

/**
 * Package Image Hover Animation
 */
.acuo-package-card:hover .acuo-package-image img {
  transform: scale(1.05);
}

/**
 * Package Content Container
 *
 * Container for all text content in the card.
 */
.acuo-package-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/**
 * Package Title
 *
 * Styles for the package title element.
 */
.acuo-package-title {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 20px;
  font-weight: 600;
}

/**
 * Package Title Link
 *
 * Styles for the title link with hover effect.
 */
.acuo-package-title a {
  color: #333;
  text-decoration: none;
  transition: color 0.3s;
}

/**
 * Package Title Link Hover State
 */
.acuo-package-title a:hover {
  color: #0073aa;
}

/**
 * Package Excerpt
 *
 * Styles for the package description/excerpt text.
 */
.acuo-package-excerpt {
  margin-bottom: 20px;
  color: #666;
  flex-grow: 1;
}

/**
 * Package Link (Button)
 *
 * Styles for the "View Details" or similar action button.
 */
.acuo-package-link {
  display: inline-block;
  padding: 8px 16px;
  background-color: #0073aa;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 500;
  text-align: center;
  transition: background-color 0.3s;
  align-self: flex-start;
}

/**
 * Package Link Hover State
 */
.acuo-package-link:hover {
  background-color: #005a87;
  color: #fff;
}

/**
 * No Results Message
 *
 * Styling for the message shown when no packages match the filter criteria.
 */
.acuo-no-results {
  padding: 30px;
  text-align: center;
  background-color: #f8f9fa;
  border-radius: 5px;
}

/**
 * Mobile Responsive Styles
 *
 * Adjustments for small screens (up to 768px wide).
 */
@media (max-width: 768px) {
  .acuo-filter-column {
    flex: 0 0 100%;
  }
  .acuo-grid {
    grid-template-columns: repeat(1, 1fr) !important;
  }
}

/**
 * Tablet Responsive Styles
 *
 * Adjustments for medium screens (769px to 1024px wide).
 */
@media (min-width: 769px) and (max-width: 1024px) {
  .acuo-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/**
 * Title Alignment Variants
 *
 * Classes to control the text alignment of package titles.
 */
.acuo-package-title.text-left {
  text-align: left !important;
}
.acuo-package-title.text-center {
  text-align: center !important;
}
.acuo-package-title.text-right {
  text-align: right !important;
}

/**
 * Image Alignment Variants
 *
 * Classes to control the alignment of package images.
 */
.acuo-package-image.text-left {
  text-align: left !important;
}
.acuo-package-image.text-center {
  text-align: center !important;
}
.acuo-package-image.text-right {
  text-align: right !important;
}

/**
 * Excerpt Alignment Variants
 *
 * Classes to control the text alignment of package excerpts.
 */
.acuo-package-excerpt.text-left {
  text-align: left !important;
}
.acuo-package-excerpt.text-center {
  text-align: center !important;
}
.acuo-package-excerpt.text-right {
  text-align: right !important;
}

/**
 * Button Container
 *
 * Container for the package action button with customizable alignment.
 */
.acuo-package-button-container {
  display: block;
  width: 100%;
  margin-top: 15px;
}

/**
 * Button Container Alignment Variants
 *
 * Classes to control the alignment of the button container.
 */
.acuo-package-button-container.text-left {
  text-align: left !important;
}
.acuo-package-button-container.text-center {
  text-align: center !important;
}
.acuo-package-button-container.text-right {
  text-align: right !important;
}

/**
 * Filter Row Alignment Variants (Nested)
 *
 * Specific alignment classes for filter rows inside the main filter container.
 */
.acuo-travel-filter .acuo-filter-row.align-left {
  justify-content: flex-start !important;
}
.acuo-travel-filter .acuo-filter-row.align-center {
  justify-content: center !important;
}
.acuo-travel-filter .acuo-filter-row.align-right {
  justify-content: flex-end !important;
}
.acuo-travel-filter .acuo-filter-row.align-space-between {
  justify-content: space-between !important;
}

/**
 * Filter Button in Filter Container
 *
 * Specific styling for the filter button inside the main filter container.
 */
.acuo-travel-filter .acuo-filter-button {
  text-transform: none !important;
  height: var(--button-height, auto) !important;
  min-height: 38px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/**
 * New Code for Theme-Independent Dropdowns
 *
 * These styles use high specificity and!important flags to ensure
 * consistent appearance across different WordPress themes.
 *
 */

/**
 * Theme-Independent Dropdown Styling
 *
 * These styles use high specificity and !important flags to ensure
 * consistent appearance across different WordPress themes.
 */
.acuo-travel-filter .acuo-filter-form select,
.acuo-travel-filter .acuo-filter-form .acuo-select,
.acuo-travel-filter .acuo-filter-form .select2-container {
  width: 100% !important;
  min-height: 42px !important;
  padding: 8px 12px !important;
  border: 1px solid #ddd !important;
  border-radius: 4px !important;
  background-color: #fff !important;
  color: #333 !important;
  font-size: 14px !important;
  line-height: normal !important;
  box-sizing: border-box !important;
  margin-bottom: 15px !important;
  box-shadow: none !important;
  -webkit-appearance: auto !important;
  -moz-appearance: auto !important;
  appearance: auto !important;
}

/* Select2 specific overrides */
.acuo-travel-filter .select2-container--default .select2-selection--single,
.acuo-travel-filter .select2-container--default .select2-selection--multiple {
  min-height: 42px !important;
  border: 1px solid #ddd !important;
  border-radius: 4px !important;
  background-color: #fff !important;
  padding: 0 8px !important;
  display: flex !important; /* Align content with flexbox */
  align-items: center !important; /* Vertical centering */
  box-sizing: border-box !important; /* Keep padding inside height */
}

/* Remove fixed line-height and use flex alignment */
.acuo-travel-filter
  .select2-container--default
  .select2-selection--single
  .select2-selection__rendered {
  color: #333 !important;
  padding-left: 8px !important;
  padding-right: 20px !important;
  display: flex !important;
  align-items: center !important;

  line-height: normal !important; /* Prevent vertical offset */
  width: 100%;
}

/* Keep arrow aligned */
.acuo-travel-filter
  .select2-container--default
  .select2-selection--single
  .select2-selection__arrow {
  height: 100% !important;
  position: absolute !important;
  top: 0 !important;
  right: 1px !important;
  width: 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.acuo-travel-filter
  .select2-container--default
  .select2-selection--multiple
  .select2-selection__choice {
  background-color: #e4e4e4 !important;
  border: 1px solid #ddd !important;
  border-radius: 4px !important;
  margin: 4px 5px 0 0 !important;
  padding: 2px 6px !important;
}

/* Target Elementor editor specifically */
.elementor-editor-active
  .select2-container--default
  .select2-selection--single
  .select2-selection__rendered {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important; /* controls space between icon & text */
  padding-left: 8px !important;
  padding-right: 20px !important;
  line-height: normal !important; /* avoid vertical offset */
}

/* Fix for filter form layout */
.acuo-travel-filter .acuo-filter-form .acuo-filter-row {
  display: flex !important;
  /*flex-wrap: wrap !important;*/
  margin: 10px -10px !important;
  align-items: flex-end !important;
}

.acuo-travel-filter .acuo-filter-form .acuo-filter-column {
  padding: 0 10px !important;
  box-sizing: border-box !important;
  margin-bottom: 15px !important;
}

/* Responsive fixes */
@media (max-width: 768px) {
  .acuo-travel-filter .acuo-filter-form .acuo-filter-row {
    flex-direction: column !important;
  }

  .acuo-travel-filter .acuo-filter-form .acuo-filter-column {
    width: 100% !important;
  }

  .acuo-travel-filter .acuo-filter-button {
    width: 100 !important;
    margin-top: 10px !important;
  }
}

/* Ensure button styling is consistent */
.acuo-travel-filter .acuo-filter-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 42px !important;
  padding: 8px 24px !important;
  background-color: var(--button-bg, #0073aa) !important;
  color: var(--button-color, #fff) !important;
  border: none !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  text-align: center !important;
  text-decoration: none !important;
  /*box-sizing: border-box !important;*/
  transition: background-color 0.3s !important;
}

.acuo-travel-filter .acuo-filter-button:hover {
  background-color: var(--button-hover-bg, #005a87) !important;
  color: var(--button-hover-color, #fff) !important;
}

/**
 * Fix for dropdown options spacing
 */
.select2-container--default .select2-results__option {
  padding: 8px 12px !important;
  margin: 0 !important;
  line-height: 1.5 !important;
}

.select2-container--default .select2-results__options {
  max-height: 250px !important;
  overflow-y: auto !important;
}

.select2-container--default .select2-results > .select2-results__options {
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15) !important;
  border-radius: 0 0 4px 4px !important;
}

/* Fix for dropdown clear button (x icon) */
.select2-container--default
  .select2-selection--single
  .select2-selection__clear {
  margin-right: 10px !important;
  font-weight: bold !important;
  font-size: 16px !important;
  color: #999 !important;
}

/* Fix for dropdown option hover state */
.select2-container--default
  .select2-results__option--highlighted[aria-selected] {
  background-color: #0073aa !important;
  color: white !important;
}

/* Ensure dropdown opens with proper width */
.select2-container--open .select2-dropdown {
  min-width: 200px !important;
  border-color: #ddd !important;
  /*margin-top: 20px !important;*/
}

/**
 * Additional fixes for dropdown spacing issues
 */
/* Fix for dropdown list items spacing */
.select2-results__option {
  padding: 10px 15px !important;
  margin-bottom: 2px !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

/* Fix for dropdown list container */
.select2-results {
  padding: 5px !important;
}

/* Fix for dropdown list spacing */
.select2-dropdown {
  border: 1px solid #ddd !important;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1) !important;
  z-index: 9999 !important;
  background-color: #fff !important;
}

/* Fix for dropdown option text */
.select2-results__option {
  font-size: 14px !important;
  color: #333 !important;
}

/* Fix for dropdown clear button interaction */
.select2-container--default
  .select2-selection--single
  .select2-selection__clear:hover {
  color: #d63638 !important;
  cursor: pointer !important;
}

/* Fix for dropdown search field */
.select2-search--dropdown .select2-search__field {
  padding: 8px !important;
  border: 1px solid #ddd !important;
  border-radius: 4px !important;
  margin-bottom: 5px !important;
}

/* Fix for dropdown option spacing after clearing */
.select2-results__message {
  padding: 10px !important;
  color: #666 !important;
}

/* Ensure dropdown options have proper height */
.select2-results__option[aria-selected] {
  min-height: 36px !important;
  display: flex !important;
  align-items: center !important;
}

/* Fix for dropdown width after clearing */
body .select2-container {
  z-index: 999999 !important;
}

/* Fix for dropdown options container */
.select2-container--open .select2-dropdown--below,
.select2-container--open .select2-dropdown--above {
  min-width: 100% !important;
}

@media (max-width: 768px) {
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}
