/* ===== SHARED UI COMPONENTS ===== */
/* Dark mode toggle, search, back-to-top, wishlist */
/* Included on blog/quiz pages that have their own CSS system */

/* Dark Mode Toggle */
.dark-mode-toggle {
  background: none;
  border: 1.5px solid #E8E6E1;
  border-radius: 50px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 0.85rem;
  color: #6B6B6B;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 12px;
  white-space: nowrap;
}

.dark-mode-toggle:hover {
  border-color: #E8A0BF;
  color: #E8A0BF;
}

/* Search Toggle */
.search-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: #6B6B6B;
  padding: 4px 8px;
  transition: color 0.25s ease;
  display: flex;
  align-items: center;
}

.search-toggle:hover { color: #1A1A1A; }

/* Wishlist Counter */
.wishlist-counter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: #6B6B6B;
  cursor: pointer;
}

.wishlist-count-badge {
  background: #E8A0BF;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Navbar Actions */
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Search Overlay */
.search-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 100px;
  backdrop-filter: blur(4px);
}

.search-overlay.open { display: flex; }

.search-modal {
  background: #FFFFFF;
  border-radius: 12px;
  width: 90%;
  max-width: 640px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  overflow: hidden;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  gap: 12px;
  border-bottom: 1px solid #E8E6E1;
}

.search-input-wrap .search-icon {
  font-size: 1.2rem;
  color: #8A8A8A;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1.05rem;
  font-family: 'DM Sans', sans-serif;
  color: #1A1A1A;
  background: transparent;
}

.search-input::placeholder { color: #8A8A8A; }

.search-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  color: #8A8A8A;
  padding: 4px 10px;
  border-radius: 8px;
  background: #F0EBE3;
  font-family: 'DM Sans', sans-serif;
}

.search-results {
  overflow-y: auto;
  padding: 8px;
  flex: 1;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: background 0.25s;
}

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

.search-result-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #F8E8E0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.search-result-text h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 2px; }
.search-result-text p { font-size: 0.78rem; color: #8A8A8A; }
.search-no-results { text-align: center; padding: 40px 20px; color: #8A8A8A; font-size: 0.95rem; }
.search-hint { padding: 20px; text-align: center; color: #8A8A8A; font-size: 0.85rem; }

/* Back to Top */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #E8A0BF;
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: #D88AAD;
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

/* Dark mode for blog/quiz pages */
body.dark-mode {
  --color-bg: #1A1618;
  --color-surface: #222020;
  --color-text: #F0EAEC;
  --color-text-muted: #C0B8BB;
  --color-border: #3A3035;
  --color-accent-light: #2A2025;
  --color-tag-bg: #3A2530;
  --color-highlight: #2A2025;
}

body.dark-mode .navbar {
  background: rgba(26,22,24,0.92);
  border-bottom-color: rgba(255,255,255,0.06);
}

body.dark-mode .search-modal {
  background: #252022;
}

body.dark-mode .search-input {
  color: #F0EAEC;
}

@media (max-width: 768px) {
  .dark-mode-toggle .toggle-text { display: none; }
  .back-to-top { bottom: 20px; right: 20px; width: 42px; height: 42px; }
}
