/* Search Page Specific Styles */

.container.wide {
  max-width: 1200px;
}

/* Language Toggle in Header */
.language-toggle-header {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.language-toggle-header span {
  padding-top:6px;
  color:#666666;
}

.language-toggle-header .lang-btn {
  padding: 8px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  color: #b3b3b3;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.language-toggle-header .lang-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.language-toggle-header .lang-btn.active {
  background: rgba(29, 185, 84, 0.2);
  border-color: #1db954;
  color: #1db954;
}

/* Navigation */
.nav-links {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 20px;
}

.nav-links a {
  color: #b3b3b3;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 20px;
  transition: all 0.3s;
}

.nav-links a:hover {
  color: #1db954;
  background: rgba(29, 185, 84, 0.1);
}

.nav-links a.active {
  color: #1db954;
  background: rgba(29, 185, 84, 0.2);
}

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

.search-input-wrapper {
  display: flex;
  gap: 10px;
  max-width: 700px;
  margin: 0 auto;
}

.search-buttons-row {
  display: flex;
  gap: 10px;
}

.search-input-wrapper input {
  flex: 1;
  padding: 16px 20px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  font-size: 1.1rem;
  transition: all 0.3s;
}

.search-input-wrapper input:focus {
  outline: none;
  border-color: #1db954;
  background: rgba(255, 255, 255, 0.08);
}

.search-input-wrapper input::placeholder {
  color: #888;
}

.search-input-wrapper button, #clearBtn {
  padding: 16px 30px;
  background: #1db954;
  color: #000;
  border: none;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

#clearBtn {
  padding: 20px 30px !important;
  border-radius: 30px;
  background:#666666;
}

.search-input-wrapper button:hover {
  background: #1ed760;
}

.search-input-wrapper button:disabled {
  background: #535353;
  color: #ffffff;
  cursor: not-allowed;
}

/* Bouncing dots animation */
.bouncing-dots {
  display: inline-flex;
  margin-left: 2px;
}

.bouncing-dots span {
  animation: bounce 1.4s infinite ease-in-out both;
}

.bouncing-dots span:nth-child(1) {
  animation-delay: 0s;
}

.bouncing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.bouncing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-4px);
  }
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.loading-overlay.visible {
  display: flex;
}

.loading-content {
  background: rgba(30, 30, 50, 0.95);
  padding: 30px 50px;
  border-radius: 12px;
  border: 1px solid rgba(29, 185, 84, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  color: #ffffff;
  font-size: 1.4rem;
  font-weight: 500;
}

.loading-content .bouncing-dots span {
  font-size: 1.4rem;
}

/* Tags Section */
.tags-section {
  margin-bottom: 40px;
  text-align: center;
}

.tags-section h2 {
  color: #ffffff;
  margin-bottom: 20px;
  font-size: 1.2rem;
}

.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 800px;
  margin: 0 auto;
}

.tag {
  display: inline-block;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  color: #b3b3b3;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
}

.tag:hover {
  background: rgba(29, 185, 84, 0.2);
  border-color: #1db954;
  color: #1db954;
}

.tag-show-all {
  background: rgba(29, 185, 84, 0.15);
  border-color: #1db954;
  color: #1db954;
  font-weight: bold;
  font-size: 1.1rem;
  padding: 8px 18px;
}

.tag-show-all:hover {
  background: #1db954;
  color: #000;
}

