/* Slides Application Styles */

/* Note: Loading indicator styles are inlined in deck.html.erb <head> 
   to prevent flash of unstyled content during initial page load.
   This matches Next.js behavior where critical CSS loads before external stylesheets. */

/* ===== Typography Import (must be first) ===== */
@import url("https://fonts.googleapis.com/css2?family=Inter+Tight:wght@300;400;500;600;700;800&display=swap");

/* ===== CSS Reset ===== */
* {
  box-sizing: border-box;
}

/* ===== Root Variables ===== */
:root {
  --color-primary: #7059e7;
  --color-old-primary: #5135cc;
  --color-text: #585858;
  --color-text-header: #000000;
  --color-text-subtext: #333333;
  --color-progress-completed: #f1c54a;
  --color-progress-remaining: #f9eecc;
  --color-white: #ffffff;
  --color-bg: #f5f5f5;
}

a {
  color: var(--color-primary);
  transition: all 0.3s;
}

/* ===== Main Layout ===== */

.deck {
  width: 100%;
  height: 100%;
}

.deck__header {
  display: none;
}

/* ===== Swiper Container ===== */
.swiper {
  width: 100%;
  height: calc(100svh - 4px);
  background: transparent;
  overflow: hidden;
}

.swiper-wrapper {
  height: 100%;
}

.swiper-slide:not(.swiper-slide-active):not(.swiper-slide-prev):not(.swiper-slide-next) {
  visibility: hidden;
  pointer-events: none;
  content-visibility: hidden;
}

.swiper-slide-prev,
.swiper-slide-next {
  pointer-events: none;
}

.swiper-resizing .swiper-slide:not(.swiper-slide-active) {
  visibility: hidden;
  opacity: 0;
  transition: none;
}

/* Hide intermediate slides during non-sequential navigation */
/* Disabling transforms/transitions prevents visual glitches during jumps */
.swiper-slide.swiper-slide-hidden {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transform: none !important;
  transition: none !important;
}

/* ===== Slide Content ===== */
.deck__slide {
  width: 100%;
  padding: 3rem;
  text-align: center;
  opacity: 0;
  transform: translateY(30px);
}

.swiper-slide-active .deck__slide {
  animation: sl-drop-in 0.7s ease 0.3s forwards;
}

/* Keep outgoing slide content visible during transition */
.swiper-slide-prev .deck__slide,
.swiper-slide-next .deck__slide {
  opacity: 1;
  transform: none;
  animation: none;
}

/* ===== Primary Button Styles ===== */
/* .sl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 58px;
  font-size: 22px;
  line-height: 30px;
  font-weight: 600;
  color: var(--color-white);
  background: var(--color-primary);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Inter Tight", sans-serif;
}

.sl-btn:hover {
  background: #5a46ba;
}

.sl-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 58px;
  font-size: 22px;
  line-height: 30px;
  font-weight: 600;
  color: var(--color-white);
  background: var(--color-primary);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Inter Tight", sans-serif;
}

.sl-btn-primary:hover {
  background: #5a46ba;
}

.sl-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 58px;
  font-size: 22px;
  line-height: 30px;
  font-weight: 600;
  color: var(--color-primary);
  background: transparent;
  border: 2px solid var(--color-primary);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Inter Tight", sans-serif;
}

.sl-btn-secondary:hover {
  background: rgba(112, 89, 231, 0.1);
}

.sl-btn-disabled,
.sl-btn:disabled,
.sl-btn-primary:disabled {
  pointer-events: none;
  opacity: 0.5;
} */

/* ===== Swiper Pagination ===== */
.swiper-pagination {
  display: none;
}

