/* 
 * map-search-ui-enhanced.css
 * Enhanced search box and category filter UI
 */

/* Enhanced Search Container */
.map-search-container {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 600px;
  z-index: 1000;
}

/* Enhanced Search Box */
.map-search-box {
  display: flex;
  align-items: center;
  background: white;
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 4px 8px 4px 24px;
  transition: all 0.3s ease;
}

.map-search-box:hover {
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.2);
}

.map-search-box:focus-within {
  box-shadow: 0 6px 24px rgba(255, 107, 53, 0.25);
  outline: 2px solid #ff6b35;
  outline-offset: 0;
}

.map-search-box .search-icon {
  font-size: 24px;
  color: #ff6b35;
  margin-right: 12px;
  flex-shrink: 0;
}

.map-search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 18px;
  color: #212529;
  background: transparent;
  padding: 14px 8px;
  font-weight: 500;
}

.map-search-box input::placeholder {
  color: #adb5bd;
  font-weight: 400;
}

.map-search-box .search-btn {
  background: linear-gradient(135deg, #ff6b35 0%, #ff8a65 100%);
  color: white;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  min-width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.map-search-box .search-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 107, 53, 0.4);
}

.map-search-box .search-btn:active {
  transform: translateY(0);
}

/* Enhanced Category Filter */
.map-category-container {
  position: absolute;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 800px;
  z-index: 999;
  margin-top: 8px;
}

.map-category-container::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 100%;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.9));
  pointer-events: none;
  z-index: 1;
}

[data-theme='dark'] .map-category-container::after {
  background: linear-gradient(to right, transparent, rgba(15, 20, 25, 0.9));
}

.map-category-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 12px 8px;
  padding-right: 40px;
  scrollbar-width: thin;
  scrollbar-color: #ff6b35 transparent;
  -webkit-overflow-scrolling: touch;
}

.map-category-scroll::-webkit-scrollbar {
  height: 6px;
}

.map-category-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.map-category-scroll::-webkit-scrollbar-thumb {
  background: #ff6b35;
  border-radius: 3px;
}

.map-category-scroll::-webkit-scrollbar-thumb:hover {
  background: #ff8a65;
}

/* Enhanced Category Buttons */
.map-category-btn {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: white;
  border: 2px solid #e9ecef;
  border-radius: 50px;
  color: #495057;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.map-category-btn .emoji {
  font-size: 20px;
  filter: grayscale(100%);
  transition: filter 0.3s ease;
}

.map-category-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: #ff6b35;
  color: #ff6b35;
}

.map-category-btn:hover .emoji {
  filter: grayscale(0%);
}

.map-category-btn.active {
  background: linear-gradient(135deg, #ff6b35 0%, #ff8a65 100%);
  border-color: #ff6b35;
  color: white;
  box-shadow: 0 4px 16px rgba(255, 107, 53, 0.4);
  transform: translateY(-2px);
}

.map-category-btn.active .emoji {
  filter: grayscale(0%) brightness(1.2);
}

/* Test Data Button */
.test-data-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, #00b894 0%, #00d2a0 100%);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 184, 148, 0.3);
  transition: all 0.3s ease;
  z-index: 1001;
  display: flex;
  align-items: center;
  gap: 8px;
}

.test-data-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 184, 148, 0.4);
}

.test-data-btn .icon {
  font-size: 18px;
}

/* Loading Overlay */
.map-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.map-loading-content {
  text-align: center;
  padding: 40px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.map-loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid #e9ecef;
  border-top: 4px solid #ff6b35;
  border-radius: 50%;
  animation: toko-spin 0.8s linear infinite;
  margin: 0 auto 20px;
}

/* @keyframes spin: uses toko-spin from loading-system.css */

.map-loading-text {
  font-size: 18px;
  font-weight: 600;
  color: #495057;
  margin-top: 16px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .map-search-container {
    width: calc(100% - 40px);
    max-width: none;
  }

  .map-search-box {
    padding: 4px 8px 4px 16px;
  }

  .map-search-box input {
    font-size: 16px;
    padding: 12px 8px;
  }

  .map-search-box .search-icon {
    font-size: 20px;
    margin-right: 8px;
  }

  .map-search-box .search-btn {
    padding: 10px 20px;
    font-size: 14px;
  }

  .map-category-container {
    width: calc(100% - 40px);
    max-width: none;
  }

  .map-category-btn {
    padding: 10px 20px;
    font-size: 14px;
  }

  .map-category-btn .emoji {
    font-size: 18px;
  }

  .test-data-btn {
    padding: 10px 20px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .map-search-container {
    width: calc(100% - 20px);
    top: 10px;
  }

  .map-search-box {
    padding: 2px 6px 2px 12px;
  }

  .map-search-box input {
    font-size: 14px;
    padding: 10px 6px;
  }

  .map-search-box .search-icon {
    font-size: 18px;
    margin-right: 6px;
  }

  .map-search-box .search-btn {
    padding: 8px 16px;
    font-size: 13px;
  }

  .map-category-container {
    width: calc(100% - 20px);
    top: 70px;
  }

  .map-category-scroll {
    gap: 8px;
    padding: 8px 4px;
  }

  .map-category-btn {
    padding: 8px 16px;
    font-size: 13px;
  }

  .map-category-btn .emoji {
    font-size: 16px;
  }

  .test-data-btn {
    top: 10px;
    right: 10px;
    padding: 8px 16px;
    font-size: 12px;
  }

  .test-data-btn .icon {
    font-size: 16px;
  }
}

/* Suggestion List Styles */
.suggestion-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 8px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  max-height: 400px;
  overflow-y: auto;
  z-index: 1001;
}