/* Results Section */
.results-section {
  margin-bottom: 40px;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.results-header h2 {
  color: #ffffff;
  margin: 0;
}

.results-header-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-label {
  color: #888;
  font-size: 0.85rem;
}

.sort-btn {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  color: #888;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.sort-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #b3b3b3;
}

.sort-btn.active {
  background: rgba(29, 185, 84, 0.2);
  border-color: rgba(29, 185, 84, 0.4);
  color: #1db954;
}

.results-count {
  color: #888;
  font-size: 0.9rem;
}

/* Channel Filter Row */
.channel-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-label {
  color: #888;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.channel-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 5px;
  scrollbar-width: thin;
  scrollbar-color: rgba(29, 185, 84, 0.5) transparent;
}

.channel-filters::-webkit-scrollbar {
  height: 4px;
}

.channel-filters::-webkit-scrollbar-track {
  background: transparent;
}

.channel-filters::-webkit-scrollbar-thumb {
  background: rgba(29, 185, 84, 0.5);
  border-radius: 2px;
}

.channel-filter-btn {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  color: #888;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.channel-filter-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #b3b3b3;
}

.channel-filter-btn.active {
  background: rgba(29, 185, 84, 0.2);
  border-color: rgba(29, 185, 84, 0.4);
  color: #1db954;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Episode Card */
.episode-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s;
}

.episode-card:hover {
  border-color: rgba(29, 185, 84, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

.episode-card-content {
  display: flex;
  gap: 20px;
}

.episode-thumbnail-wrapper {
  flex-shrink: 0;
  width: 200px;
  display: block;
  text-decoration: none;
  cursor: pointer;
}

.episode-thumbnail {
  width: 100%;
  height: 112px;
  object-fit: cover;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.episode-thumbnail.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 0.8rem;
}

.episode-details {
  flex: 1;
  min-width: 0;
}

.episode-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 10px;
}

.episode-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.episode-card h3 {
  color: #ffffff;
  font-size: 1.1rem;
  margin: 0;
}

.channel-name {
  color: #888;
  font-size: 0.9rem;
  margin: 0;
}

.episode-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.upload-date {
  color: #888;
  font-size: 0.85rem;
  white-space: nowrap;
}

.relevance-badge {
  background: rgba(29, 185, 84, 0.2);
  color: #1db954;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.episode-card .summary {
  color: #b3b3b3;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 10px;
}

/* Context Snippets */
.context-snippets {
  background: rgba(29, 185, 84, 0.08);
  border-left: 3px solid #1db954;
  padding: 12px 15px;
  margin-bottom: 12px;
  border-radius: 0 8px 8px 0;
}

.snippets-label {
  color: #1db954;
  font-size: 0.8rem;
  text-transform: uppercase;
  margin-bottom: 8px;
  font-weight: 500;
}

.snippet {
  color: #e0e0e0;
  font-style: italic;
  line-height: 1.5;
  font-size: 0.9rem;
  margin-bottom: 8px;
  padding-left: 10px;
  border-left: 2px solid rgba(29, 185, 84, 0.3);
}

.snippet:last-child {
  margin-bottom: 0;
}

.episode-card .keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.episode-card .keyword {
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  color: #888;
}

/* Episode Links */
.episode-links {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.episode-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}

.episode-link.youtube {
  background: rgba(255, 0, 0, 0.15);
  color: #ff4444;
  border: 1px solid rgba(255, 0, 0, 0.3);
}

.episode-link.youtube:hover {
  background: rgba(255, 0, 0, 0.25);
}

.episode-link.spotify {
  background: rgba(29, 185, 84, 0.15);
  color: #1db954;
  border: 1px solid rgba(29, 185, 84, 0.3);
}

.episode-link.spotify:hover {
  background: rgba(29, 185, 84, 0.25);
}

.link-icon {
  font-size: 0.9rem;
}

/* Highlight matched text */
.highlight {
  background: rgba(29, 185, 84, 0.3);
  color: #1db954;
  padding: 0 2px;
  border-radius: 2px;
}

/* No results */
.no-results {
  text-align: center;
  padding: 40px;
  color: #888;
}

.no-results h3 {
  color: #b3b3b3;
  margin-bottom: 10px;
}

/* Footer Stats Section */
.indexed-stats {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
}

.indexed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.2s;
}

.indexed-header:hover {
  background: rgba(255, 255, 255, 0.05);
}

.indexed-title {
  color: #888;
  font-size: 0.9rem;
}

.indexed-title span {
  color: #1db954;
  font-weight: 600;
}

.expand-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(29, 185, 84, 0.2);
  border: none;
  color: #1db954;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
}

