/* Top bar for every page, guest and member (common/_guest_menu.twig, common/_member_menu.twig,
   structure/en/common/topmenu.mod.php). Loaded after style2015*.css: restyles the same markup and ids
   (the menu JavaScript relies on them), keeps the bar height (48px desktop, 50px mobile) so page offsets still fit. */

#menu.menu {
  background: #e8004f;
  background: linear-gradient(90deg, #ef0054 0%, #d6004b 100%);
  box-shadow: 0 1px 0 rgba(0,0,0,.06), 0 4px 18px rgba(170,0,60,.25);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
#menu.menu ul { list-style: none; }
#menu.menu a, #menu.menu a:hover { text-decoration: none; }
#menu .main_logo { transition: opacity .15s; }
#menu .main_logo:hover { opacity: .85; }

/* Icon buttons (search, people, chat, bell, avatar): round, with a soft hover. */
#menu .menu1 > ul > li > a, #menu .menu3 > ul > li > a {
  display: inline-flex; align-items: center; justify-content: center;
  position: relative; min-width: 38px; height: 38px; border-radius: 19px;
  transition: background-color .15s;
}
#menu .menu1 > ul > li > a:hover, #menu .menu3 > ul > li > a:hover { background: rgba(255,255,255,.16); }
#menu .menu1 > ul > li > a img, #menu .menu3 > ul > li > a img { width: 30px; height: 30px; }
#menu .menu1 > ul > li > a img[alt="avatar"], #menu .menu3 > ul > li > a img[alt="menu"][src*="/users"] {
  width: 32px; height: 32px; box-shadow: 0 0 0 2px rgba(255,255,255,.85);
}

/* Unread counters (the menu JavaScript and /menu/* put inline-styled <sup><span> before the icon). */
#menu sup { position: absolute; top: 2px; right: 1px; line-height: 0; z-index: 1; }
#menu sup span {
  position: static !important; display: inline-block; min-width: 18px; height: 18px; box-sizing: border-box;
  padding: 0 5px !important; border-radius: 9px; background: #111 !important; color: #fff !important;
  font: 600 11px/18px system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif !important; text-align: center;
  box-shadow: 0 0 0 2px #e8004f;
}

/* Balance link: a quiet pill. */
#menu .menu1 > ul > li > a[href="/activity-report"], #menu .menu3 > ul > li > a[href="/activity-report"] {
  padding: 0 12px; height: 30px; border-radius: 15px; background: rgba(255,255,255,.14);
  font-weight: 600; font-size: 13px; letter-spacing: .01em; white-space: nowrap;
}
#menu .menu1 > ul > li > a[href="/activity-report"]:hover { background: rgba(255,255,255,.24); }

/* Member search box. */
#menu .menu1 input[type=text] {
  width: 240px !important; height: 34px; box-sizing: border-box; margin: 0 !important;
  padding: 0 36px 0 14px !important; border: 1px solid rgba(255,255,255,.28) !important; border-radius: 17px;
  background-color: rgba(255,255,255,.16) !important; background-position: right 10px center !important;
  color: #fff; font-size: 14px; transition: background-color .15s, border-color .15s, width .2s;
}
#menu .menu1 input[type=text]::placeholder { color: rgba(255,255,255,.8); }
#menu .menu1 input[type=text]:focus { background-color: rgba(255,255,255,.26) !important; border-color: rgba(255,255,255,.6) !important; width: 280px !important; }

/* Guest sign-in form. */
#menu .toplogin { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0; height: 48px; }
#menu .toplogin li { margin: 0 !important; display: flex; align-items: center; gap: 8px; }
#menu .toplogin li:empty { display: none; }
#menu .toplogin span { margin: 0 !important; }
#menu .toplogin input[type=text], #menu .toplogin input[type=password] {
  width: 170px !important; height: 34px; box-sizing: border-box; padding: 0 14px;
  border: 1px solid rgba(255,255,255,.28); border-radius: 17px; background: rgba(255,255,255,.16);
  color: #fff; font-size: 14px; transition: background-color .15s, border-color .15s;
}
#menu .toplogin input::placeholder { color: rgba(255,255,255,.8); }
#menu .toplogin input[type=text]:focus, #menu .toplogin input[type=password]:focus { background: rgba(255,255,255,.26); border-color: rgba(255,255,255,.6); }
#menu .toplogin input.sign_in {
  height: 34px; margin: 0; padding: 0 18px; border-radius: 17px; border: 0;
  background: #fff !important; color: #d6004b !important; font-weight: 700; font-size: 14px; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.12); transition: transform .1s, box-shadow .15s;
}
#menu .toplogin input.sign_in:hover { box-shadow: 0 4px 14px rgba(0,0,0,.2); }
#menu .toplogin input.sign_in:active { transform: translateY(1px); }
#menu .toplogin a { font-size: 13px; color: rgba(255,255,255,.9); white-space: nowrap; }
#menu .toplogin a:hover { color: #fff; text-decoration: underline; }

