/* ============================================
   TAKEEZEE - PRICE COMPARISON STYLES
   ============================================ */

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #333;
  min-height: 100vh;
  padding: 2rem 1rem;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  background: white;
  padding: 3rem 2rem;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.5s ease-out;
}

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

/* ============================================
   HEADER & BRANDING
   ============================================ */

.header {
  text-align: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #f0f0f0;
}

.logo-section {
  margin: 0;
}

.brand-logo {
  margin: 0;
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
}

.tagline {
  margin: 0.5rem 0 0 0;
  font-size: 1.1rem;
  color: #666;
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* ============================================
   SEARCH SECTION
   ============================================ */

#search-section {
  position: relative;
  margin-bottom: 2.5rem;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 1.5rem;
  width: 20px;
  height: 20px;
  color: #667eea;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
  z-index: 10;
}

/* REMOVE these sections if they exist:
   - .search-mode-btn
   - .mode-icon
   - .mode-text
   - #search-box with padding-right adjustment
*/

/* ADD these new styles for Strict Search toggle */

.search-mode-toggle-container {
  margin-top: 0.75rem;
  display: flex;
  justify-content: center;
}

.strict-search-btn {
  background: #ff6b6b;
  border: 2px solid #ff6b6b;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: white;
  transition: all 0.3s ease;
  border-radius: 20px;
  text-decoration: none;
  outline: none;
}

.strict-search-btn:hover {
  border-color: #ff5252;
  background: #ff5252;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
  text-decoration: none;
}

.strict-search-btn:focus {
  outline: none;
  text-decoration: none;
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.2);
}

.strict-search-btn.active {
  border-color: #40c057;
  background: #40c057;
  color: white;
  text-decoration: none;
}

.strict-search-btn.active:hover {
  border-color: #2da647;
  background: #2da647;
  box-shadow: 0 4px 12px rgba(64, 192, 87, 0.3);
  text-decoration: none;
}

.strict-search-btn.active:focus {
  outline: none;
  text-decoration: none;
  box-shadow: 0 0 0 3px rgba(64, 192, 87, 0.2);
}

.toggle-icon {
  font-size: 1.1rem;
  font-weight: bold;
  transition: transform 0.3s ease;
}

.toggle-label {
  font-size: 0.85rem;
  letter-spacing: 0.3px;
}

/* Ensure search-box doesn't have extra padding */
#search-box {
  width: 100%;
  padding: 1rem 1.5rem 1rem 3.5rem;
  font-size: 1.1rem;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: #f9f9f9;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}
/* Search Button Icon */
.search-btn-icon {
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
  color: #667eea;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.search-btn-icon:hover {
  color: #764ba2;
  transform: translateY(-50%) scale(1.2);
}

.search-btn-icon:active {
  transform: translateY(-50%) scale(0.95);
}

/* Adjust search input padding to make room for search button */
.search-container {
  position: relative;
  margin-bottom: 1rem;
}

#search-box {
  width: 100%;
  padding: 1rem 3.5rem 1rem 1.5rem;
  font-size: 1.1rem;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: #f9f9f9;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

#search-box:focus {
  border-color: #667eea;
  background: white;
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.25);
  transform: translateY(-2px);
}

#search-box::placeholder {
  color: #aaa;
}

/* ============================================
   AUTOCOMPLETE SUGGESTIONS
   ============================================ */

.suggestions {
  position: absolute;
  width: 100%;
  background: white;
  border: 2px solid #e0e0e0;
  border-top: none;
  border-radius: 0 0 12px 12px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 1000;
  list-style: none;
  padding: 0;
  margin: 0;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
  display: none; /* Hide by default */
}

.suggestions:not(:empty) {
  display: block; /* Show only when it has content */
}

.suggestions li {
  padding: 1rem 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid #f5f5f5;
  font-size: 0.95rem;
  color: #555;
}

.suggestions li:last-child {
  border-bottom: none;
  border-radius: 0 0 12px 12px;
}

