/* Reset and Base Styles */
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  overflow-x: hidden;
  -webkit-user-select: none;
  user-select: none;
}

/* Main Page Container */
.styled-page {
  display: flex;
  flex-direction: column;
  background: #170229;
  height: 100vh;
  overflow: hidden;
}

/* Navbar */
.navbar {
  background: transparent;
  color: #ffffff;
  padding: 12px 16px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  position: relative;
  z-index: 1000;
}

.share-button {
  padding: 8px;
  border-radius: 50%;
  /* transition: background-color 0.2s ease; */
}

.share-button:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Main Content */
.main-flex {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.scroll-container {
  /* padding-top: 55px; */
  flex: 1;
  overflow: auto;
  background: #170229;
}

/* Video Container */
.video-container {
  position: relative;
  height: 211px;
  overflow: hidden;
  cursor: pointer;
}

.styled-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-video-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  z-index: 10;
}

/* Tab System */
.tab-section {
  background: #170229;
}

.tab-header {
  display: flex;
  justify-content: center;
  padding: 12px 0; /* Original is theme.pxToRem(24) = 12px */
}

.tab-item {
  position: relative;
}

.tab-left {
  width: 167px; /* Original is theme.pxToRem(334) = 167px */
  height: 47px; /* Original is theme.pxToRem(94) = 47px */
  margin-right: 17px; /* Original is theme.pxToRem(34) = 17px */
}

.tab-right {
  width: 167px; /* Original is theme.pxToRem(334) = 167px */
  height: 47px; /* Original is theme.pxToRem(94) = 47px */
}

.tab-bg {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-repeat: no-repeat;
}

/* Process 1 - Tab images */
.tab-left.process-1 .tab-bg {
  background-image: url("assets/tab1_1.png");
}

.tab-left.process-1.active .tab-bg {
  background-image: url("assets/tab1_1_active.png");
}

/* Process 2 - Tab images */
.tab-left.process-2 .tab-bg {
  background-image: url("assets/tab1_2_unsel.png");
}

.tab-left.process-2.active .tab-bg {
  background-image: url("assets/tab1_2_sel.png");
}

.tab-right .tab-bg {
  background-image: url("assets/tab2.png");
}

.tab-right.active .tab-bg {
  background-image: url("assets/tab2_active.png");
}

/* Content 1 - Video List */
.content-1 {
  background: #170229;
  padding-bottom: 16px; /* Original is padding={[0, 0, 32, 0]} = 16px */
  position: relative;
}

.sticky-box {
  position: sticky;
  top: 0;
  z-index: 999;
  width: 100%;
  background: #170229;
}

.module-1 {
  width: 100vw;
  height: 16vw;
  background-image: url("assets/module1_bg.png");
  background-size: cover;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px; /* Original is padding: 0 ${theme.pxToRem(32)} = 16px */
  position: relative;
  z-index: 20;
}

/* Module 2 for process = 2 */
.module-2 {
  width: 100vw;
  height: 16vw;
  background-image: url("assets/module2_bg.png");
  background-size: cover;
  background-repeat: no-repeat;
}

/* Process content containers */
.process-content-1 {
  display: block;
}

.process-content-2 {
  display: none;
}

.content-1.process-2 .process-content-1 {
  display: none;
}

.content-1.process-2 .process-content-2 {
  display: block;
}

.module-1-left,
.module-1-right {
  position: relative;
  top: 1.5vw;
  color: #551e06;
  font-weight: 600;
  display: flex;
  align-items: center;
  font-size: 12px;
}

.time-span {
  font-size: 11px;
  width: 20px;
  height: 20px;
  border-radius: 3px;
  background: #3f1f00;
  color: #fff;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
}

.left-span {
  font-size: 11px;
  padding: 0 4px;
  min-width: 18px;
  height: 20px;
  border-radius: 3px;
  background: #3f1f00;
  color: #fff;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-line {
  background: #fec581;
  width: 49px;
  height: 5px;
  border-radius: 2.5px;
  overflow: hidden;
  margin-left: 8px;
}

.progress-fill {
  background: #3f1f00;
  width: 50%;
  height: 5px;
  border-radius: 2.5px;
}

.banner-container {
  margin: 0 0 10px 0; /* Original is margin={[0, 0, 20, 0]} = bottom margin 20px/2=10px */
  overflow: hidden;
  position: relative;
  top: -2.5px; /* Original is top={-5} = -2.5px */
  z-index: 10;
  border-radius: 0 0 8px 8px;
}

