/**
  Unstyled by default
  Styles applied only under [data-mb-theme]
*/

/* v2-light or just "light" */
[data-mb-theme$="light"] {
  --mb-fg: #000;
  --mb-bg: transparent;
  --mb-badge-border: hsl(202.76999999999998 68.03% 52.16%);
  --mb-badge-fg: hsl(202.76999999999998 68.03% 52.16%);
  --mb-md-em: hsl(202.76999999999998 68.03% 52.16%);
  --mb-md-a: hsl(212.08000000000004 100% 48.04%);
  --mb-cta-bg: #000;
  --mb-cta-fg: #fff;
}

[data-mb-theme="v1-light"] {
  --mb-fg: #000;
  --mb-bg: #fff;
  --mb-badge-border: #3299d8;
  --mb-badge-fg: #3299d8;
  --mb-md-em: #3299d8;
  --mb-md-a: #0072f5;
}

/* "v2-dark" or just "dark" */
[data-mb-theme$="dark"] {
  --mb-fg: hsl(210 5.56% 92.94%);
  --mb-bg: transparent;
  --mb-badge-border: hsl(190.14 94.67% 44.12%);
  --mb-badge-fg: hsl(190.14 94.67% 44.12%);
  --mb-md-em: hsl(190.14 94.67% 44.12%);
  --mb-md-a: hsl(212.08000000000004 100% 48.04%);
  --mb-cta-bg: #fff;
  --mb-cta-fg: #000;
}
[data-mb-theme="v1-dark"] {
  --mb-fg: #ecedee;
  --mb-bg: #16181a;
  --mb-badge-border: #06b7db;
  --mb-badge-fg: #06b7db;
  --mb-md-em: #06b7db;
}

/* Styled themes */
:where([data-mb-theme]) .mb-inline-ad-container {
  text-decoration: none;
}
:where([data-mb-theme]) .mb-inline-ad {
  margin: 0;
  color: var(--mb-fg);
  background-color: var(--mb-bg);
  border-radius: 14px;
  line-height: 24px;
  padding: 0;
}

:where([data-mb-theme^="v1-"]) .mb-inline-ad {
  padding: 12px;
}

:where([data-mb-theme]) .mb-ad-badge {
  padding: 0 2px;
  border-radius: 8px;
  border: 1px solid var(--mb-badge-border);
  margin-right: 8px;
  background: transparent;
}

:where([data-mb-theme]) .mb-ad-badge-text {
  margin: 4px;
  font-size: 12px;
  line-height: 12px;
  color: var(--mb-badge-fg);
}

:where([data-mb-theme]) .mb-md-p {
  text-wrap: pretty;
}

:where([data-mb-theme]) .mb-md-em {
  color: var(--mb-md-em);
}

:where([data-mb-theme]) .mb-md-a {
  color: var(--mb-md-a);
  text-decoration: underline;
}

/* Rest of the styles are always applied */

.mb-image {
  border-radius: 6px;
  width: 100%;
  max-width: 680px;
  margin-top: 12px;
}

.mb-video-container {
  position: relative;
  display: inline-block;
  width: 100%;
}

.mb-video-element {
  width: 100%;
  cursor: pointer;
}

.mb-video-placement-top {
  margin-bottom: 12px;
}

.mb-video-placement-bottom {
  margin-top: 12px;
}

.mb-video-progress-bar {
  margin: 0px;
  padding: 0px;
  width: 100%;
  border-radius: 5px;
  height: 5px;
  display: block;
}

.mb-video-progress-bar::-webkit-progress-value {
  background-color: #007bff; /* Blue color */
}

.mb-video-progress-bar::-moz-progress-bar {
  background-color: #007bff; /* Blue color */
}

.mb-video-progress-bar::-ms-fill {
  background-color: #007bff; /* Blue color */
}

.mb-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 50px;
  cursor: pointer;
  z-index: 0;
}

.mb-play-button {
  width: 60px;
  height: 60px;
  background-color: #ffffff; /* White circle background */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.mb-play-button::before {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border-left: 18px solid #007bff; /* Blue triangle color */
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
}
.mb-video-badge {
  position: absolute;
  top: 10px;
  right: 0;
  background-color: #007bff; /* Blue color */
  color: #ffffff; /* White color */
  padding: 2px 8px;
  border-radius: 8px 0px 0px 8px;
  z-index: 2;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.4px;
}

