/**
 * NewBeauty Search Interface Styles
 * 
 * Main stylesheet for the intelligent search interface
 * Following NewBeauty.com brand guidelines
 * 
 * @package NewBeauty_Intelligent_Search
 * @since 1.0.0
 */

/* ========================================
   CSS Custom Properties (NewBeauty Brand)
   ======================================== */

:root {
  /* Primary Brand Colors */
  --c-grey-dark: #000;
  --c-grey: #202020;
  --c-grey-medium: #585c66;
  --c-grey-light: #e4e4e4;
  --c-white: #fff;
  
  /* Signature Beauty Colors */
  --c-peach: #fdf3ed;
  --c-pale: #f4e0d3;
  --c-pink: #f1af9c;
  --c-red: #d8292f;
  --c-red-dark: #971d21;
  --c-blue: #384782;
  
  /* Font Families */
  --ff-sans-serif: "Source Sans Pro", helvetica, sans-serif;
  --ff-serif: "Canela", georgia, sans-serif;
  
  /* Font Sizes */
  --fs-small: 14px;
  --fs-normal: 16px;
  --fs-medium: 20px;
  --fs-large: 28px;
  --fs-xlarge: 36px;
  --fs-xxlarge: 42px;
  --fs-xxxlarge: 50px;
  
  /* Font Weights */
  --fw-regular: 400;
  --fw-semibold: 600;
  --fw-bold: 700;
  
  /* Spacing Scale */
  --s-small: 15px;
  --s-medium: 20px;
  --s-large: 30px;
  --s-xlarge: 40px;
  --s-xxlarge: 60px;
  
  /* Layout */
  --site-max-width: 1260px;
  --content-max-width: 830px;
  
  /* Transitions */
  --t-default: 300ms;
  --t-long: 500ms;
}

/* ========================================
   Search Container & Layout
   ======================================== */

.newbeauty-search-container {
  max-width: var(--site-max-width);
  margin: 0 auto;
  padding: var(--s-medium);
  font-family: var(--ff-sans-serif);
  color: var(--c-grey-dark);
  line-height: 1.5;
}

.newbeauty-search-container * {
  box-sizing: border-box;
}

/* Layout Variations */
.nb-layout-full {
  /* Full layout - default */
}

.nb-layout-compact {
  max-width: var(--content-max-width);
}

.nb-layout-minimal .nb-quick-categories,
.nb-layout-minimal .nb-search-facets {
  display: none;
}

/* Theme Variations */
.nb-theme-dark {
  background-color: var(--c-grey);
  color: var(--c-white);
}

.nb-theme-beauty {
  background-color: var(--c-peach);
}

/* ========================================
   Search Input Section
   ======================================== */

.nb-search-input-section {
  margin-bottom: var(--s-large);
}

.nb-search-form {
  position: relative;
  margin-bottom: var(--s-medium);
}

.nb-search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--c-white);
  border: 2px solid var(--c-grey-light);
  border-radius: 8px;
  transition: border-color var(--t-default) ease, box-shadow var(--t-default) ease;
  margin-bottom: var(--s-small);
}

.nb-search-input-wrapper:focus-within {
  border-color: var(--c-blue);
  box-shadow: 0 0 0 3px rgba(56, 71, 130, 0.1);
}

.nb-search-focused .nb-search-input-wrapper {
  border-color: var(--c-blue);
  box-shadow: 0 0 0 3px rgba(56, 71, 130, 0.1);
}

.nb-search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  color: var(--c-grey-medium);
  flex-shrink: 0;
}

.nb-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: var(--fs-normal);
  font-family: var(--ff-sans-serif);
  color: var(--c-grey-dark);
  padding: 16px 12px;
  background: transparent;
  min-height: 48px;
}

.nb-search-input::placeholder {
  color: var(--c-grey-medium);
  font-style: italic;
}

.nb-search-submit {
  background-color: var(--c-grey);
  color: var(--c-white);
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 13px 20px 15px;
  border: none;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  transition: background-color var(--t-default) ease;
  flex-shrink: 0;
}

.nb-search-submit:hover {
  background-color: var(--c-red);
}

.nb-search-submit .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Loading Indicator */
.nb-loading-indicator {
  position: absolute;
  right: 60px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  gap: 8px;
}

.nb-searching .nb-loading-indicator {
  display: flex;
}

.nb-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--c-grey-light);
  border-top: 2px solid var(--c-red);
  border-radius: 50%;
  animation: nb-spin 1s linear infinite;
}

@keyframes nb-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ========================================
   Quick Categories
   ======================================== */

