/* ==========================================================
   FILE: /ext/ui-enhancer.css
   Versi Final — Marquee, Floating Search & Floating Nav
   ========================================================== */

/* --- (1) MARQUEE ARTIKEL TERKAIT --- */
#related-marquee-section {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 990;
  overflow: hidden;
  pointer-events: none;
}

#related-marquee-container {
  overflow: hidden;
  white-space: nowrap;
  padding: 0;
}

#related-marquee-container .marquee-content {
  display: inline-block;
  animation: marquee-scroll linear infinite;
  pointer-events: auto;
  padding: 12px 0;
}

#related-marquee-container:hover .marquee-content {
  animation-play-state: paused;
}

#related-marquee-container a {
  color: inherit;
  text-decoration: none;
  margin-right: 30px;
  font-weight: 400;
  font-size: 0.85em;
  opacity: 0.8;
  transition: opacity 0.3s;
}

#related-marquee-container a:hover {
  opacity: 1;
  font-weight: 700;
}

.marquee-message {
  margin: 0;
  text-align: center;
  font-style: italic;
  padding: 8px 0;
  color: var(--muted-color, #aaa);
}

@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* --- (2) FLOATING SEARCH BAR --- */
.search-floating-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1001;
  width: 250px;
  transition: width 0.4s ease-in-out;
}

.search-floating-container:focus-within {
  width: 300px;
}

#floatingSearchInput {
  width: 100%;
  height: 44px;
  padding: 10px 40px;
  font-size: 14px;
  border: 1px solid rgba(128, 128, 128, 0.3);
  border-radius: 25px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  box-sizing: border-box;
  outline: none;
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(6px);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E");
  background-position: 15px center;
  background-repeat: no-repeat;
  transition: border-color 0.3s, background-color 0.3s;
  color: #111;
}

#floatingSearchInput:focus {
  border-color: #007bff;
}

.floating-results-container {
  display: none;
  position: absolute;
  background-color: rgba(255, 255, 255, 0.95);
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 15px 15px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  width: 100%;
  left: 0;
  top: 100%;
  max-height: 400px;
  overflow-y: auto;
  z-index: 999;
  color: #222;
}

.floating-results-container a {
  display: block;
  padding: 12px 15px;
  color: #333;
  text-decoration: none;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.floating-results-container a:last-child {
  border-bottom: none;
}

.floating-results-container a:hover {
  background-color: #f5f5f5;
}

.floating-results-container a small {
  display: block;
  color: #777;
  font-size: 12px;
}

.clear-button {
  display: none;
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 22px;
  color: #999;
  font-weight: bold;
  line-height: 1;
}

.clear-button:hover {
  color: #333;
}

/* --- DARK MODE FIX --- */
@media (prefers-color-scheme: dark) {
  #floatingSearchInput {
    border-color: rgba(255, 255, 255, 0.2);
    background-color: rgba(30, 30, 30, 0.85);
    color: #f5f5f5;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23bbb' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E");
    box-shadow: 0 2px 6px rgba(255, 255, 255, 0.05);
  }

  .floating-results-container {
    background: rgba(25, 25, 25, 0.95);
    color: #f5f5f5;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  }

  .floating-results-container a {
    color: #f5f5f5;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .floating-results-container a:hover {
    background-color: rgba(255, 255, 255, 0.08);
  }

  .floating-results-container a small {
    color: #bbb;
  }

  .clear-button {
    color: #bbb;
  }

  .clear-button:hover {
    color: #fff;
  }

  .floating-results-container .no-results {
    color: #ff6b6b;
    text-align: center;
    padding: 14px;
    font-size: 14px;
  }
}

/* --- (3) FLOATING NAV --- */
.floating-nav {
  position: fixed;
  bottom: 45px;
  left: 20px;
  right: 20px;
  z-index: 998;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
}

.nav-left, .nav-right {
  pointer-events: auto;
}

.nav-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

a.category-link {
  background-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
  color: inherit;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

a.category-link.visible {
  opacity: 1;
  transform: translateY(0);
}
a:link,
a:visited {
  color: inherit;       
  text-decoration: none;
}

.btn-emoji {
  font-size: 2rem;
  text-decoration: none;
  transition: transform 0.2s ease;
  text-shadow: 0 2px 5px rgba(0,0,0,0.4);
  line-height: 1;
}

.btn-emoji:hover {
  transform: scale(1.2);
}

/* --- (4) MOBILE --- */
@media (max-width: 600px) {
  .floating-nav {
    left: 10px;
    right: 10px;
    bottom: 40px;
  }
  .nav-right {
    gap: 8px;
  }
  .btn-emoji {
    font-size: 1.8rem;
  }
  a.category-link {
    font-size: 12px;
    padding: 6px 12px;
  }
}