@keyframes sl-drop-in {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade-in animation for non-sequential slide transitions */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ===== Mobile Fixed Button ===== */
/* Styles are defined in tailwind/application.css for proper Tailwind integration */

/* @media (min-width: 600px) and (max-width: 850px) {
}

@media (min-width: 600px) and (max-width: 1024px) {
  .sl-slides-container {
    padding: 0 80px !important;
  }
} */

/* ===== Loading State ===== */
/* .sl-loading {
  display: inline-flex;
  gap: 10px;
  opacity: 0.7;
  align-items: center;
  position: relative;
  cursor: not-allowed;
  pointer-events: none;
}

.sl-loading::after {
  width: 20px;
  content: "";
  height: 20px;
  border-radius: 50%;
  animation: 0.5s linear infinite btnloader;
  border: 2px solid #fff;
  border-top-color: transparent;
  position: relative;
  left: auto;
  top: auto;
  display: block;
  margin: 0;
} */

/* ===== Error Messages ===== */
.sl-error-msg {
  opacity: 0;
  animation: sl-error 0.4s ease 0.1s forwards;
  color: #ef4444;
  margin-top: 8px;
  font-size: 14px;
}

/* ===== Other Choice Input ===== */
.sl-choice-input {
  width: 100%;
  margin-top: 8px;
  padding: 10px 16px;
  border: 1px solid rgba(112, 89, 231, 0.2);
  border-radius: 8px;
  font-size: 18px;
  color: var(--color-text);
  outline: none;
}

.sl-choice-input:focus {
  border-color: var(--color-primary);
}

/* ===== Attachment/Media Styles ===== */
.sl-attachment {
  width: 100%;
}

/* .sl-score {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
} */

/* ===== Start Buttons ===== */

/* ===== Feedback ===== */
/* .sl-feedback {
  margin-top: 16px;
} */

/* ===== Additional Mobile Styles ===== */
/* @media (max-width: 767px) {
  iframe[height="405"] {
    height: 300px;
  }

  .sl-opinions {
    flex-wrap: wrap;
    justify-content: center;
  }

  .sl-opinions > button {
    width: 100%;
    max-width: calc(20% - 3.2px);
  }
}

@media (max-width: 600px) {
  .sl-statement {
    padding-left: 20px;
    padding-right: 20px;
  }

  .sl-input {
    font-size: 16px;
  }

  .sl-feedback {
    transform: translateY(0);
  }

  .sl-description p,
  .sl-description ul,
  .sl-description * {
    font-size: 16px !important;
    line-height: 22px !important;
  }

  .sl-description p + p {
    margin-top: 12px;
  }

  .sl-description > ol {
    font-size: 20px !important;
  }

  .sl-start-btns {
    z-index: 10;
    position: fixed;
    left: 20px;
    opacity: 1;
    animation: none;
    transform: translateY(0);
    justify-content: center;
    width: calc(100% - 40px);
    top: calc(100svh - 65px);
  }

  .sl-start-btns button {
    width: 100%;
    justify-content: center;
  }

  .sl-main:has(.sl-start-btns) .sl-slides {
    max-height: calc(100svh - 58px);
  }

  .sl-next-text {
    display: none;
  }

  .sl-score {
    margin-top: 32px;
    flex-direction: column;
    order: -1;
    margin-bottom: -20px;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  iframe[height="405"] {
    height: 200px;
  }
}

@media (max-width: 420px) {
  .sl-opinions .sl-opinion-btn {
    font-size: 20px;
  }
}

@media (max-width: 360px) {
  .sl-opinion-btn {
    height: 50px;
  }
}

@media (max-width: 1024px) {
  .sl-attachment iframe {
    width: 100%;
    height: 100%;
    min-height: 300px;
  }
} */

/* ===== Title with bold span fix ===== */

/* ===== External Link Styling ===== */
/* .sl-external-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.sl-external-link-icon {
  width: 0.875em;
  height: 0.875em;
  flex-shrink: 0;
  vertical-align: middle;
} */

/* External link icon in choice buttons */
/* .sl-choice-btn .sl-external-link-icon,
.sl-choice-btn svg {
  width: 1rem;
  height: 1rem;
  margin-left: auto;
  flex-shrink: 0;
} */

/* Crisis/resources choice buttons */
/* .sl-choice-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #d8ccff;
  border-radius: 12px;
  background: #f7f3ff;
  color: #5135cc;
  font-size: 20px;
  line-height: 28px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.sl-choice-btn:hover {
  background: #efe7ff;
  border-color: #c7b6ff;
}

.sl-choice-letter {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1.5px solid #5135cc;
  border-radius: 8px;
  font-weight: 700;
  font-size: 20px;
  color: #5135cc;
  flex-shrink: 0;
}

.sl-choice-text {
  font-size: 20px;
  line-height: 28px;
  color: #6a4ce1;
  word-break: break-word;
}

.sl-choice-text em {
  font-style: italic;
  font-weight: 500;
} */