.nb-quick-categories {
  display: flex;
  gap: var(--s-small);
  flex-wrap: wrap;
  margin-bottom: var(--s-medium);
}

.nb-category-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--c-white);
  color: var(--c-grey);
  border: 1px solid var(--c-grey-light);
  border-radius: 24px;
  padding: 8px 16px;
  font-size: var(--fs-small);
  font-weight: var(--fw-regular);
  cursor: pointer;
  transition: all var(--t-default) ease;
  text-decoration: none;
}

.nb-category-btn:hover,
.nb-category-btn.active {
  background-color: var(--c-pale);
  border-color: var(--c-pink);
  color: var(--c-grey-dark);
}

.nb-category-icon {
  font-size: 16px;
}

/* ========================================
   Search Results Section
   ======================================== */

.nb-search-results-section {
  display: flex;
  gap: var(--s-large);
  margin-top: var(--s-large);
}

.nb-search-sidebar {
  flex: 0 0 280px;
}

.nb-search-main {
  flex: 1;
  min-width: 0;
}

/* Results Header */
.nb-search-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--s-medium);
  padding-bottom: var(--s-small);
  border-bottom: 1px solid var(--c-grey-light);
}

.nb-results-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-small);
  color: var(--c-grey-medium);
}

.nb-results-count {
  font-weight: var(--fw-semibold);
  color: var(--c-grey-dark);
}

.nb-response-time {
  color: var(--c-grey-medium);
  font-style: italic;
}

.nb-sort-dropdown {
  border: 1px solid var(--c-grey-light);
  border-radius: 4px;
  padding: 8px 12px;
  font-size: var(--fs-small);
  background: var(--c-white);
  color: var(--c-grey);
  cursor: pointer;
}

/* ========================================
   Search Results
   ======================================== */

.nb-search-results {
  margin-bottom: var(--s-large);
}

.nb-result-item {
  display: flex;
  gap: var(--s-medium);
  padding: var(--s-medium);
  border: 1px solid var(--c-grey-light);
  border-radius: 8px;
  margin-bottom: var(--s-medium);
  background: var(--c-white);
  transition: all var(--t-default) ease;
}

.nb-result-item:hover {
  border-color: var(--c-pink);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nb-result-thumbnail {
  flex: 0 0 120px;
}

.nb-result-thumbnail img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
}

.nb-result-content {
  flex: 1;
  min-width: 0;
}

.nb-result-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.nb-result-type {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-small);
  color: var(--c-grey-medium);
}

.nb-type-icon {
  font-size: 16px;
}

.nb-result-badges {
  display: flex;
  gap: 6px;
}

.nb-badge {
  padding: 2px 8px;
  font-size: 12px;
  font-weight: var(--fw-semibold);
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nb-badge-top-rated {
  background-color: var(--c-peach);
  color: var(--c-red);
}

.nb-result-title {
  margin: 0 0 8px 0;
  font-size: var(--fs-medium);
  font-weight: var(--fw-semibold);
  line-height: 1.3;
}

.nb-result-title a {
  color: var(--c-grey-dark);
  text-decoration: none;
  transition: color var(--t-default) ease;
}

.nb-result-title a:hover {
  color: var(--c-red);
}

.nb-result-excerpt {
  color: var(--c-grey-medium);
  line-height: 1.5;
  margin-bottom: 12px;
}

.nb-result-meta {
  display: flex;
  gap: var(--s-small);
  flex-wrap: wrap;
}

.nb-result-meta span {
  font-size: var(--fs-small);
  color: var(--c-grey-medium);
  padding: 4px 8px;
  background: var(--c-peach);
  border-radius: 4px;
}

.nb-meta-price {
  background-color: var(--c-pale);
  color: var(--c-red);
  font-weight: var(--fw-semibold);
}

/* ========================================
   Pagination
   ======================================== */

.nb-search-pagination {
  margin-top: var(--s-large);
}

.nb-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: var(--s-large) 0;
}

.nb-pagination-btn {
  padding: 8px 16px;
  border: 1px solid var(--c-grey-light);
  background: var(--c-white);
  color: var(--c-grey);
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--t-default) ease;
  font-size: var(--fs-small);
  text-decoration: none;
}

.nb-pagination-btn:hover {
  background: var(--c-peach);
  border-color: var(--c-pink);
  color: var(--c-grey-dark);
}

.nb-pagination-btn.active {
  background: var(--c-red);
  color: var(--c-white);
  border-color: var(--c-red);
}

/* ========================================
   Related Suggestions
   ======================================== */

.nb-related-suggestions {
  margin-top: var(--s-large);
  padding-top: var(--s-medium);
  border-top: 1px solid var(--c-grey-light);
}