.suggestion-section {
  padding: 8px 0;
  border-bottom: 1px solid #e9ecef;
}

.suggestion-section:last-child {
  border-bottom: none;
}

.section-header {
  padding: 8px 20px;
  font-size: 12px;
  font-weight: 700;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.suggestion-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.2s ease;
  gap: 12px;
}

.suggestion-item:hover,
.suggestion-item.selected {
  background: #fff5f2;
}

.suggestion-item.tokotoko:hover,
.suggestion-item.tokotoko.selected {
  background: linear-gradient(135deg, #fff5f2 0%, #ffe8e0 100%);
}

.suggestion-item.google:hover,
.suggestion-item.google.selected {
  background: #f0f7ff;
}

.suggestion-item.history {
  opacity: 0.8;
}

.suggestion-item.history:hover {
  background: #f8f9fa;
}

.suggestion-item .item-icon {
  font-size: 20px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.suggestion-item .item-content {
  flex: 1;
  min-width: 0;
}

.suggestion-item .item-name {
  font-size: 15px;
  font-weight: 600;
  color: #212529;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-item .item-meta {
  font-size: 13px;
  color: #6c757d;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-item .item-meta .separator {
  margin: 0 6px;
  color: #adb5bd;
}

.suggestion-item .item-text {
  flex: 1;
  font-size: 14px;
  color: #495057;
}

.suggestion-item .badge {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  background: #ff6b35;
  color: white;
  flex-shrink: 0;
}

.suggestion-item .remove-history {
  background: none;
  border: none;
  color: #adb5bd;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 50%;
  transition: all 0.2s;
}

.suggestion-item .remove-history:hover {
  background: #e9ecef;
  color: #495057;
}

/* Place Info Bottom Panel - replaces InfoWindow */
.map-place-bottom-panel {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 500px;
  background: white;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
  z-index: 1100;
  transition: transform 0.3s ease;
  padding: 20px 24px 24px;
}

.map-place-bottom-panel.show {
  transform: translateX(-50%) translateY(0);
}

.map-place-bottom-panel-handle {
  width: 48px;
  height: 5px;
  background: #dee2e6;
  border-radius: 3px;
  margin: 0 auto 16px;
  cursor: grab;
}

.map-place-bottom-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.map-place-bottom-panel-title {
  font-size: 20px;
  font-weight: 700;
  color: #212529;
  margin: 0;
  flex: 1;
  padding-right: 16px;
}

.map-place-bottom-panel-badge {
  background: #ff6b35;
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.map-place-bottom-panel-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #f8f9fa;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  color: #6c757d;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.map-place-bottom-panel-close:hover {
  background: #e9ecef;
  color: #212529;
}

.map-place-bottom-panel-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 14px;
  color: #6c757d;
}

.map-place-bottom-panel-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #ff6b35;
  font-weight: 600;
}

.map-place-bottom-panel-category {
  display: flex;
  align-items: center;
  gap: 6px;
}

.map-place-bottom-panel-distance {
  display: flex;
  align-items: center;
  gap: 4px;
}

.map-place-bottom-panel-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.map-place-bottom-panel-actions button {
  flex: 1;
  padding: 14px 16px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.map-place-bottom-panel-actions .btn-detail {
  background: #ff6b35;
  color: white;
}

.map-place-bottom-panel-actions .btn-detail:hover {
  background: #e55a2b;
}

.map-place-bottom-panel-actions .btn-board {
  background: #4ecdc4;
  color: white;
}

.map-place-bottom-panel-actions .btn-board:hover {
  background: #3dbdb5;
}

.map-place-bottom-panel-actions .btn-favorite {
  background: #f8f9fa;
  color: #495057;
  min-width: 56px;
  max-width: 56px;
  padding: 14px;
}

.map-place-bottom-panel-actions .btn-favorite:hover {
  background: #e9ecef;
}

.map-place-bottom-panel-actions .btn-favorite.active {
  background: #fff3e0;
  color: #ff6b35;
}

/* Map overlay when bottom panel is open */
.map-overlay-dim {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1050;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.map-overlay-dim.show {
  opacity: 1;
  pointer-events: auto;
}

/* Accessibility */
.map-search-box input:focus,
.map-category-btn:focus,
.test-data-btn:focus {
  outline: 3px solid rgba(255, 107, 53, 0.5);
  outline-offset: 2px;
}

/* Animation for category buttons */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.map-category-btn {
  animation: slideIn 0.3s ease-out;
}

/* Pulse animation for test data button */
@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 4px 12px rgba(0, 184, 148, 0.3);
  }
  50% {
    box-shadow: 0 4px 20px rgba(0, 184, 148, 0.5);
  }
}

.test-data-btn {
  animation: pulse 2s ease-in-out infinite;
}