.expand-btn:hover {
  background: rgba(29, 185, 84, 0.4);
}

.indexed-list {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 16px;
  max-height: 200px;
  overflow-y: auto;
}

.indexed-channel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.85rem;
}

.indexed-channel:last-child {
  border-bottom: none;
}

.indexed-channel .channel-name {
  color: #b3b3b3;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.indexed-channel .channel-stats {
  color: #1db954;
  font-weight: 500;
  margin: 0 15px;
  white-space: nowrap;
}

.indexed-channel .channel-date {
  color: #666;
  font-size: 0.8rem;
  white-space: nowrap;
}

.footer-credit {
  color: #666;
  font-size: 0.85rem;
  text-align: center;
}

/* New Footer Styles */
.footer-content {
  text-align: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  margin-bottom: 15px;
}

.indexed-info {
  color: #b3b3b3;
  font-size: 1rem;
  margin-bottom: 10px;
}

.indexed-info strong {
  color: #1db954;
  font-size: 1.2rem;
}

.footer-note {
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 15px;
}

.suggest-btn {
  padding: 12px 24px;
  background: rgba(29, 185, 84, 0.2);
  border: 1px solid #1db954;
  border-radius: 20px;
  color: #1db954;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.suggest-btn:hover {
  background: #1db954;
  color: #000;
}

/* Suggestion Dialog */
.suggest-dialog {
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0;
  max-width: 500px;
  width: 90%;
  color: #fff;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  max-height: 90vh;
  overflow-y: auto;
}

.suggest-dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dialog-header h2 {
  margin: 0;
  font-size: 1.3rem;
  color: #fff;
}

.dialog-close {
  background: none;
  border: none;
  color: #888;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.dialog-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

#suggestForm {
  padding: 20px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  color: #b3b3b3;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  font-size: 0.95rem;
  transition: all 0.2s;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #1db954;
  background: rgba(255, 255, 255, 0.08);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #666;
}

.form-group select {
  cursor: pointer;
}

.form-group select option {
  background: #1a1a1a;
  color: #fff;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-cancel {
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  color: #b3b3b3;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.btn-submit {
  padding: 12px 24px;
  background: #1db954;
  border: none;
  border-radius: 20px;
  color: #000;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-submit:hover {
  background: #1ed760;
}

.btn-submit:disabled {
  background: #535353;
  color: #888;
  cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
  .search-input-wrapper {
    flex-wrap: wrap;
    gap: 8px;
  }

  .search-input-wrapper input {
    width: 100%;
    flex: none;
  }

  .search-buttons-row {
    display: flex;
    width: 100%;
    gap: 8px;
  }

  #searchBtn {
    flex: 3;
    padding: 16px 20px;
  }

  .search-input-wrapper a {
    flex: 1;
  }

  #clearBtn {
    width: 100%;
    padding: 16px 10px !important;
    box-sizing: border-box;
  }

  .results-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .sort-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .episode-card-content {
    flex-direction: column;
  }

  .episode-thumbnail-wrapper {
    width: 100%;
  }

  .episode-thumbnail {
    height: 180px;
  }

  .episode-card-header {
    flex-direction: column;
    gap: 8px;
  }

  .relevance-badge {
    align-self: flex-start;
  }

  .episode-links {
    flex-direction: column;
  }

  .episode-link {
    justify-content: center;
  }

  /* Full screen dialog on mobile */
  .suggest-dialog {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    top: 0;
    left: 0;
    transform: none;
  }

  .dialog-header {
    position: sticky;
    top: 0;
    background: #1a1a1a;
    z-index: 10;
  }

  #suggestForm {
    padding-bottom: 30px;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions button {
    width: 100%;
  }
}
