/**
 * Survey Activity Waterfall
 * Styles for WordPress Theme Integration
 */

:root {
  --sw-primary-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sw-card-bg: #f4f5f7;
  --sw-card-bg-hover: #ffffff;
  --sw-card-border: rgba(0, 0, 0, 0.03);
  --sw-card-title-color: #1e293b;
  --sw-card-sub-color: #64748b;
  --sw-badge-yellow-bg: #fed000;
  --sw-badge-yellow-text: #0f172a;
  --sw-badge-default-bg: #ffffff;
  --sw-badge-default-border: #e8ecf0;
  --sw-badge-default-text: #334155;
  --sw-badge-icon-color: #64748b;
}

.sw-waterfall-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  margin: 0 auto;
  font-family: "Nunito Sans";
  background-color: #ffffff;
  box-sizing: border-box;
  container-type: inline-size;
  cursor: pointer;
  container-name: sw-container;
}

.sw-waterfall-wrapper *,
.sw-waterfall-wrapper *::before,
.sw-waterfall-wrapper *::after {
  box-sizing: border-box;
}

/* Gradient Fade Masks on Top and Bottom */
.sw-waterfall-container {
  position: relative;
  width: 100%;
  height: var(--sw-container-height, 680px);
  overflow: hidden;
  display: flex;
  justify-content: center;
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.6) 5%,
    rgba(0, 0, 0, 1) 15%,
    rgba(0, 0, 0, 1) 85%,
    rgba(0, 0, 0, 0.6) 95%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.6) 5%,
    rgba(0, 0, 0, 1) 15%,
    rgba(0, 0, 0, 1) 85%,
    rgba(0, 0, 0, 0.6) 95%,
    transparent 100%
  );
}

/* Fallback gradient overlays for browsers without mask-image support */
.sw-gradient-overlay-top,
.sw-gradient-overlay-bottom {
  position: absolute;
  left: 0;
  right: 0;
  height: 100px;
  pointer-events: none;
  z-index: 10;
}

.sw-gradient-overlay-top {
  top: 0;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0) 100%);
}

.sw-gradient-overlay-bottom {
  bottom: 0;
  background: linear-gradient(to top, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0) 100%);
}

/* Grid of columns */
.sw-columns-grid {
  display: grid;
  grid-template-columns: repeat(var(--sw-cols, 4), 1fr);
  gap: 22px;
  width: 100%;
  height: 100%;
  padding: 0 16px;
  box-sizing: border-box;
}

/* Individual vertical column */
.sw-column {
  position: relative;
  overflow: hidden;
  height: 100%;
}

/* Vertical track containing repeating sets of cards */
.sw-track {
  display: flex;
  flex-direction: column;
  gap: 18px;
  will-change: transform;
  animation-name: sw-scroll-vertical;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-duration: var(--sw-duration, 160s);
}

/* Stagger column speeds & offsets slightly for organic flow */
.sw-column:nth-child(1) .sw-track {
  animation-duration: var(--sw-duration, 160s);
}

.sw-column:nth-child(2) .sw-track {
  animation-duration: calc(var(--sw-duration, 160s) * 1.05);
  transform: translateY(-60px);
}

.sw-column:nth-child(3) .sw-track {
  animation-duration: calc(var(--sw-duration, 160s) * 0.96);
  transform: translateY(-130px);
}

.sw-column:nth-child(4) .sw-track {
  animation-duration: calc(var(--sw-duration, 160s) * 1.02);
  transform: translateY(-80px);
}

/* Pause on click for Waterfall */
.sw-waterfall-wrapper.is-paused .sw-track,
.sw-track.is-paused {
  animation-play-state: paused !important;
}

@keyframes sw-scroll-vertical {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-50%);
  }
}

/* Reverse direction support */
.sw-direction-down .sw-track {
  animation-name: sw-scroll-vertical-down;
}

@keyframes sw-scroll-vertical-down {
  0% {
    transform: translateY(-50%);
  }
  100% {
    transform: translateY(0);
  }
}

/* Survey Card */
.sw-card {
  background-color: #f5f5f5;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              background-color 0.25s ease;
  user-select: none;
  cursor: pointer;
  font-family: "Nunito Sans";
}

/* Card Header Typography */
.sw-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #08111D;
  margin: 0 0 5px 0;
  line-height: 1.35;
  letter-spacing: -0.01em;
  font-family: "Montserrat";
}

