/* ==========================================================================
   MSX Global Topmost Fixed Notice Ticker Bar
   ========================================================================== */

.msx-notice-bar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 38px !important;
  z-index: 999999 !important;
  background: linear-gradient(90deg, #5c0808 0%, #a81c00 25%, #d9530f 50%, #a81c00 75%, #5c0808 100%) !important;
  border-bottom: 2px solid #ffd700 !important;
  box-shadow: 0 4px 25px rgba(255, 60, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
  color: #fff !important;
  font-family: 'Outfit', 'Noto Sans Thai', sans-serif !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Adjust all existing navbars so they sit cleanly below this bar */
.navbar-tr, .portal-nav, nav.navbar {
  top: 38px !important;
}

.msx-notice-badge {
  background: #ff0033 !important;
  color: #fff !important;
  font-weight: 800 !important;
  font-size: 0.82rem !important;
  padding: 3px 12px !important;
  border-radius: 4px !important;
  margin-left: 12px !important;
  margin-right: 8px !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  box-shadow: 0 0 12px rgba(255, 0, 50, 0.9), inset 0 0 4px rgba(255,255,255,0.4) !important;
  border: 1px solid #ffd700 !important;
  flex-shrink: 0 !important;
  z-index: 10 !important;
}

.msx-notice-badge i {
  animation: pulse-notice-icon 1.2s infinite ease-in-out;
  color: #ffd700;
}

@keyframes pulse-notice-icon {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); color: #fff; }
}

.msx-notice-marquee-wrap {
  flex-grow: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  mask-image: linear-gradient(to right, transparent, black 15px, black 95%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 15px, black 95%, transparent);
}

.msx-notice-track {
  display: flex;
  white-space: nowrap;
  animation: notice-scroll-fast 28s linear infinite;
  gap: 45px;
  padding-left: 10px;
}

.msx-notice-track:hover {
  animation-play-state: paused;
}

.msx-notice-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.msx-notice-item strong {
  color: #ffe066;
  font-weight: 800;
}

.msx-notice-item a {
  color: #00ffff !important;
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 8px;
  border-radius: 4px;
  text-decoration: none !important;
  border: 1px solid rgba(0, 255, 255, 0.5);
  font-weight: 700;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.msx-notice-item a:hover {
  color: #000 !important;
  background: #00ffff !important;
  box-shadow: 0 0 12px #00ffff;
}

.msx-notice-sep {
  color: #ffd700;
  font-size: 0.85rem;
  opacity: 0.8;
}

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

@media (max-width: 768px) {
  .msx-notice-bar {
    height: 42px !important;
  }
  .navbar-tr, .portal-nav, nav.navbar {
    top: 42px !important;
  }
  .msx-notice-badge {
    padding: 2px 8px !important;
    font-size: 0.75rem !important;
    margin-left: 6px !important;
  }
  .msx-notice-item {
    font-size: 0.82rem !important;
  }
  .msx-notice-track {
    animation-duration: 22s;
    gap: 30px;
  }
}
