/* ===== UX IMPROVEMENTS FOR SEARCH PAGE ===== */

/* Improvement #1: Unified Search Bar */
.unified-search-container {
  margin-bottom: 32px;
  position: relative;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  padding: 4px 4px 4px 16px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.search-input-wrapper:focus-within {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
}

.search-icon-left {
  font-size: 20px;
  margin-right: 12px;
  opacity: 0.5;
}

.unified-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  padding: 8px 8px; /* Fix #1 - reduced height by 2px */
  background: transparent;
  color: #1f2937;
}

.unified-search-input::placeholder {
  color: #9ca3af;
}

.unified-search-button {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 8px 24px; /* Fix #1, #2 - reduced to match input height */
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.unified-search-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.unified-search-button:active {
  transform: translateY(0);
}

.unified-search-button svg {
  transition: transform 0.2s ease;
}

.unified-search-button:hover svg {
  transform: translateX(2px);
}

/* Improvement #2, #3, #4: Clean 2-Row Grid with Soft Chips */
.popular-roles-section {
  margin-top: 24px; /* Reduced for compact layout */
  margin-bottom: 24px;
  background: linear-gradient(to bottom, white, #f9fafb); /* Fix #10 - subtle gradient */
  padding: 16px 20px; /* Reduced padding for compact layout */
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid #e5e7eb;
}

.section-header {
  margin-bottom: 16px; /* Reduced for compact layout */
  text-align: center;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 16px; /* Reduced for compact layout */
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 4px 0;
}

.title-icon {
  font-size: 16px; /* Reduced for compact layout */
}

.section-subtitle {
  font-size: 12px; /* Reduced for compact layout */
  color: #6b7280;
  margin: 0 auto;
  max-width: 280px;
  line-height: 1.3;
}

.roles-grid-container {
  display: flex;
  flex-direction: column;
  gap: 16px; /* Reduced for compact layout */
}

.roles-row {
  display: flex;
  align-items: flex-start;
  gap: 16px; /* Reduced for compact layout */
  padding: 8px; /* Reduced for compact layout */
  border-radius: 10px;
  transition: all 0.15s ease;
}

.roles-row:hover {
  background: #f9fafb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.row-label {
  font-size: 12px; /* Reduced for compact layout */
  font-weight: 600;
  color: #374151;
  min-width: 100px; /* Reduced for compact layout */
  text-align: left;
  padding-top: 6px;
  margin-bottom: 0;
  flex-shrink: 0;
}

.roles-row-items {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1;
}

/* Soft Card-like Chips (Improvement #3) */
.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px; /* Reduced for compact layout */
  background: #f9fafb;
  color: #374151;
  border: 1px solid #e5e7eb;
  border-radius: 8px; /* Reduced for compact layout */
  padding: 6px 12px; /* Reduced for compact layout */
  font-size: 13px; /* Reduced for compact layout */
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  min-width: 180px; /* Reduced for compact layout */
  justify-content: center;
}

.role-chip:hover {
  background: #f3f4f6; /* Fix #7 - hover state */
  border-color: #d1d5db;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Fix #7 - more noticeable shadow */
}

.role-chip:active {
  transform: translateY(0);
}

.role-chip.selected {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.role-chip.selected:hover {
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.chip-icon {
  font-size: 14px; /* Reduced for compact layout */
  line-height: 1;
}

.chip-text {
  font-size: 13px; /* Reduced for compact layout */
  line-height: 1;
}

/* Dropdown List */
.dropdown-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-top: 8px;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: none;
}

.dropdown-list.show {
  display: block;
}

.dropdown-item {
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
  border-bottom: 1px solid #f3f4f6;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: #f9fafb;
}

.dropdown-item.selected {
  background: #ede9fe;
  color: #667eea;
  font-weight: 500;
}

/* Selected Roles Display */
.selected-roles-revamped {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.selected-role-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ede9fe;
  color: #667eea;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
}

.remove-role {
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.remove-role:hover {
  opacity: 1;
}

/* Responsive Design - Fix #9 */
@media (max-width: 768px) {
  .unified-search-button span {
    display: none;
  }
  
  .unified-search-button {
    padding: 12px 16px;
  }
  
  .popular-roles-section {
    padding: 16px;
    margin-top: 32px;
  }
  
  .roles-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 8px;
  }
  
  .row-label {
    min-width: auto;
    text-align: left;
    padding-right: 0;
    border-right: none;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 8px;
    width: 100%;
    font-size: 14px;
    font-weight: 700;
  }
  
  .section-subtitle {
    padding-left: 0;
  }
  
  .roles-row-items {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 8px;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  
  .role-chip {
    font-size: 13px;
    padding: 10px 16px;
    min-width: 160px;
    flex-shrink: 0;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .search-input-wrapper {
    background: #1f2937;
    border-color: #374151;
  }
  
  .unified-search-input {
    color: #f9fafb;
  }
  
  .unified-search-input::placeholder {
    color: #6b7280;
  }
  
  .section-title {
    color: #f9fafb;
  }
  
  .section-subtitle {
    color: #9ca3af;
  }
  
  .row-label {
    color: #9ca3af;
    border-color: #374151;
  }
  
  .role-chip {
    background: #374151;
    color: #e5e7eb;
  }
  
  .role-chip:hover {
    background: #4b5563;
  }
  
  .dropdown-list {
    background: #1f2937;
    border-color: #374151;
  }
  
  .dropdown-item {
    border-color: #374151;
  }
  
  .dropdown-item:hover {
    background: #374151;
  }
}
