body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background-color: #121212;
  color: #fff;
  padding: 20px;
}

/* --- Search --- */
.search-container {
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  margin: 0 auto;
  position: fixed;
}

.back-icon {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 22px;
  color: #00FF00;
}

.search-input {
  flex-grow: 1;
  padding: 5px 5px;
  font-size: 13px;
  border-radius: 30px;
  border: none;
  outline: none;
  background-color: #1e1e1e;
  color: #fff;
}


/* --- Tabs --- */
.tabs {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 40px;
  flex-wrap: wrap;
}

.tab-button {
  background-color: #1e1e1e;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s;
  margin-top: 40px;
}

.tab-button.active,
.tab-button:hover {
  background-color: #3f3f3f;
}

/* --- Sections --- */
.trending-section {
  margin-top: 20px;
  display: none;
}

.trending-section.active {
  display: block;
}

/* --- Media Grid --- */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 15px;
}

.media-item {
  background-color: #1e1e1e;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s;
  text-align: center;
}

.media-item:hover {
  transform: scale(1.05);
}

.media-item img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 600px) {
  body {
    padding: 5px;
  }

  .search-container {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .search-input {
    flex-grow: 1;
    font-size: 12px;
    padding: 5px 5px;
  }

  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 10px;
    margin-top: 20px;
    padding-bottom: 10px;
  }

  .tab-button {
    flex: 0 0 auto;
    font-size: 12px;
    padding: 10px 16px;
    white-space: nowrap;
    margin-top: 65px;
  }

  .section-title {
    font-size: 20px;
  }

  .media-grid {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .media-grid .media-item {
    display: flex;
    align-items: center;
    padding: 5px;
    background-color: #1e1e1e;
    border-radius: 8px;
    border-bottom: 1px solid #333;
  }

  .media-grid .media-item:hover {
    background-color: #2a2a2a;
  }

  .media-grid .media-item img {
    width: 45px;
    height: 65px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 15px;
  }

  .media-grid .media-title {
    font-size: 12px;
    font-weight: 500;
    margin-left: 10px;
  }

  .media-title {
    font-family: Anton;
    color: #ffcc00;
  }

  .media-genre,
  .media-release-date {
    font-size: 10px;
    margin-bottom: 4px;
  }
}


@media screen and (min-width: 601px) {
  .media-grid {
    align-items: stretch;
  }

  .media-item {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .media-item img {
    height: 220px;
    object-fit: cover;
  }

  .media-title,
  .media-release-date,
  .media-genre {
    display: none;
  }
}

@media screen and (max-width: 1024px) {
  .media-title,
  .media-release-date,
  .media-genre {
    margin-top: 5px;
    font-size: 0.9em;
    text-align: left;
  }

  .media-release-date,
  .media-genre {
    margin-left: 10px;
  }

  .media-genre {
    margin-bottom: 10px;
  }

  .media-title {
    font-family: Anton, sans-serif;
    color: #ffcc00;
  }
}

.search-container {
  display: flex;
  align-items: center;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 10px 30px 10px 10px;
  border: 1.5px solid #00FF00;
  border-radius: 20px;
  font-family: Anton;
}

.search-icon {
  position: absolute;
  right: 10px;
  cursor: pointer;
}

.search-icon i {
  font-size: 18px;
  color: #00FF00;
}

.clear-icon {
  position: absolute;
  right: 60px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  cursor: pointer;
  color: #888;
  z-index: 1;
  display: none;
}

.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: #121212;
  align-items: center;
  padding: 20px 10px 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Mobile view adjustments */
@media (max-width: 600px) {
  .top-nav {
    top: 0;
    height: 60px;
    padding: 20px 10px 0;
    background-color: #1a1a1a;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
  }
}


/*suggestion*/
/* --- Suggestions Container --- */
#suggestions-container {
  position: absolute;
  top: 60px;
  left: 0;
  width: 100%;
  height: calc(100vh - 60px);
  background-color: #1e1e1e;
  border-radius: 0 0 8px 8px;
  overflow-y: auto;
  display: none;
  z-index: 100;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#suggestions-container::-webkit-scrollbar {
  display: none;
}

/* --- Suggestion Item --- */
.suggestion-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background-color: #262626;
  border-bottom: 1px solid #333;
  cursor: pointer;
  transition: background 0.3s;
}

.suggestion-item:hover {
  background-color: #333333;
}

/* --- Poster Image --- */
.suggestion-poster {
  width: 50px;
  height: 70px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

/* --- Text Info --- */
.suggestion-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  overflow: hidden;
}