.mb-video-cta-badge {
  cursor: pointer;
}

.mb-end-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-direction: column;
  z-index: 0;
}

.mb-end-button {
  background-color: #ffffff; /* White background */
  color: #007bff; /* Blue color for icon */
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  margin-bottom: 20px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.mb-end-text {
  color: white;
  font-size: 14px;
  text-align: center;
}

/* AdButton */

:where([data-mb-theme]) .mb-button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all 150ms ease-out;
  height: 36px;
  padding: 0 16px;
  box-sizing: border-box;
}

:where([data-mb-theme]) .mb-button:disabled {
  pointer-events: none;
  opacity: 0.3;
}

:where([data-mb-theme]) .mb-button--cta {
  background-color: var(--mb-cta-bg);
  color: var(--mb-cta-fg);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

:where([data-mb-theme]) .mb-button--continue {
  background-color: transparent;
  border: 1px solid var(--mb-cta-bg);
  color: var(--mb-cta-bg);
}

/* Narrative Ad */

@keyframes mb-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes mb-fill-left-to-right {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

:where([data-mb-theme]) .mb-narrative-container {
  background-color: var(--mb-bg);
  color: var(--mb-fg);
  width: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

:where([data-mb-theme]) .mb-narrative-message {
  animation: mb-fade-in 500ms ease-out;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

:where([data-mb-theme]) .mb-narrative-message {
  margin-bottom: 16px;
}

:where([data-mb-theme]) .mb-narrative-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  margin-top: 2px;
}

:where([data-mb-theme]) .mb-narrative-image {
  width: 100%;
  border-radius: 8px;
  animation: mb-fade-in 300ms ease-out;
  animation-fill-mode: forwards;
  opacity: 0;
  margin-bottom: 16px;
}

:where([data-mb-theme]) .mb-narrative-cta-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: mb-fade-in 300ms ease-out;
  opacity: 0;
  animation-fill-mode: forwards;
  margin-top: 24px;
}

:where([data-mb-theme]) .mb-narrative-button-wrapper {
  position: relative;
}

:where([data-mb-theme]) .mb-narrative-button-overlay {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

:where([data-mb-theme]) .mb-narrative-button-fill {
  position: absolute;
  inset: 0;
  animation: mb-fill-left-to-right 4000ms linear;
  opacity: 0.3;
  animation-fill-mode: forwards;
  clip-path: inset(0 100% 0 0);
}

:where([data-mb-theme]) .mb-narrative-container .mb-md-a:hover {
  cursor: pointer;
  color: var(--mb-md-em);
}

/* Quest Ad */

:where([data-mb-theme]) .mb-quest-container {
  background-color: var(--mb-bg);
  color: var(--mb-fg);
  width: 100%;
  box-sizing: border-box;
  position: relative;
}

:where([data-mb-theme]) .mb-quest-content {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

:where([data-mb-theme]) .mb-quest-text-content {
  flex: 1;
  min-width: 0;
}

:where([data-mb-theme]) .mb-quest-avatar {
  width: 68px;
  height: 68px;
  border-radius: 12px;
  flex-shrink: 0;
}

:where([data-mb-theme]) .mb-quest-title {
  font-weight: 600;
  line-height: 1.5;
}

:where([data-mb-theme]) .mb-quest-text {
  margin-block: 16px;
}

:where([data-mb-theme]) .mb-quest-buttons-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-block-start: 24px;
}

:where([data-mb-theme]) .mb-quest-container .mb-md-a:hover {
  cursor: pointer;
  color: var(--mb-md-em);
}

/* Comic Ad */

:where([data-mb-theme]) .mb-comic-container {
  text-decoration: none;
}

:where([data-mb-theme]) .mb-comic-ad {
  display: flex;
  gap: 16px;
  color: var(--mb-fg);
  background-color: var(--mb-bg);
  line-height: 24px;
}

:where([data-mb-theme]) .mb-comic-avatar-container {
  flex: 1;
  width: 33.33%;
}

:where([data-mb-theme]) .mb-comic-avatar {
  object-fit: contain;
  object-position: center top;
  width: 100%;
  border-radius: 12px;
  overflow: clip;
}

:where([data-mb-theme]) .mb-comic-content {
  flex: 2;
  text-wrap: pretty;
  align-self: center;
}