.sw-card-subtitle {
  font-size: 16px;
  color: #7E7873;
  margin: 0 0 16px 0;
  font-weight: 400;
  line-height: 1.35;
  font-family: "Nunito Sans";
}

/* Card Badges Container */
.sw-card-badges {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sw-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* Base Badge Pill */
.sw-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 500;
  white-space: nowrap;
}

.sw-badge svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Amber/Yellow Duration Badge */
.sw-badge-duration {
  background-color:#FFDD00;
  color: #08111D;
}

.sw-badge-duration svg {
  stroke: #08111D;
}

/* Standard White Badges */
.sw-badge-default {
  background-color: #fff;
  color: #08111D;
}

.sw-badge-default svg {
  stroke: #08111D;
}

/* ==========================================================================
   Responsive Grid for Waterfall (Container Queries & Fallback Media Queries)
   ========================================================================== */

/* Fluid adaptations based on component width */
@container sw-container (max-width: 1279px) {
  .sw-columns-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px;
  }
  .sw-column:nth-child(n+4) {
    display: none;
  }
}

@container sw-container (max-width: 899px) {
  .sw-columns-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px;
  }
  .sw-column:nth-child(n+3) {
    display: none;
  }
  .sw-card {
    padding: 18px 20px;
  }
}

@container sw-container (max-width: 579px) {
  .sw-columns-grid {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }
  .sw-column:nth-child(n+2) {
    display: none;
  }
  .sw-card {
    padding: 16px 18px;
  }
  .sw-card-title {
    font-size: 15px;
  }
}

/* Fallback for browsers without container queries */
@supports not (container-type: inline-size) {
  @media (max-width: 1279px) {
    .sw-columns-grid {
      grid-template-columns: repeat(3, 1fr) !important;
      gap: 20px;
    }
    .sw-column:nth-child(n+4) {
      display: none;
    }
  }

  @media (max-width: 899px) {
    .sw-columns-grid {
      grid-template-columns: repeat(2, 1fr) !important;
      gap: 16px;
    }
    .sw-column:nth-child(n+3) {
      display: none;
    }
    .sw-card {
      padding: 18px 20px;
    }
  }

  @media (max-width: 579px) {
    .sw-columns-grid {
      grid-template-columns: 1fr !important;
      gap: 14px;
    }
    .sw-column:nth-child(n+2) {
      display: none;
    }
    .sw-card {
      padding: 16px 18px;
    }
    .sw-card-title {
      font-size: 15px;
    }
  }
}

/* ==========================================================================
   Accessibility: WCAG 2.1 Level AAA prefers-reduced-motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .sw-track,
  .sc-track {
    animation: none !important;
    transform: none !important;
  }

  .sw-waterfall-container {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    -webkit-mask-image: none !important;
    mask-image: none !important;
  }

  .sc-carousel-container {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    -webkit-mask-image: none !important;
    mask-image: none !important;
  }

  .sw-gradient-overlay-top,
  .sw-gradient-overlay-bottom,
  .sc-gradient-overlay-left,
  .sc-gradient-overlay-right {
    display: none !important;
  }

  .sw-card,
  .sc-card,
  .sn-card {
    transition: none !important;
  }
}

/* ==========================================================================
   Horizontal Carousel (Survey Carousel Ticker - carousel.png)
   ========================================================================== */

.sc-carousel-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  margin: 0 auto;
  font-family: "Nunito Sans", sans-serif;
  background-color: transparent;
  box-sizing: border-box;
}

.sc-carousel-wrapper *,
.sc-carousel-wrapper *::before,
.sc-carousel-wrapper *::after {
  box-sizing: border-box;
}

.sc-carousel-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 0;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    rgba(0, 0, 0, 0.6) 3%,
    rgba(0, 0, 1, 1) 8%,
    rgba(0, 0, 1, 1) 92%,
    rgba(0, 0, 0, 0.6) 97%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    rgba(0, 0, 0, 0.6) 3%,
    rgba(0, 0, 1, 1) 8%,
    rgba(0, 0, 1, 1) 92%,
    rgba(0, 0, 0, 0.6) 97%,
    transparent 100%
  );
}