/* ---- Dropdowns: friend requests, messages, notifications, account, search results ---- */
#menu .menu1 li { position: relative; }
#menu .tg-badge, .tg-badge {
  position: absolute; top: 0; right: -2px; z-index: 1; min-width: 18px; height: 18px; box-sizing: border-box;
  padding: 0 5px; border-radius: 9px; background: #111; color: #fff; text-align: center;
  font: 700 11px/18px system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; box-shadow: 0 0 0 2px #e8004f;
  pointer-events: none;
}
.tg-dd {
  display: none; position: absolute; top: calc(100% + 10px); right: -6px; z-index: 200;
  width: 370px; max-width: calc(100vw - 24px); box-sizing: border-box;
  background: #fff; color: #333; border-radius: 16px; text-align: left;
  box-shadow: 0 18px 50px rgba(20,0,10,.22), 0 2px 8px rgba(0,0,0,.08);
  font: 400 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
}
.tg-dd.open { display: block; animation: tgDdIn .14s ease-out; }
@keyframes tgDdIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
#menu .tg-dd a, #menu .tg-dd a:hover { color: inherit; text-decoration: none; }
#menu .tg-dd ul, #menu .tg-dd li { float: none; }
.tg-dd-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 14px 18px 10px; font-weight: 700; font-size: 16px; color: #111;
}
#menu .tg-dd-head a { font-size: 13px; font-weight: 600; color: #d6004b; padding: 4px 8px; border-radius: 8px; }
#menu .tg-dd-head a:hover { background: #fdeaf1; }
.tg-dd-count { background: #fdeaf1; color: #d6004b; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 10px; }

/* Rows (also used inside the mobile side panel and the old pages' boxes) */
.tg-dd-list { list-style: none; float: none !important; margin: 0 !important; padding: 0 6px 6px !important; max-height: 420px; overflow-y: auto; background: transparent !important; line-height: 1.35 !important; }
.tg-dd-list li.tg-dd-item, .tg-dd-list li.tg-dd-item:hover { display: block !important; position: relative !important; margin: 0 !important; border: 0 !important; background: none !important; color: inherit !important; padding: 0 !important; font-size: 14px !important; border-radius: 12px; position: relative; width: auto !important; }
.tg-dd-list li.tg-dd-item > a, .tg-dd-row {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; color: #333 !important; text-decoration: none !important;
}
.tg-dd-list li.tg-dd-item > a:hover { background: #f5f5f7; }
.tg-dd-list li.tg-dd-item.is-new > a, .tg-dd-list li.tg-dd-item.is-new > .tg-dd-row { background: #fff3f7; }
.tg-dd-list li.tg-dd-item.is-new > a:hover { background: #ffe8f0; }
.tg-dd-list li.tg-dd-item.is-new > a::after { /* unread dot */
  content: ""; flex: 0 0 8px; height: 8px; border-radius: 50%; background: #ef0054; margin-left: auto;
}
.tg-dd-av {
  flex: 0 0 42px; width: 42px; height: 42px; border-radius: 50%; display: block;
  background: #eee center / cover no-repeat; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}
.tg-dd-av-lg { flex-basis: 52px; width: 52px; height: 52px; }
.tg-dd-body { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 2px; }
.tg-dd-text { color: #333; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tg-dd-text strong { color: #111; font-weight: 600; }
.tg-dd-snippet { color: #666; }
.tg-dd-time { font-size: 12px; color: #999; }
.tg-dd-item.is-new .tg-dd-time { color: #d6004b; font-weight: 600; }
.tg-dd-empty { padding: 26px 18px 30px !important; text-align: center; color: #888; font-size: 14px; list-style: none; }
.tg-dd-foot { border-top: 1px solid #f0f0f0; text-align: center; }
#menu .tg-dd-foot a, .tg-dd-foot a { display: block; padding: 11px; font-weight: 600; font-size: 13px; color: #d6004b !important; }
.tg-dd-foot a:hover { background: #fafafa; }

/* Friend request buttons */
.tg-dd-actions { display: flex; gap: 8px; margin: 6px 0 0; }
.tg-btn {
  flex: 1; height: 32px; padding: 0 14px; border-radius: 10px; border: 0; cursor: pointer;
  background: #f0f0f2; color: #333; font: 600 13px/32px system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  transition: background-color .15s, transform .1s;
}
.tg-btn:hover { background: #e4e4e8; }
.tg-btn:active { transform: translateY(1px); }
.tg-btn-primary { background: #ef0054; color: #fff; }
.tg-btn-primary:hover { background: #d6004b; }

/* Account dropdown */
.tg-dd-user { width: 300px; padding: 8px; }
.tg-dd-profile { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; }
.tg-dd-profile:hover { background: #f5f5f7; }
.tg-dd-profile strong { display: block; font-size: 16px; color: #111; }
.tg-dd-profile small { display: block; font-size: 13px; color: #888; }
.tg-dd-balance {
  display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 8px; padding: 10px 14px;
  border-radius: 12px; background: linear-gradient(90deg, #fff0f5, #fde6ee); color: #a3003a !important; font-size: 13px;
}
.tg-dd-balance strong { font-size: 15px; color: #d6004b; }
.tg-dd-links { display: flex; flex-direction: column; padding: 6px 0; border-top: 1px solid #f0f0f0; border-bottom: 1px solid #f0f0f0; }
.tg-dd-links a, .tg-dd-signout {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: #333; font-size: 14px;
}
.tg-dd-links a svg, .tg-dd-signout svg { color: #888; flex: 0 0 18px; }
.tg-dd-links a:hover { background: #f5f5f7; }
.tg-dd-links a:hover svg { color: #d6004b; }
#menu .tg-dd-signout { margin-top: 6px; color: #c81e1e; font-weight: 600; }
.tg-dd-signout svg { color: #c81e1e !important; }
.tg-dd-signout:hover { background: #fff0f0; }

/* Search results under the search box */
.tg-dd-find { left: 0; right: auto; width: 300px; padding-top: 6px; }
.tg-dd-find .tg-dd-av { flex-basis: 34px; width: 34px; height: 34px; }

/* Old pages (structure/en/common/topmenu.mod.php) still use their black-bordered boxes: make them cards too. */
#menu .menu1_box { border: 0 !important; border-radius: 14px; margin-top: 8px; box-shadow: 0 12px 40px rgba(0,0,0,.18); padding: 8px 0 !important; min-width: 300px; }
#menu .menu1_box .tg-dd-list li { margin-left: 0 !important; }
.hzuser { background: rgba(255,255,255,.97) !important; box-shadow: 0 6px 20px rgba(0,0,0,.08); }

/* Mobile side panels (avatar and bell on phones). */
.sidenav#mySidenav1, .sidenav#mySidenav2 { border-left: 0 !important; box-shadow: -8px 0 30px rgba(0,0,0,.15); background: #fff; }
.sidenav .menu_mob_list li a { display: block; padding: 4px 0; color: #333; }
.sidenav .tg-dd-list { max-height: none; padding: 0 !important; }
.sidenav .tg-dd-list li.tg-dd-item > a { padding: 10px 12px; }
.sidenav .tg-dd-list li.tg-dd-item > a .tg-dd-av { flex-basis: 36px; width: 36px; height: 36px; }
.sidenav .menu_mob_list input[type=button] { border-radius: 20px; }

@media (min-width:768px) {
  #menu .menu1 { height: 48px; display: flex; align-items: center; }
  #menu .menu1 > ul, #menu .menu1 > form > ul { margin: 0; display: flex; align-items: center; gap: 6px; float: none; }
  #menu .menu1 > ul > li { margin: 0 !important; display: flex; align-items: center; }
  #menu .menu2 ul { margin-top: 2px; }
}
@media (max-width:767px) {
  #menu .menu3 ul { margin: 6px 6px 0 0; padding: 0; display: flex; align-items: center; gap: 2px; }
  #menu .menu3 li { margin: 0; display: flex; align-items: center; }
  #menu .menu3 li > a img { width: 28px; height: 28px; }
  #menu .menu3 a[href="/activity-report"] { height: 28px; font-size: 12px; padding: 0 10px; }
  #menu .main_logo { margin-top: 1px; }
}
/* Guest buttons (desktop .toplogin and phone .menu3): Join = white, Sign in = outlined. */
#menu.menu ul li a.tg-hbtn {
  display: inline-flex !important; align-items: center; justify-content: center; box-sizing: border-box;
  min-width: 0 !important; height: 34px !important; padding: 0 18px !important; border-radius: 17px !important;
  border: 1.5px solid rgba(255,255,255,.75); background: transparent; color: #fff !important;
  font: 600 14px/1 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; white-space: nowrap; text-decoration: none !important;
  transition: background-color .15s, box-shadow .15s, border-color .15s;
}
#menu.menu ul li a.tg-hbtn:hover { background: rgba(255,255,255,.14); border-color: #fff; }
#menu.menu ul li a.tg-hbtn-solid { background: #fff; border-color: #fff; color: #d6004b !important; font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
#menu.menu ul li a.tg-hbtn-solid:hover { background: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
#menu.menu .menu3 ul li a.tg-hbtn { height: 32px !important; padding: 0 14px !important; font-size: 13px; }
#menu .menu3 ul:has(.tg-hbtn) { gap: 8px; margin-top: 9px; }