.banner-container-2 {
  margin: 0 0 20px 0; /* Original is margin={[0, 0, 40, 0]} = bottom margin 40px/2=20px */
  overflow: hidden;
  position: relative;
  top: 0;
  border-radius: 0;
}

.banner-img {
  width: 100%;
  height: auto;
  display: block;
}

/* Banner image height restrictions */
.process-content-1 .banner-container .banner-img {
  object-fit: cover;
}

.process-content-1 .banner-container-2 .banner-img {
  object-fit: cover;
}

.process-content-2 .banner-container .banner-img {
  object-fit: cover;
}

/* Video List */
.list-top-bg {
  width: 100vw;
  height: 39.33333333333333vw;
  background-image: url("assets/module2_top_bg.png?v=10");
  background-size: cover;
  background-repeat: no-repeat;
  display: block;
}

.list-bottom-bg {
  width: 100vw;
  height: 13.733333333333334vw;
  background-image: url("assets/module2_bottom_bg.png");
  background-size: cover;
  background-repeat: no-repeat;
  display: block;
  z-index: 14;
}

.list-box {
  position: relative;
  z-index: 9;
  background: #2b1244;
  height: calc(1127.5px - 30vw);
}

.list-inner-box {
  width: calc(100vw - 24px);
  position: relative;
  top: -20vw;
  background: #2b1244;
  left: 12px;
  right: 12px;
}

.video-list {
  display: flex;
  flex-wrap: wrap;
  position: relative;
}

.video-item {
  position: relative;
  z-index: 11;
  width: calc(50vw - 18px);
  height: 213.5px;
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background-image: url("assets/temp.png");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

.video-item:nth-child(2n) {
  margin-left: 12px;
}

.video-play-btn {
  position: absolute;
  z-index: 12;
  top: 87px;
  left: 50%;
  margin-left: -19.5px;
  width: 39px;
  height: 39px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.3);
  padding: 9.5px;
}

.video-play-btn img {
  width: 20px;
  height: 20px;
}

/* Content 2 - Halloween Activity */
.content-2 {
  background: #170229;
}

/* WhiteSpace equivalents - originally using WhiteSpace spacing={6} */
.whitespace-6 {
  height: 6px;
}

/* SafeAreaInset equivalent - originally using SafeAreaInset component */
.safe-area-inset {
  height: env(safe-area-inset-bottom, 0);
  min-height: 64px; /* Minimum height as fallback */
}

/* Check In Section */
.checkin-section {
  padding: 0; /* Remove padding, use whitespace-6 for spacing */
}

.checkin-container {
  width: 95.73333333333333vw;
  height: 24.8vw;
  background-image: url("assets/check_in.png");
  background-size: cover;
  background-repeat: no-repeat;
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 0 16px; /* Original is padding: 0 ${theme.pxToRem(32)} = 16px */
}

.checkin-list-wrapper {
  flex: 1;
  width: 100%;
  overflow: hidden;
  position: relative;
}