.suggestions li:hover {
  background: linear-gradient(90deg, #667eea08 0%, #764ba208 100%);
  color: #667eea;
  padding-left: 2rem;
  font-weight: 600;
}

/* Highlight selected suggestion in strict mode */
.suggestions li.selected {
  background: linear-gradient(90deg, #667eea15 0%, #764ba215 100%);
  color: #667eea;
  padding-left: 2rem;
  font-weight: 600;
}

/* ============================================
   RESULTS TABLE
   ============================================ */

#results-table {
  width: 100%;
  margin-top: 2rem;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#results-table thead {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

#results-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #667eea;
}

#results-table td {
  padding: 1rem;
  border-bottom: 1px solid #e0e0e0;
}

#results-table tbody tr:hover {
  background-color: #f9f9f9;
}

#results-table img {
  max-width: 50px;
  height: auto;
  border-radius: 4px;
}

.price-cell {
  color: #ff9c1a;
  font-weight: bold;
}

.score-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-weight: bold;
  color: white;
}

.loading-container {
  text-align: center;
  padding: 2rem 1rem;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  margin: 1rem 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  transition: width 0.3s ease;
}

.loading-text {
  color: #667eea;
  font-size: 0.95rem;
  margin: 1rem 0;
}

.error-message {
  color: #d32f2f;
  text-align: center;
  padding: 2rem 1rem;
}

.placeholder {
  text-align: center;
  color: #999;
  padding: 2rem 1rem;
}

#results-table a {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

#results-table a:hover {
  color: #764ba2;
  text-decoration: underline;
}

#results-table a:visited {
  color: #764ba2;
}

#home-btn-container {
  margin-top: 2rem;
  text-align: center;
}

#home-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

#home-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn-icon {
  width: 20px;
  height: 20px;
}

.sortable {
  cursor: pointer;
  user-select: none;
}

.sortable:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sort-icon {
  font-size: 0.8rem;
  margin-left: 0.25rem;
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

.suggestions::-webkit-scrollbar {
  width: 8px;
}

.suggestions::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 4px;
}

.suggestions::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 4px;
}

.suggestions::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
  .container {
    padding: 1.5rem 1rem;
  }

  .brand-logo {
    font-size: 2.2rem;
  }

  .tagline {
    font-size: 0.95rem;
  }

  #search-box {
    padding: 0.85rem 1.5rem 0.85rem 3.5rem;
    font-size: 1rem;
  }

  .search-icon {
    width: 18px;
    height: 18px;
  }

  #results-table th,
  #results-table td {
    padding: 0.85rem 1rem;
    font-size: 0.85rem;
  }

  #results-table th {
    font-size: 0.8rem;
  }

  #home-btn {
    width: 100%;
    padding: 0.85rem 1.5rem;
  }

  .suggestions li {
    padding: 0.8rem 1rem;
  }
}

@media (max-width: 480px) {
  body {
    padding: 1rem;
  }

  .container {
    padding: 1rem;
    border-radius: 12px;
  }

  .brand-logo {
    font-size: 1.8rem;
  }

  .tagline {
    font-size: 0.85rem;
  }

  .header {
    margin-bottom: 1.5rem;
  }

  #results-table {
    font-size: 0.8rem;
  }

  #results-table th,
  #results-table td {
    padding: 0.6rem 0.8rem;
  }

  #home-btn {
    font-size: 0.9rem;
    padding: 0.75rem 1.2rem;
  }

  .search-icon {
    width: 16px;
    height: 16px;
    left: 1.2rem;
  }

  #search-box {
    padding: 0.75rem 1.2rem 0.75rem 3rem;
  }
}

/* ============================================
   PROGRESS BAR & LOADING
   ============================================ */

.loading-container {
  text-align: center;
  padding: 2rem 1rem;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  animation: progress-animate 2s infinite;
  border-radius: 12px;
}

@keyframes progress-animate {
  0% {
    width: 10%;
  }
  50% {
    width: 70%;
  }
  100% {
    width: 90%;
  }
}

.loading-text {
  color: #667eea;
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.loading-text span {
  font-weight: 700;
  color: #764ba2;
}

/* ============================================
   SCORE CELL STYLING
   ============================================ */

.score-cell {
  font-size: 1.1rem !important;
  color: #ff9c1a !important;
  font-weight: 700 !important;
}

/* Controls Container - Strict Search & Home Button side by side */
.controls-container {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
  margin-bottom: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.home-btn-top {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
  outline: none;
}

.home-btn-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.home-btn-top:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}