.sc-gradient-overlay-left,
.sc-gradient-overlay-right {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100px;
  pointer-events: none;
  z-index: 10;
}

.sc-gradient-overlay-left {
  left: 0;
  background: linear-gradient(to right, rgba(245, 245, 245, 0.9) 0%, rgba(245, 245, 245, 0) 100%);
}

.sc-gradient-overlay-right {
  right: 0;
  background: linear-gradient(to left, rgba(245, 245, 245, 0.9) 0%, rgba(245, 245, 245, 0) 100%);
}

.sc-track {
  display: flex;
  flex-direction: row;
  gap: 60px;
  width: max-content;
  will-change: transform;
  animation-name: sc-scroll-left;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-duration: var(--sc-duration, 240s);
}

/* Pause on hover for Carousel */
.sc-carousel-wrapper:hover .sc-track,
.sc-carousel-container:hover .sc-track,
.sc-track:hover,
.sc-track.is-paused {
  animation-play-state: paused !important;
}

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

.sc-direction-right .sc-track {
  animation-name: sc-scroll-right;
}

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

/* Card inside Horizontal Carousel */
.sc-card {
  flex: 0 0 auto;
  width: var(--sc-card-width, 400px);
  background-color: #ffffff !important;
  border-radius: 20px;
  padding: 20px;
  cursor: default;
}

.sc-card .sw-badge-default {
  background-color: #f1f3f5;
  color: #08111D;
}

.sc-card .sw-badge-default svg {
  stroke: #08111D;
}

@media (max-width: 640px) {
  .sc-card {
    width: 310px;
    padding: 16px 18px;
  }
}

/* ==========================================================================
   Activity Notification Toast (notification.png)
   ========================================================================== */

.sn-notification-container {
  position: fixed;
  z-index: 999999;
  pointer-events: none;
  box-sizing: border-box;
}

.sn-pos-bottom-left {
  bottom: 28px;
  left: 28px;
}

.sn-pos-bottom-right {
  bottom: 28px;
  right: 28px;
}

.sn-pos-top-left {
  top: 28px;
  left: 28px;
}

.sn-pos-top-right {
  top: 28px;
  right: 28px;
}

.sn-card {
  position: relative;
  width: 400px;
  max-width: calc(100vw - 36px);
  background-color: #ffffff;
  border-radius: 20px;
  padding: 20px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 12px 36px -4px rgba(0, 0, 0, 0.12), 0 4px 12px -2px rgba(0, 0, 0, 0.04);
  font-family: "Nunito Sans", sans-serif;
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.sn-pos-top-left .sn-card,
.sn-pos-top-right .sn-card {
  transform: translateY(-20px);
}

.sn-card.sn-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.sn-card.sn-hiding {
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
}

.sn-pos-top-left .sn-card.sn-hiding,
.sn-pos-top-right .sn-card.sn-hiding {
  transform: translateY(-16px);
}

.sn-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 5px;
}

.sn-title {
  font-size: 16px;
  font-weight: 600;
  color: #08111D;
  line-height: 1.35;
  letter-spacing: -0.01em;
  font-family: "Montserrat", sans-serif;
  margin: 0;
  flex: 1;
  text-align: left;
}

.sn-close-btn {
  background: none;
  border: none;
  padding: 2px;
  margin: 0;
  cursor: pointer;
  color: #7E7873;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.2s ease, background-color 0.2s ease;
  line-height: 1;
}

.sn-close-btn:hover {
  color: #08111D;
  background-color: #f1f5f9;
}

.sn-close-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.sn-subtitle {
  font-size: 16px;
  color: #7E7873;
  margin: 0 0 16px 0;
  font-weight: 400;
  line-height: 1.35;
  font-family: "Nunito Sans", sans-serif;
  text-align: left;
}

.sn-card .sw-badge-default {
  background-color: #f1f3f5;
  color: #08111D;
}

.sn-card .sw-badge-default svg {
  stroke: #08111D;
}

@media (max-width: 480px) {
  .sn-pos-bottom-left,
  .sn-pos-bottom-right {
    bottom: 16px;
    left: 16px;
    right: 16px;
  }
  .sn-card {
    width: 100%;
    padding: 18px 20px;
  }
  .sn-title {
    font-size: 15px;
  }
  .sn-subtitle {
    font-size: 14.5px;
    margin-bottom: 14px;
  }
}


