/* ./css/menu.css */

/* =========================
   Top bar
   ========================= */
.menu-bar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #0b6623;
  border-bottom: 1px solid #012614;
  overflow: visible; /* let flyouts escape the bar without pushing layout */
}
.menu-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  overflow: visible;
}

/* Primary links on the bar */
.menu-link,
.menu-dd-btn {
  text-decoration: none;
  color: #fff;
  font-size: 15px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
}
.menu-link:hover,
.menu-dd-btn:hover { background: #014421; }

/* Active page highlight (pill) */
.menu-link.active,
.menu-dd-btn.active {
  background: #fff;
  color: #013220;
  font-weight: 600;
}
.menu-link.active:hover,
.menu-dd-btn.active:hover {
  background: #fff;
  color: #013220;
}

.menu-link { position: relative; }

/* Unread notifications bubble */
.menu-bubble {
  position: absolute;
  top: -12px;
  right: -12px;
  background: #dc2626;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  text-align: center;
  display: inline-block;
  pointer-events: none;
  border: 2px solid #fff; 
}

/* =========================
   Dropdowns
   ========================= */
.menu-dd { position: relative; display: inline-block; }
.menu-dd-content {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 12px);
  min-width: 260px;
  max-width: 360px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  padding: 6px;
  z-index: 2000;
  overflow-x: visible; /* allow wide children */
}
.menu-dd.open .menu-dd-content { display: block; }


/* Right-aligned variant */
.menu-dd-right .menu-dd-content { right: 0; left: auto; }

/* Scroll areas */
.menu-dd-scroll { max-height: 360px; overflow-y: auto; padding: 6px 0; }
.menu-dd-scroll,
.menu-mega-left,
.menu-mega-right {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.menu-dd-scroll::-webkit-scrollbar:horizontal,
.menu-mega-left::-webkit-scrollbar:horizontal,
.menu-mega-right::-webkit-scrollbar:horizontal { height: 0; }

/* Generic dropdown items (not Clubs) */
.menu-dd-content .menu-dd-scroll > a:not(.menu-club-link),
.menu-dd-content .menu-dd-scroll > a:not(.menu-club-link):link,
.menu-dd-content .menu-dd-scroll > a:not(.menu-club-link):visited {
  display: block;
  margin: 4px 6px;
  padding: 8px 12px;
  color: #013220;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.menu-dd-content .menu-dd-scroll > a:not(.menu-club-link):hover {
  background-color: #013220;
  color: #fff;
  border-radius: 8px;
}

/* Accessibility focus */
.menu-dd-btn:focus,
.menu-link:focus,
.menu-league-item:focus,
.menu-club-link:focus {
  outline: 2px solid #013220;
  outline-offset: 2px;
  border-radius: 6px;
}

/* =========================
   Mega dropdown (Clubs)
   ========================= */
.menu-dd-content.menu-clubs-dd { min-width: 560px; max-width: 760px; }
.menu-mega { display: grid; grid-template-columns: 240px 1fr; }

/* Left column: leagues */
.menu-mega-left {
  border-right: 1px solid #e5e7eb;
  max-height: 420px;
  overflow-y: auto;
  padding: 6px 0;
}
.menu-league-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  font: inherit;
  padding: 10px 12px;
  cursor: pointer;
  color: #013220;
  border-radius: 0;
}
.menu-league-item:hover,
.menu-league-item:focus {
  background-color: #014421;
  color: #fff;
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}
.menu-league-item.active {
  background-color: #013220;
  color: #fff;
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}

/* Right column: clubs */
.menu-mega-right {
  max-height: 420px;
  overflow-y: auto;
  padding: 6px 0;
}
.menu-clubs-panel { display: none; padding-right: 8px; }
.menu-clubs-panel.active { display: block; }

