/* Search Layout Fix for Proper Desktop Organization */

/* Main search container */
.search-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Search inputs row - DYNAMIC layout using CSS classes */
.search-inputs {
  display: grid !important;
  gap: 1rem !important;
  align-items: center !important;
  width: 100% !important;
  margin-bottom: 0 !important;
  /* Default: 3 columns when specialty is hidden */
  grid-template-columns: 1fr 1fr 1fr !important;
}

/* When specialty is visible, add class to switch to 4 columns */
.search-inputs.has-specialty {
  grid-template-columns: 1fr 1fr 1fr 1fr !important;
}

/* Individual search groups */
.search-group {
  position: relative !important;
  min-width: 0 !important;
}

/* FORCE specialty group to be hidden when display:none is set */
#specialtyGroup[style*="display: none"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Grid positioning - default 3-column layout */
.search-group:nth-child(1) { grid-column: 1; } /* Profesión */
.search-group:nth-child(3) { grid-column: 2; } /* Ubicación (when specialty hidden) */
.search-group:nth-child(4) { grid-column: 3; } /* Salario (when specialty hidden) */

/* Grid positioning - 4-column layout when specialty visible */
.search-inputs.has-specialty .search-group:nth-child(2) { grid-column: 2; } /* Especialidades */
.search-inputs.has-specialty .search-group:nth-child(3) { grid-column: 3; } /* Ubicación */
.search-inputs.has-specialty .search-group:nth-child(4) { grid-column: 4; } /* Salario */

/* Filter toggle container - centered and separate */
.filter-toggle-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.75rem 0;
  border-top: 1px solid #f1f3f4;
  border-bottom: 1px solid #f1f3f4;
  margin: 0.5rem 0;
}

/* Search button - right aligned */
.search-container > .btn-search {
  align-self: flex-end;
  min-width: 200px;
  margin-top: 1rem;
}

/* Remove duplicate search-container definition - already defined above */

/* Form inputs styling */
.search-select,
.search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  background-color: white;
  transition: all 0.2s ease;
}

.search-select:focus,
.search-input:focus {
  outline: none;
  border-color: #0069DA;
  box-shadow: 0 0 0 3px rgba(0, 105, 218, 0.1);
}

/* Advanced filters */
.advanced-filters {
  background: #f8f9fa;
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-top: 1rem;
}

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

/* Responsive adjustments */
@media (max-width: 1024px) {
  .search-inputs {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  
  #specialtyGroup {
    grid-column: span 1;
  }
  
  .search-group.search-noicon {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  .search-container {
    padding: 1rem;
    gap: 1rem;
  }
  
  .search-inputs {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  #specialtyGroup,
  .search-group.search-noicon {
    grid-column: span 1;
  }
  
  .search-container > .btn-search {
    align-self: stretch;
    width: 100%;
  }
  
  .advanced-filters-grid {
    grid-template-columns: 1fr;
  }
}

/* Ensure proper spacing in hero section */
.hero {
  padding: 3rem 0 2rem;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  text-align: center;
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: #64748b;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.job-count {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: white;
  padding: 0.75rem 1.5rem;
  border-radius: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
  font-weight: 500;
  color: #374151;
}

.count-icon {
  color: #10b981;
  font-size: 1.25rem;
}