.nb-related-suggestions h4 {
  margin: 0 0 var(--s-small) 0;
  font-size: var(--fs-normal);
  font-weight: var(--fw-semibold);
  color: var(--c-grey);
}

.nb-related-queries {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nb-related-query {
  background: var(--c-peach);
  color: var(--c-grey);
  border: 1px solid var(--c-pale);
  border-radius: 16px;
  padding: 6px 12px;
  font-size: var(--fs-small);
  cursor: pointer;
  transition: all var(--t-default) ease;
  text-decoration: none;
}

.nb-related-query:hover {
  background: var(--c-pink);
  color: var(--c-white);
  border-color: var(--c-pink);
}

/* ========================================
   No Results Section
   ======================================== */

.nb-no-results-section {
  text-align: center;
  padding: var(--s-xxlarge) var(--s-medium);
}

.nb-no-results-content {
  max-width: 500px;
  margin: 0 auto;
}

.nb-no-results-icon {
  font-size: 48px;
  margin-bottom: var(--s-medium);
  opacity: 0.5;
}

.nb-no-results-section h3 {
  margin: 0 0 var(--s-small) 0;
  font-size: var(--fs-large);
  font-weight: var(--fw-semibold);
  color: var(--c-grey);
}

.nb-no-results-message {
  color: var(--c-grey-medium);
  margin-bottom: var(--s-medium);
}

.nb-suggestions h4 {
  margin: var(--s-medium) 0 var(--s-small) 0;
  font-size: var(--fs-normal);
  font-weight: var(--fw-semibold);
  color: var(--c-grey);
}

.nb-suggestion-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.nb-suggestion-chip {
  background: var(--c-grey);
  color: var(--c-white);
  border: none;
  border-radius: 16px;
  padding: 8px 16px;
  font-size: var(--fs-small);
  cursor: pointer;
  transition: background-color var(--t-default) ease;
}

.nb-suggestion-chip:hover {
  background: var(--c-red);
}

/* ========================================
   Error States
   ======================================== */

.nb-error-message {
  text-align: center;
  padding: var(--s-large);
  background: #fdf2f2;
  border: 1px solid #fed7d7;
  border-radius: 8px;
  color: #c53030;
}

.nb-retry-search {
  margin-top: var(--s-small);
  background: var(--c-red);
  color: var(--c-white);
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: var(--fs-small);
  cursor: pointer;
  transition: background-color var(--t-default) ease;
}

.nb-retry-search:hover {
  background: var(--c-red-dark);
}

/* ========================================
   Mobile Responsive
   ======================================== */

@media (max-width: 768px) {
  .newbeauty-search-container {
    padding: var(--s-small);
  }
  
  .nb-search-results-section {
    flex-direction: column;
    gap: var(--s-medium);
  }
  
  .nb-search-sidebar {
    flex: none;
    order: 2;
  }
  
  .nb-search-main {
    order: 1;
  }
  
  .nb-search-results-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-small);
  }
  
  .nb-result-item {
    flex-direction: column;
    gap: var(--s-small);
  }
  
  .nb-result-thumbnail {
    flex: none;
    align-self: center;
  }
  
  .nb-quick-categories {
    overflow-x: auto;
    padding-bottom: 8px;
  }
  
  .nb-pagination {
    flex-wrap: wrap;
  }
  
  .nb-related-queries {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .nb-search-input-wrapper {
    flex-direction: column;
  }
  
  .nb-search-submit {
    border-radius: 0 0 6px 6px;
    width: 100%;
  }
  
  .nb-result-meta {
    flex-direction: column;
    gap: 4px;
  }
  
  .nb-suggestion-chips {
    flex-direction: column;
    align-items: center;
  }
}

/* ========================================
   Utility Classes
   ======================================== */

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nb-hidden {
  display: none !important;
}

.nb-visible {
  display: block !important;
}

/* ========================================
   Animation & Transitions
   ======================================== */

.nb-search-results .nb-result-item {
  animation: nb-fadeInUp 0.4s ease-out;
}

@keyframes nb-fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nb-autocomplete-container,
.nb-search-results-section,
.nb-no-results-section {
  animation: nb-fadeIn 0.3s ease-out;
}

@keyframes nb-fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
  .nb-search-input-section,
  .nb-search-sidebar,
  .nb-search-pagination,
  .nb-related-suggestions {
    display: none;
  }
  
  .nb-result-item {
    border: 1px solid #000;
    break-inside: avoid;
  }
  
  .nb-result-title a {
    color: #000;
    text-decoration: underline;
  }
}
