/* Surf companion ads rotate inside the surf viewer instead of taking layout space. */

.surf-viewer-panel--frame-compatible .surf-viewer-with-rails,
.app-shell.hyper-mode .surf-viewer-panel--frame-compatible .surf-viewer-with-rails {
  position: relative;
  display: block;
}

.surf-viewer-panel--frame-compatible .surf-viewer-center,
.app-shell.hyper-mode .surf-viewer-panel--frame-compatible .surf-viewer-center {
  position: relative;
  z-index: 1;
}

.surf-viewer-panel--frame-compatible .surf-ad-rail,
.app-shell.hyper-mode .surf-viewer-panel--frame-compatible .surf-ad-rail {
  position: absolute;
  z-index: 4;
  width: auto;
  max-width: min(468px, calc(100% - 24px));
  min-width: 0;
  display: flex;
  pointer-events: none;
  overflow: visible;
}

.surf-viewer-panel--frame-compatible .surf-ad-rail--left,
.app-shell.hyper-mode .surf-viewer-panel--frame-compatible .surf-ad-rail--left {
  left: 12px;
  top: 12px;
}

.surf-viewer-panel--frame-compatible .surf-ad-rail--right,
.app-shell.hyper-mode .surf-viewer-panel--frame-compatible .surf-ad-rail--right {
  right: 12px;
  bottom: 12px;
}

.surf-ad-rail--empty {
  display: none !important;
}

.surf-rail-slot--rotating {
  position: relative;
  width: min(468px, calc(100vw - 40px));
  min-height: 42px;
  height: auto;
  border: 1px solid rgba(249, 115, 22, 0.42);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(17, 17, 17, 0.88), rgba(17, 17, 17, 0.7)),
    rgba(8, 8, 8, 0.78);
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.3),
    0 0 20px rgba(249, 115, 22, 0.12);
  backdrop-filter: blur(8px) saturate(1.1);
  pointer-events: auto;
}

.surf-rail-slot--rotating::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.09), transparent);
  opacity: 0.48;
}

.surf-rail-slot--rotating:hover,
.surf-rail-slot--rotating:focus-visible {
  border-color: rgba(249, 115, 22, 0.72);
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.34),
    0 0 24px rgba(249, 115, 22, 0.2);
}

.surf-rail-slot-meta {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(249, 115, 22, 0.28);
  background: rgba(249, 115, 22, 0.14);
  color: #fdba74;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
  text-transform: uppercase;
}

.surf-rail-slot-meta b {
  color: #fff7ed;
  font-weight: 900;
}

.surf-rail-slot--rotating .surf-rail-slot-title,
.surf-rail-slot--rotating .surf-rail-slot-desc,
.surf-rail-slot--rotating .surf-rail-slot-cta,
.surf-rail-slot--rotating .surf-rail-slot-img,
.surf-rail-slot--rotating .surf-generated-banner {
  position: relative;
  z-index: 1;
}

.surf-rail-slot--rotating .surf-rail-slot-title {
  font-size: 13px;
  color: #f7f7f7;
}

.surf-rail-slot-desc {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(229, 231, 235, 0.78);
  font-size: 11px;
  font-weight: 700;
}

.surf-rail-slot--rotating .surf-rail-slot-cta {
  padding: 4px 8px;
  border-radius: 999px;
  background: #f97316;
  color: #0b0502;
}

.surf-rail-slot--banner.surf-rail-slot--rotating {
  justify-content: flex-start;
  min-height: 68px;
  padding: 5px 8px;
}

.surf-rail-slot--banner.surf-rail-slot--rotating .surf-rail-slot-img {
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  min-width: 0;
  height: 52px;
  object-fit: contain;
  object-position: center;
}

.surf-generated-banner {
  flex: 1 1 auto;
  min-width: 0;
  height: 52px;
  border-radius: 9px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 6px 10px;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 255, 255, 0.32), transparent 16%),
    linear-gradient(135deg, #f97316, #111827 52%, #2563eb);
  color: #fff7ed;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.surf-generated-banner strong,
.surf-generated-banner em {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
}

.surf-generated-banner strong {
  font-size: 15px;
  font-weight: 1000;
}

.surf-generated-banner em {
  color: rgba(255, 237, 213, 0.86);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.surf-rail-slot--available {
  border-style: dashed;
  border-color: rgba(253, 186, 116, 0.58);
  background:
    linear-gradient(135deg, rgba(249, 115, 22, 0.18), rgba(17, 17, 17, 0.72)),
    rgba(8, 8, 8, 0.76);
}

.surf-rail-slot--available .surf-rail-slot-title {
  color: #ffedd5;
}

.surf-generated-banner--available {
  border: 1px dashed rgba(255, 237, 213, 0.46);
  background:
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.08) 0 8px, transparent 8px 16px),
    linear-gradient(135deg, #7c2d12, #111827 58%, #1f2937);
}

@media (max-width: 760px) {
  .surf-viewer-panel--frame-compatible .surf-ad-rail,
  .app-shell.hyper-mode .surf-viewer-panel--frame-compatible .surf-ad-rail {
    left: 10px;
    right: 10px;
    max-width: calc(100% - 20px);
  }

  .surf-viewer-panel--frame-compatible .surf-ad-rail--left,
  .app-shell.hyper-mode .surf-viewer-panel--frame-compatible .surf-ad-rail--left {
    top: 10px;
  }

  .surf-viewer-panel--frame-compatible .surf-ad-rail--right,
  .app-shell.hyper-mode .surf-viewer-panel--frame-compatible .surf-ad-rail--right {
    bottom: 10px;
  }

  .surf-rail-slot--rotating,
  .surf-rail-slot--banner.surf-rail-slot--rotating {
    width: 100%;
    min-height: 46px;
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }

  .surf-rail-slot--banner.surf-rail-slot--rotating .surf-rail-slot-img,
  .surf-generated-banner {
    flex-basis: 100%;
    height: 44px;
  }

  .surf-rail-slot--rotating .surf-rail-slot-cta {
    width: 100%;
    text-align: center;
  }
}