/* Club rows */
.menu-club-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  text-decoration: none;
  color: #013220;
  line-height: 1.3;
  border-radius: 0 8px 8px 0;
  white-space: normal;
}
.menu-club-link:hover {
  background-color: #013220;
  color: #fff;
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}
.menu-club-logo {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
}
.menu-club-name { display: inline-block; }
.menu-clubs-panel a { line-height: 1.25; }

/* Divider */
.menu-divider { height:1px; background:#e5e7eb; margin:6px 0; }

/* =========================
   Countdown / This Round
   ========================= */
.menu-pill {
  background: #fff;
  color: #013220;
  border-radius: 10px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  line-height: 1.2;
}
.menu-countdown,
.menu-thisround {
  position: relative;
  display: inline-block;
  margin-left: 8px;
}

/* Countdown value */
.menu-countdown-value {
  display: inline-block;
  min-width: 64px; /* unified from duplicates */
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: .3px;
}

/* Header row for countdown */
.cd-head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 8px;
}
.cd-label { font-size: 10px; line-height: 1.05; }
.cd-timer { font-size: 16px; line-height: 1; font-weight: 700; }

/* Flyouts */
.cd-expand, .tr-expand {
  position: absolute;
  left: 50%;
  top: 100%;
  margin-top: 8px;
  z-index: 1000;
  overflow: visible;
  transform: translate(-50%, 0);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 160ms ease;
  will-change: opacity;
}
.menu-countdown.is-open .cd-expand,
.menu-thisround.is-open .tr-expand {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Inner box */
.cd-inner, .tr-inner {
  background: #fff;
  border-radius: 10px;
  background-clip: padding-box;
  outline: 1px solid rgba(0,0,0,.08);
  filter: drop-shadow(0 8px 24px rgba(0,0,0,.12))
          drop-shadow(0 2px 6px rgba(0,0,0,.06));
  box-shadow: none;
  padding: 10px 12px 12px;
  min-width: 480px;
  max-width: 690px;
}

/* Match list styling */
.nm-date {
  font-size: 11px;
  color: #111827;
  text-align: left;
  font-weight: 700;
  margin-bottom: 8px;
}
.nm-grid {
  display: grid;
  grid-template-columns: 1fr 24px 28px 24px 1fr;
  align-items: center;
  column-gap: 10px;
}
.nm-name-home, .nm-name-away {
  font-size: 13px;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nm-name-home { text-align: right; }
.nm-name-away { text-align: left; }
.nm-crest {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  object-fit: contain;
  background: #f3f4f6;
  justify-self: center;
}
.nm-vs { font-size: 12px; color: #6b7280; text-align: center; }

.nm-headline {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 12px;
}
.nm-headtime, .nm-time {
  font-size: 10px;
  color: #111827;
  min-width: 58px;
  text-align: right;
}

.nm-section {
  margin-top: 14px;
  font-size: 13px;
  color: #111827;
  font-weight: 700;
  text-align: center;
}
.nm-day {
  margin-top: 10px;
  font-size: 11px;
  color: #111827;
  font-weight: 700;
}
.nm-list {
  margin-top: 6px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
.nm-item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 12px;
}
.tr-btn { font-size: 16px; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .cd-expand, .tr-expand { transition: none; }
}

/* Ensure sticky stays in effect */
.menu-bar{ position: sticky !important; top: 0; overflow: visible; }

/* reserves horizontal space next to Dashboard, but no vertical growth */
.menu-brand-slot{
  position:relative;
  width: clamp(50px, 5vw, 70px); /* space for logo width */
  height: 0;                     /* prevents header from expanding */
}

/* absolutely place the logo inside the slot */
.menu-brand{
  position:absolute; left:0; top:0; display:block; line-height:0;
}
.menu-brand img {
  height: clamp(50px, 5vw, 70px);
  width: auto;
  transform: translateY(-28px); /* was 20px */
  filter: drop-shadow(0 3px 3px rgba(0,0,0,0.25));
  z-index: 5;
}