.checkin-line {
  height: 6px;
  background-image: linear-gradient(90deg, #935ece 4%, #6948b9 88%);
  position: absolute;
  left: 0px;
  right: 0px;
  top: 57%;
  transform: translateY(-50%);
}

.checkin-list {
  white-space: nowrap;
  will-change: transform;
  transition-property: transform;
  transition-duration: 0s;
  transition-timing-function: ease-out;
  font-size: 0;
}

.checkin-item {
  width: 8vw;
  display: inline-block;
  margin-right: 4.533333333333333vw;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform;
}

.checkin-item:last-child {
  margin-right: 0;
}

.checkin-item.checked {
  opacity: 0.5;
}

.checkin-item-image {
  width: 8vw;
  height: 8vw;
}

.checkin-item-text {
  font-size: 10px;
  color: #d4c6f9;
  text-align: center;
  margin: 4px 0 0 0;
  line-height: 1;
}

.checkin-item-name {
  font-size: 10px;
  color: #d4c6f9;
  text-align: center;
  margin: 0 0 4px 0;
  line-height: 1;
}

.check-icon {
  width: 9px;
  height: 5.5px;
  margin: 0 auto 4px auto;
  display: block;
}

.checkin-button {
  width: 19.733333333333334vw;
  height: 7.733333333333333vw;
  background-image: url("assets/button_go.png");
  background-size: cover;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4c1701;
  font-weight: 500;
  margin-left: 12px;
  font-size: 12px;
}

.checkin-button.checked {
  opacity: 0.5;
}

/* Banner Task */
.banner-task {
  width: 100vw;
  height: 121.6vw;
  background-image: url("assets/banner_bg.png");
  background-size: cover;
  background-repeat: no-repeat;
  position: relative;
  margin: 0; /* Spacing now handled by whitespace-6 elements */
}

.banner-title {
  width: 77.33333333333333vw;
  height: 32vw;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 15.333333333333332vw;
  background-image: url("assets/open_chests.png");
  background-size: cover;
  background-repeat: no-repeat;
  z-index: 10;
}

.banner-main {
  width: 100vw;
  height: 74.66666666666667vw;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 31.066666666666663vw;
  background-image: url("assets/banner_main.png");
  background-size: cover;
  background-repeat: no-repeat;
  z-index: 9;
}

.banner-ghost {
  width: 100vw;
  height: 74.66666666666667vw;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 31.066666666666663vw;
  background-image: url("assets/ghost_gif.png");
  background-size: cover;
  background-repeat: no-repeat;
  z-index: 1;
}

.banner-mouth {
  width: 100vw;
  height: 74.66666666666667vw;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 31.066666666666663vw;
  background-image: url("assets/mouth_gif.png");
  background-size: cover;
  background-repeat: no-repeat;
  z-index: 10;
}

.banner-mouth.active {
  background-image: url("assets/mouth_s_gif.png");
}

.side-buttons-right {
  position: absolute;
  right: 0;
  top: 35.74vw;
  z-index: 88;
}

.side-button-1,
.side-button-2 {
  width: 16vw;
  height: 7.6vw;
  background-size: cover;
  background-repeat: no-repeat;
  z-index: 10;
  margin-bottom: 4.27vw;
  display: flex;
  align-items: center;
  color: #f2eeff;
  padding-left: 4.8vw;
}

.side-button-1 {
  background-image: url("assets/prize.png");
}

.side-button-2 {
  background-image: url("assets/rules.png");
}

.banner-footer {
  display: flex;
  justify-content: space-between;
  padding: 0 4.933333333333334vw;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 5.333333333333334vw;
}

.footer-btn-1 {
  width: 50.93333333333333vw;
  height: 10.666666666666668vw;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: url("assets/active_page_1.png");
  background-size: cover;
  background-repeat: no-repeat;
  color: #551e06;
  font-weight: 500;
  font-size: 14px;
}

.footer-btn-2 {
  width: 34.93333333333333vw;
  height: 10.666666666666668vw;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: url("assets/active_page_2.png");
  background-size: cover;
  background-repeat: no-repeat;
  color: #1f1343;
  font-weight: 500;
  font-size: 14px;
}

/* Task Section */
.task-section {
  background: #170229;
  /* Spacing handled by whitespace-6 elements */
}

.task-title-bg {
  width: 100vw;
  height: 31.288888888888888vw;
  background-image: url("assets/task_bg_1.png");
  background-size: cover;
  background-repeat: no-repeat;
}

.task-title-text {
  width: 87.2vw;
  height: 20.266666666666666vw;
  padding-top: 9.733333333333333vw;
  margin: 3.2vw auto 1.0666666666666667vw;
  background-image: url("assets/task_title.png");
  background-size: cover;
  background-repeat: no-repeat;
  font-weight: 600;
  color: #ffffff;
  display: flex;
  justify-content: center;
  box-sizing: border-box;
  font-size: 16px;
}

.task-subtitle {
  font-size: 14px;
  color: #d0c4e1;
  text-align: center;
}

.task-list {
  background-color: #56197d;
}

.task-item {
  display: flex;
  align-items: center;
  padding: 12px 12px;
  /* border-top: 1px solid rgba(0, 0, 0, 0.3); */
  background: #56197d;
  min-height: 84px;
  position: relative; /* Provide positioning context for pseudo-elements */
}

.task-item::before {
  content: "";
  position: absolute;
  bottom: 0; /* Border should be at the bottom */
  left: 12px;
  right: 12px;
  height: 1px; /* Use height instead of border-top */
  background: rgba(0, 0, 0, 0.3); /* Use original color */
  transform: scaleY(0.5); /* 0.5px thin line effect */
  z-index: 2;
}

.task-item:last-child {
  border-bottom: 1px solid rgba(0, 0, 0, 0.3);
}

.task-item-image {
  width: 44px;
  height: 44px;
  margin: 0 10px 0 12px;
  overflow: hidden;
}

.task-item-content {
  flex: 1;
  padding-right: 12px;
}

.task-item-title {
  font-size: 14px;
  color: #ffffff;
  font-weight: 500;
  line-height: 1.3;
  margin: 0 0 4px 0;
}

.task-item-reward {
  display: flex;
  align-items: center;
  height: 16px;
}

.task-candy-icon {
  width: 20px;
  height: 14px;
  overflow: hidden;
}

.task-candy-text {
  font-size: 12px;
  color: #ffd800;
  line-height: 1;
  margin: 0 0 0 4px;
}

.task-item-button {
  width: 19.733333333333334vw;
  height: 7.733333333333333vw;
  background-image: url("assets/button_go.png");
  background-size: cover;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4c1701;
  font-weight: 500;
  font-size: 12px;
  margin-right: 12px;
}

.task-item-button.done {
  opacity: 0.5;
}

.task-bottom-bg {
  width: 100vw;
  height: 7.466666666666668vw;
  background-image: url("assets/task_bg_2.png");
  background-size: cover;
  background-repeat: no-repeat;
  position: relative;
  top: -3vw;
}

.bottom-btn {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 320px;
  height: 40px;
  background: #fc8e35;
  border-radius: 24px;
  font-size: 16px;
  color: #ffffff;
  letter-spacing: 0;
  line-height: 40px;
  font-weight: 500;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(252, 142, 53, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
}

.bottom-btn:hover {
  background: #e67e25;
  box-shadow: 0 6px 16px rgba(252, 142, 53, 0.4);
  transform: translateX(-50%) translateY(-2px);
}

.bottom-btn:active {
  transform: translateX(-50%) translateY(0);
  box-shadow: 0 2px 8px rgba(252, 142, 53, 0.3);
}

/* Animations */
@keyframes popScale {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes rotate {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Enhanced video item styles - show cover image only */
.video-item {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Amazon coupon modal styles */
.coupon-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  /* Use opacity and visibility to control show/hide, avoid display switching */
  opacity: 0;
  visibility: hidden;
  /* transition: opacity 0.3s ease, visibility 0.3s ease; */
  /* Ensure no page interference when non-interactive */
  pointer-events: none;
}

.coupon-modal-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Prevent page scrolling - simplest method to avoid flickering */
body.modal-open {
  overflow: hidden;
}

.coupon-modal {
  background: white;
  border-radius: 12px;
  padding-top: 24px;
  width: 270px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  position: relative;

  display: flex;
  flex-direction: column;
  align-items: center;
}

.coupon-code-display {
  background: #f4f7f9;
  border-radius: 8px;
  padding: 6px 36px;

  margin-bottom: 10px;

  font-size: 16px;
  color: #fc8e35;
  letter-spacing: 0;
  text-align: center;
  font-weight: 600;
}

.coupon-message {
  margin-bottom: 20px;
}

.coupon-title {
  font-size: 13px;
  color: #1f2429;
  line-height: 1.4;
}

.coupon-subtitle {
  font-size: 13px;
  color: #1f2429;
  line-height: 1.4;
}

.coupon-buttons {
  display: flex;
  flex-direction: row;
  width: 100%;
}

.coupon-btn {
  height: 44px;
  flex: 1;
}

.cancel-btn {
  font-size: 16px;
  color: #fc8e35;
  letter-spacing: 0;
  text-align: center;
  line-height: 42px;
  font-weight: 400;
  border-top: 1px solid #d9d9d9;
  border-right: 1px solid #d9d9d9;
}

.amazon-btn {
  font-size: 16px;
  color: #fc8e35;
  letter-spacing: 0;
  text-align: center;
  line-height: 42px;
  font-weight: 800;
  border-top: 1px solid #d9d9d9;
}

/* Responsive utilities */
@media (max-width: 480px) {
  .time-span {
    width: 18px;
    height: 18px;
    font-size: 10px;
  }

  .task-item-title {
    font-size: 13px;
  }

  .task-candy-text {
    font-size: 11px;
  }
}