.suggestion-title {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 6px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-meta {
  display: flex;
  flex-direction: column; /* Stack vertically: release date then genre */
  gap: 4px;
  font-size: 0.85rem;
  color: #bbbbbb;
}

.suggestion-date,
.suggestion-genres {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* --- Tablet View (768px–1024px) --- */
@media (max-width: 1024px) {
  .suggestion-item {
    gap: 10px;
    padding: 10px 14px;
  }

  .suggestion-poster {
    width: 55px;
    height: 80px;
  }

  .suggestion-title {
    font-size: 0.95rem;
  }

  .suggestion-meta {
    font-size: 0.8rem;
  }
}

/* --- Mobile View (<= 767px) --- */
@media (max-width: 767px) {
  #suggestions-container {
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    font-size: 14px;
    margin-top: 70px;
    position: fixed;
    z-index: 9999;
    max-width: none;
    box-sizing: border-box;
  }

  .suggestion-item {
    gap: 10px;
    padding: 10px 12px;
  }

  .suggestion-poster {
    width: 40px;
    height: 60px;
  }

  .suggestion-title {
    font-size: 0.9rem;
  }

  .suggestion-meta {
    flex-direction: column;
    gap: 4px;
    font-size: 0.75rem;
  }
}

.voice-icon {
  position: absolute;
  right: 40px;
  font-size: 1.1rem;
  color: #aaa;
  cursor: pointer;
}

.voice-icon {
  right: 15px; /* Position mic to the far right */
}

.search-icon {
  right: 40px; /* Position search icon just before the mic */
}

.clear-icon {
  right: 70px;
  font-size: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
}



/* 🎤 Modal Base */
.voice-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
}
.voice-modal.hidden {
  display: none;
}

/* 📦 Modal Content */
.voice-modal-content {
  background: #1a1a1a;
  color: #fff;
  padding: 20px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 12px;
  position: relative;
  animation: popIn 0.3s ease-out forwards;
  will-change: transform, opacity;
}
@keyframes popIn {
  from { transform: scale(0.9); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.voice-modal-content::-webkit-scrollbar {
  display: none;
}

/* ❌ Close Button */
.voice-close-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 28px;
  font-weight: bold;
  color: red;
  cursor: pointer;
  transition: color 0.2s ease;
}
.voice-close-btn:hover,
.voice-close-btn:focus-visible {
  color: #ff6666;
  outline: none;
}

/* 📃 Result Grid (Default Desktop) */
.voice-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

/* 🃏 Card */
.voice-result-card {
  background: #111;
  border: 1px solid #333;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
  display: flex;
  flex-direction: column;
}
.voice-result-card:hover {
  transform: scale(1.03);
  background: #222;
  box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
}

/* 🖼 Poster (Default) */
.voice-result-card img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  object-position: top;
  border-bottom: 1px solid #444;
}

/* 📝 Info */
.voice-result-info {
  padding: 10px;
  text-align: center;
}
.voice-result-info h3.voice-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 5px 0;
  color: white;
}

.voice-meta {
  font-size: 0.7rem;
  color: #aaa;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.voice-meta .dot-separator {
  display: inline;
}

/* ℹ️ No result message */
.no-results {
  font-size: 16px;
  color: #ccc;
  padding: 20px;
  text-align: center;
}

/* 📱 Mobile Devices */
@media (max-width: 480px) {
  .voice-modal-content {
    padding: 14px;
    max-width: 95%;
  }

  .voice-result-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
  }

  .voice-result-card {
    flex-direction: row;
    align-items: center;
    padding: 8px;
  }

  .voice-result-card img {
    width: 60px;
    height: 90px;
    object-fit: cover;
    object-position: top;
    border-bottom: none;
    border-radius: 4px;
    margin-right: 10px;
  }

  .voice-result-info {
    padding: 0;
    text-align: left;
    flex: 1;
  }

  .voice-result-info h3.voice-title {
    font-size: 14px;
    margin: 0 0 4px;
    line-height: 1.2;
  }

  .voice-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    font-size: 12px;
  }

  .voice-meta .dot-separator {
    display: none;
  }

  .voice-result-info p {
    font-size: 11px;
    color: #ccc;
    margin: 0;
  }

  .voice-close-btn {
    font-size: 22px;
    top: 10px;
    right: 10px;
  }
}

/* 💻 Tablets */
@media (max-width: 768px) {
  .voice-modal-content {
    padding: 18px;
    max-width: 90%;
  }

  .voice-result-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 14px;
  }

  .voice-result-card img {
    height: 70px;
    object-position: top;
  }

  .voice-result-info h3.voice-title {
    font-size: 14px;
  }

  .voice-meta {
    font-size: 12px;
  }
}
