/* Search Modal Styles */

/* Search Overlay */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 20px 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Search Modal */
.search-modal {
  width: 100%;
  max-width: 700px;
  max-height: calc(100vh - 100px);
  background: #181818;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.search-overlay.active .search-modal {
  transform: translateY(0);
}

/* Search Header */
.search-header {
  padding: 20px;
  border-bottom: 1px solid #282828;
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-icon {
  font-size: 25px; /* Increased from 20px (25% larger) */
  color: #b3b3b3;
}

.search-input-container {
  flex: 1;
  position: relative;
}

.search-input {
  width: 100%;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 18px;
  padding: 8px 0;
  outline: none;
}

.search-input::placeholder {
  color: #535353;
}

.close-search-btn {
  background: none;
  border: none;
  color: #b3b3b3;
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s ease, color 0.2s ease;
}

.close-search-btn:hover {
  background: #282828;
  color: #fff;
}

/* Search Results Container */
.search-results-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* Custom scrollbar */
.search-results-container::-webkit-scrollbar {
  width: 12px;
}

.search-results-container::-webkit-scrollbar-track {
  background: transparent;
}

.search-results-container::-webkit-scrollbar-thumb {
  background: #282828;
  border-radius: 6px;
  border: 3px solid #181818;
}

.search-results-container::-webkit-scrollbar-thumb:hover {
  background: #3e3e3e;
}

/* Search Section */
.search-section {
  margin-bottom: 32px;
}

.search-section:last-child {
  margin-bottom: 0;
}

.search-section-title {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 16px 0;
  padding: 0 4px;
}

/* Search Results List */
.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Search Result Item */
.search-result-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.search-result-item:hover {
  background: #282828;
}

.search-result-item:active {
  background: #3e3e3e;
}

/* Search Result Image */
.search-result-image {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

.search-result-icon {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  background: #282828;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

/* Search Result Info */
.search-result-info {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.search-result-subtitle {
  color: #b3b3b3;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Search Result Action */
.search-result-action {
  color: #b3b3b3;
  font-size: 18px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.search-result-item:hover .search-result-action {
  opacity: 1;
}

/* Search Hints */
.search-hint {
  color: #b3b3b3;
  font-size: 14px;
  margin: 8px 0;
  padding: 0 4px;
}

.search-hint kbd {
  display: inline-block;
  padding: 3px 8px;
  background: #282828;
  border: 1px solid #3e3e3e;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
  color: #fff;
  margin: 0 2px;
}

/* Empty State */
.search-empty {
  text-align: center;
  padding: 40px 20px;
}

.search-empty p {
  color: #b3b3b3;
  font-size: 15px;
  margin: 8px 0;
}

.search-empty p:first-child {
  color: #fff;
  font-size: 18px;
  font-weight: 500;
}

/* Loading State */
.search-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 16px;
}

.search-loading .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #282828;
  border-top-color: #1db954;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.search-loading p {
  color: #b3b3b3;
  font-size: 14px;
}

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

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .search-overlay {
    padding: 20px 12px 12px;
  }
  
  .search-modal {
    max-height: calc(100vh - 40px);
    border-radius: 8px;
  }
  
  .search-header {
    padding: 16px;
  }
  
  .search-input {
    font-size: 16px; /* Prevent zoom on iOS */
  }
  
  .search-results-container {
    padding: 16px;
  }
  
  .search-section {
    margin-bottom: 24px;
  }
  
  .search-section-title {
    font-size: 14px;
    margin-bottom: 12px;
  }
  
  .search-result-item {
    padding: 8px;
    gap: 12px;
  }
  
  .search-result-image,
  .search-result-icon {
    width: 40px;
    height: 40px;
  }
  
  .search-result-icon {
    font-size: 20px;
  }
  
  .search-result-title {
    font-size: 14px;
  }
  
  .search-result-subtitle {
    font-size: 12px;
  }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
  .search-modal {
    max-width: 600px;
  }
}

/* Animation for result items */
.search-result-item {
  animation: fadeInUp 0.3s ease;
}

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

/* Stagger animation for multiple results */
.search-result-item:nth-child(1) { animation-delay: 0.05s; }
.search-result-item:nth-child(2) { animation-delay: 0.1s; }
.search-result-item:nth-child(3) { animation-delay: 0.15s; }
.search-result-item:nth-child(4) { animation-delay: 0.2s; }
.search-result-item:nth-child(5) { animation-delay: 0.25s; }
.search-result-item:nth-child(n+6) { animation-delay: 0.3s; }

/* Focus styles */
.search-input:focus {
  outline: none;
}

/* Selection styles */
.search-result-item::selection,
.search-result-title::selection,
.search-result-subtitle::selection {
  background: #1db954;
  color: #fff;
}
