/* ==========================================
   PUBLIC SEARCH PAGE - WHITE & FOREST GREEN THEME
   ========================================== */

.public-page {
  background: linear-gradient(135deg, var(--site-raised, #f8fafc) 0%, var(--site-raised, #f0f7f4) 100%);
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

/* ==========================================
   PUBLIC HEADER
   ========================================== */
.public-header {
  background: var(--ds-surface, #ffffff);
  border-bottom: 1px solid var(--ds-neutral-200, #e2e8f0);
  border-top: 3px solid #3a5a40;
  box-shadow: 0 1px 3px rgba(58, 90, 64, 0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
  animation: slideDown 0.4s ease;
}

@keyframes slideDown {
  from {
    transform: translateY(-10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 0;
  max-width: 1400px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease;
}

.brand:hover {
  transform: scale(1.01);
}

.logo-icon {
  font-size: 2.5rem;
}

.brand-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--site-text, #3a5a40);
  margin: 0;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 0.8125rem;
  color: var(--ds-neutral-500, #64748b);
  margin: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.header-lang-toggle {
  display: flex;
  align-items: center;
}

/* Language toggle on public header — ensure labels stay visible */
.header-lang-toggle .lang-toggle-wrap--light .lang-toggle-switch {
  width: 76px;
  height: 36px;
}

.header-lang-toggle .lang-toggle-wrap--light .lang-toggle-switch .lang-toggle-track::before {
  height: 28px;
  width: 28px;
  left: 4px;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
}

.header-lang-toggle .lang-toggle-wrap--light .lang-toggle-switch input:checked + .lang-toggle-track::before {
  transform: translate(40px, -50%);
}

.header-lang-toggle .lang-toggle-track-text {
  z-index: 3;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.header-lang-toggle .lang-toggle-switch input:not(:checked) + .lang-toggle-track .lang-toggle-track-text--th {
  color: #ffffff;
}

.header-lang-toggle .lang-toggle-switch input:not(:checked) + .lang-toggle-track .lang-toggle-track-text--en {
  color: var(--site-text, #3a5a40);
}

.header-lang-toggle .lang-toggle-switch input:checked + .lang-toggle-track .lang-toggle-track-text--th {
  color: var(--site-text, #3a5a40);
}

.header-lang-toggle .lang-toggle-switch input:checked + .lang-toggle-track .lang-toggle-track-text--en {
  color: #ffffff;
}

.login-btn {
  padding: 10px 20px;
  background: #3a5a40;
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 4px rgba(58, 90, 64, 0.2);
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(58, 90, 64, 0.3);
  background: #2c4c3b;
}

.login-btn.hidden {
  display: none;
}

.pulse-animation {
  animation: pulse 1s ease-in-out 3;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* ==========================================
   SEARCH SECTION
   ========================================== */
.search-section {
  padding: 3rem 0 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

.search-card {
  background: var(--ds-surface, #ffffff);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 4px 6px rgba(58, 90, 64, 0.05), 0 10px 15px rgba(58, 90, 64, 0.08);
  border: 1px solid var(--ds-neutral-200, #e2e8f0);
  border-top: 3px solid #3a5a40;
  animation: scaleIn 0.4s ease;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.search-header {
  text-align: center;
  margin-bottom: 2rem;
}

.search-header h2 {
  font-size: 2rem;
  color: var(--site-text, #3a5a40);
  margin: 0 0 0.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.search-header p {
  color: var(--ds-neutral-500, #64748b);
  font-size: 1rem;
  margin: 0;
}

/* ==========================================
   MODERN SEARCH BOX
   ========================================== */
.search-box-modern {
  display: flex;
  gap: 12px;
  max-width: 800px;
  margin: 0 auto;
}

.search-box-modern input {
  flex: 1;
  padding: 14px 18px;
  font-size: 1rem;
  border: 1.5px solid var(--ds-neutral-300, #cbd5e1);
  border-radius: 12px;
  transition: all 0.25s ease;
  background: var(--ds-surface, #ffffff);
  color: var(--ds-neutral-800, #1e293b);
}

.search-box-modern input:focus {
  outline: none;
  border-color: #3a5a40;
  box-shadow: 0 0 0 3px rgba(58, 90, 64, 0.1);
}

.search-box-modern input::placeholder {
  color: var(--ds-neutral-400, #94a3b8);
}

.search-btn {
  padding: 14px 28px;
  background: #3a5a40;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(58, 90, 64, 0.2);
  white-space: nowrap;
}

.search-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(58, 90, 64, 0.3);
  background: #2c4c3b;
}

.search-icon {
  font-size: 1.125rem;
}

/* ==========================================
   LOADING & COUNTER
   ========================================== */
.search-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 1.5rem;
  color: var(--ds-neutral-500, #64748b);
  font-weight: 500;
}

.spinner-small {
  width: 18px;
  height: 18px;
  border: 2.5px solid var(--ds-neutral-200, #e2e8f0);
  border-top-color: #3a5a40;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.results-counter {
  text-align: center;
  margin-top: 1.5rem;
  padding: 14px;
  background: var(--site-raised, #f0f7f4);
  border-radius: 10px;
  color: var(--site-text, #1a2e22);
  font-size: 1rem;
  border: 1px solid var(--site-border, #b8e6b8);
}

.results-counter strong {
  color: var(--site-text, #3a5a40);
  font-size: 1.25rem;
  font-weight: 700;
}

/* ==========================================
   RESULTS SECTION
   ========================================== */
.results-section {
  padding: 1.5rem 0 3rem;
  max-width: 1400px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* Initial State */
.initial-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--ds-surface, #ffffff);
  border-radius: 20px;
  box-shadow: 0 4px 6px rgba(58, 90, 64, 0.05);
  border: 1px solid var(--ds-neutral-200, #e2e8f0);
  border-top: 3px solid #3a5a40;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.initial-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
}

.initial-state h3 {
  font-size: 1.75rem;
  color: var(--site-text, #3a5a40);
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.initial-state p {
  font-size: 1rem;
  color: var(--ds-neutral-500, #64748b);
  margin-bottom: 2rem;
}

.example-searches {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--ds-neutral-200, #e2e8f0);
}

.example-searches p {
  font-size: 0.875rem;
  color: var(--ds-neutral-400, #94a3b8);
  margin-bottom: 1rem;
}

.example-tags {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.example-tag {
  padding: 10px 18px;
  background: var(--site-raised, #f0f7f4);
  border: 1.5px solid var(--site-border, #b8e6b8);
  border-radius: 10px;
  color: var(--site-text, #2c4c3b);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.example-tag:hover {
  background: var(--site-raised, #dcf3dc);
  border-color: #3a5a40;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(58, 90, 64, 0.15);
}

/* No Results */
.no-results {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--ds-surface, #ffffff);
  border-radius: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--ds-neutral-200, #e2e8f0);
}

.no-results-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  opacity: 0.5;
}

.no-results h3 {
  font-size: 1.75rem;
  color: var(--ds-neutral-900, #0f172a);
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.no-results p {
  font-size: 1rem;
  color: var(--ds-neutral-500, #64748b);
}

/* ==========================================
   MODERN TABLE
   ========================================== */
.results-table-container {
  background: var(--ds-surface, #ffffff);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(58, 90, 64, 0.05);
  border: 1px solid var(--ds-neutral-200, #e2e8f0);
  border-top: 3px solid #3a5a40;
  animation: fadeIn 0.4s ease;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
}

.modern-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.modern-table thead {
  background: var(--site-raised, #f0f7f4);
  border-bottom: 2px solid var(--site-border, #b8e6b8);
}

.modern-table thead th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--site-text, #2c4c3b);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.modern-table thead th:first-child {
  border-top-left-radius: 12px;
}

.modern-table thead th:last-child {
  border-top-right-radius: 12px;
}

.th-icon {
  margin-right: 6px;
  font-size: 1rem;
}

.modern-table tbody tr {
  border-bottom: 1px solid var(--ds-neutral-100, #f1f5f9);
  transition: all 0.15s ease;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modern-table tbody tr:hover {
  background: var(--site-raised, #f0f7f4);
}

.modern-table tbody td {
  padding: 14px 16px;
  color: var(--ds-neutral-700, #334155);
  font-size: 0.9375rem;
}

.col-location {
  width: 15%;
}

.col-sku {
  width: 20%;
}

.col-product {
  width: 65%;
}

.modern-table tbody td:first-child {
  font-weight: 600;
  color: var(--site-text, #3a5a40);
}

.modern-table tbody td:nth-child(2) {
  color: var(--ds-neutral-500, #64748b);
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Courier New', monospace;
  font-size: 0.875rem;
}

/* Highlight matched text */
.highlight {
  background: var(--site-warning-bg, #fef3c7);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-weight: 600;
  color: var(--site-warning, #92400e);
}

/* ==========================================
   FOOTER
   ========================================== */
.public-footer {
  background: var(--ds-surface, #ffffff);
  border-top: 1px solid var(--ds-neutral-200, #e2e8f0);
  padding: 2rem 0;
  text-align: center;
  color: var(--ds-neutral-500, #64748b);
  font-size: 0.875rem;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 640px) {
  .header-content {
    flex-wrap: wrap;
    gap: 12px;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 768px) {
  .search-card {
    padding: 2rem 1.5rem;
  }

  .search-header h2 {
    font-size: 1.5rem;
  }

  .search-box-modern {
    flex-direction: column;
  }

  .search-btn {
    justify-content: center;
  }

  .example-tags {
    flex-direction: column;
  }

  .modern-table thead th,
  .modern-table tbody td {
    padding: 12px;
    font-size: 0.875rem;
  }

  .col-location,
  .col-sku,
  .col-product {
    width: auto;
  }
  
  .results-table-container {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .search-section {
    padding: 2rem 0 1rem;
  }
  
  .search-card {
    padding: 1.5rem 1.25rem;
  }
  
  .initial-state,
  .no-results {
    padding: 3rem 1.5rem;
  }
  
  .initial-icon,
  .no-results-icon {
    font-size: 3rem;
  }
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */
.hidden {
  display: none !important;
}

/* ==========================================
   CUSTOM SCROLLBAR - Forest Green
   ========================================== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--ds-neutral-100, #f1f5f9);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: var(--site-raised, #b8e6b8);
  border-radius: 5px;
  transition: background 0.25s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: #3a5a40;
}

/* Godanix: consistent button interaction — additive, no color/radius change */
button, .btn, .btn-primary, .btn-secondary, .login-btn, .search-btn, .btn-green, .btn-success {
  transition: filter .15s ease, box-shadow .15s ease, transform .06s ease;
}
button:focus-visible, .btn:focus-visible, .login-btn:focus-visible,
.search-btn:focus-visible, [role="button"]:focus-visible {
  outline: 2px solid #2f7cb0;
  outline-offset: 2px;
}
.btn:active, button.btn:active, .login-btn:active, .search-btn:active,
.btn-primary:active, .btn-green:active { transform: translateY(1px); }
.btn:hover, .btn-primary:hover, .btn-green:hover, .login-btn:hover, .search-btn:hover { filter: brightness(1.04); }
