.announcement-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: linear-gradient(90deg, rgb(30, 31, 36), rgb(32, 33, 38));
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 16px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 101;
  box-sizing: border-box;
}

.announcement-banner.hidden {
  display: none;
}

/* Adjust header position when banner is visible */
body:has(.announcement-banner:not(.hidden)) .header {
  top: var(--banner-height, 48px);
}

/* Fallback for browsers that don't support :has() */
.header.has-banner {
  top: var(--banner-height, 48px);
}

.announcement-banner__content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  justify-content: center;
}

.announcement-banner__icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-inline-end: 8px;
}

.announcement-banner__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.announcement-banner__text-wrapper {
  min-width: 0;
  overflow: hidden;
  position: relative;
}

.announcement-banner__text {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0;
  font-family: Roboto, -apple-system, "BlinkMacSystemFont", "Roboto", "Segoe UI",
    "Oxygen", "Ubuntu", "Cantarell", "Open Sans", "Helvetica Neue", "Arial",
    sans-serif;
  font-size: 14px;
  line-height: 18px;
  letter-spacing: 0;
  text-transform: none;
  color: #9e9ea0;
  white-space: nowrap;
}

.announcement-banner__text-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.announcement-banner__icon-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  margin-right: 8px;
}

.announcement-banner__icon-inline img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.announcement-banner__separator {
  display: inline-block;
  color: #9e9ea0;
  padding: 0;
  font-size: 14px;
  opacity: 0.5;
}

/* Desktop: no animation, hide duplicate content */
.announcement-banner__text--marquee {
  display: flex;
}

@keyframes smooth-marquee {
  0% {
    transform: translate3d(0, 0, 0);
  }

  100% {
    transform: translate3d(-33.333%, 0, 0);
  }
}

/* Desktop and Tablet: Hide duplicate content, separators, and inline icon */
@media (min-width: 769px) {
  .announcement-banner__icon {
    width: 24px;
    height: 24px;
    margin-inline-end: 8px;
  }

  .announcement-banner__text {
    font-family: Roboto, -apple-system, "BlinkMacSystemFont", "Roboto",
      "Segoe UI", "Oxygen", "Ubuntu", "Cantarell", "Open Sans", "Helvetica Neue",
      "Arial", sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 18px;
    letter-spacing: 0;
    text-transform: none;
  }

  .announcement-banner__text-normal {
    color: #ffffff99;
  }

  .announcement-banner__text-highlight {
    color: rgb(234, 137, 0);
    text-decoration: underline !important;
    text-underline-position: from-font;
    font-size: 14px;
    font-weight: 590;
    line-height: 18px;
    letter-spacing: 0px;
  }

  /* Hide all separators on desktop */
  .announcement-banner__separator {
    display: none !important;
  }

  /* Hide icon inline on desktop (use main icon instead) */
  .announcement-banner__icon-inline {
    display: none !important;
  }

  /* Hide all duplicate text items (keep only first item) */
  .announcement-banner__text--marquee
    .announcement-banner__text-item:not(:first-child) {
    display: none !important;
  }

  /* No animation on desktop */
  .announcement-banner__text--marquee {
    animation: none !important;
    transform: none !important;
    padding-right: 0 !important;
  }
}

.announcement-banner__text-normal {
  color: #ffffff99;
  white-space: nowrap;
  font-weight: 400;
}

.announcement-banner__text-highlight {
  color: rgb(234, 137, 0);
  text-decoration: underline !important;
  text-underline-position: from-font;
  font-size: 14px;
  font-weight: 590;
  line-height: 18px;
  letter-spacing: 0px;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.announcement-banner__text-highlight:hover {
  color: rgb(255, 165, 0);
}

.announcement-banner__close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
  margin-left: 12px;
}

.announcement-banner__close:hover {
  opacity: 0.7;
}

.announcement-banner__close svg {
  width: 24px;
  height: 24px;
  display: block;
}

.announcement-banner__close svg path {
  transition: fill 0.2s ease;
}

.announcement-banner__close:hover svg path {
  fill: #ffffff;
}

/* Responsive styles */
@media (max-width: 768px) {
  .announcement-banner {
    padding: 10px 12px;
    justify-content: space-between;
    align-items: center;
  }

  body:has(.announcement-banner:not(.hidden)) .header {
    top: var(--banner-height, 44px);
  }

  .header.has-banner {
    top: var(--banner-height, 44px);
  }

  .announcement-banner__content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    gap: 10px;
  }

  .announcement-banner__text-wrapper {
    min-width: 0;
    overflow: hidden;
    position: relative;
    padding: 8px 0;
  }

  .announcement-banner__text--marquee {
    display: flex;
    align-items: center;
    width: max-content;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    animation: smooth-marquee 10s linear infinite;
    gap: 0;
  }

  .announcement-banner__text--marquee .announcement-banner__text-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0 10px;
    font-family: sans-serif;
    font-size: 14px;
    flex-shrink: 0;
  }

  .announcement-banner__text--marquee .announcement-banner__separator {
    color: #ffffff;
    padding: 0 14px;
    font-weight: bold;
    opacity: 0.5;
    flex-shrink: 0;
    display: inline-block;
    margin: 0;
  }

  .announcement-banner__icon-inline {
    width: 20px;
    height: 20px;
    margin-right: 6px;
  }

  .announcement-banner__close {
    width: 20px;
    height: 20px;
    margin-left: 8px;
    flex-shrink: 0;
  }

  .announcement-banner__close svg {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 480px) {
  .announcement-banner {
    padding: 8px 10px;
  }

  body:has(.announcement-banner:not(.hidden)) .header {
    top: var(--banner-height, 40px);
  }

  .header.has-banner {
    top: var(--banner-height, 40px);
  }

  .announcement-banner__text--marquee {
    animation: smooth-marquee 8s linear infinite;
  }

  .announcement-banner__icon-inline {
    width: 18px;
    height: 18px;
    margin-right: 4px;
  }

  .announcement-banner__text-wrapper {
    gap: 20px;
  }

  .announcement-banner__text--marquee {
    padding-right: 20px;
  }

  .announcement-banner__close {
    width: 18px;
    height: 18px;
    margin-left: 6px;
  }

  .announcement-banner__close svg {
    width: 18px;
    height: 18px;
  }
}
