@tailwind base;
@tailwind components;
@tailwind utilities;

html,
body {
  @apply h-full;
  @apply w-full;
}

html,
body,
#__next,
main {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
  overscroll-behavior: none !important;
  -webkit-overflow-scrolling: touch !important;
  -ms-overflow-style: none !important;
  scrollbar-width: none !important;
  touch-action: manipulation !important;
  font-family: 'Montserrat', 'Heebo', 'Assistant', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol' !important;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  font-family: 'Montserrat', 'Heebo', 'Assistant', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
}

:root {
  --vh: 1vh;
}

:-webkit-full-screen {
  background: #000;
}

:fullscreen {
  background: #000;
}

@keyframes slideInFromBottom {
  0% {
    transform: translate3d(0, 100%, 0);
    opacity: 0.95;
  }
  100% {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}

@keyframes slideInFromTop {
  0% {
    transform: translate3d(0, -100%, 0);
    opacity: 0.95;
  }
  100% {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}

@keyframes slideOutToTop {
  0% {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
  100% {
    transform: translate3d(0, -100%, 0);
    opacity: 0.95;
  }
}

@keyframes slideOutToBottom {
  0% {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
  100% {
    transform: translate3d(0, 100%, 0);
    opacity: 0.95;
  }
}

@keyframes bounceBack {
  0% {
    transform: translate3d(0, 0, 0);
  }
  30% {
    transform: translate3d(0, -4px, 0);
  }
  60% {
    transform: translate3d(0, 0, 0);
  }
  80% {
    transform: translate3d(0, 2px, 0);
  }
  100% {
    transform: translate3d(0, 0, 0);
  }
}

.container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%; /* Fallback */
  height: calc(var(--vh, 1vh) * 100);
  max-height: -webkit-fill-available;
  transition: background 0.3s ease;
  overflow: hidden;
  touch-action: pan-y;
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
  perspective: 1000px;
  transform-style: preserve-3d;
  /* Support for iOS safe areas */
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom)
    env(safe-area-inset-left);
}

.chrome-mobile-container {
  padding: 0 !important;
}

.timestamp {
  position: absolute;
  top: max(13px, env(safe-area-inset-top));
  right: 46px;
  color: white;
  font-size: 16px;
  font-weight: bold;
  z-index: 1000;
  display: flex;
  align-items: center;
  transition: opacity 0.3s ease;
  flex-direction: row-reverse;
  font-family: 'Montserrat', 'Heebo', 'Assistant', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, Helvetica, Arial, sans-serif;
}

.timestamp_star {
  margin-left: 8px;
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
}

.timestamp_star svg {
  width: 24px;
  height: 24px;
  vertical-align: middle;
}

.close_button {
  position: fixed;
  top: 4.5vh;
  left: 8vw;
  border: none;
  background: none;
  z-index: 9999;
  padding: 0;
}

body[dir='ltr'] .close_button {
  left: unset;
  right: 8vw;
}

.slide_container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  will-change: transform;
  perspective: 1000px;
  transform-style: preserve-3d;
  background-color: black;
  transform: translate3d(0, 0, 0);
  isolation: isolate;
  z-index: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.slide,
.prev_slide,
.next_slide {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
  transform-style: preserve-3d;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transition: transform 0.2s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.15s ease-out;
  transform-origin: center center;
  isolation: isolate;
  filter: none !important;
}

.prev_slide:not(.dragging):not(.transitioning),
.next_slide:not(.dragging):not(.transitioning) {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: none !important;
}

.slide_container:not(.dragging):not(.slide-container-transitioning) .prev_slide,
.slide_container:not(.dragging):not(.slide-container-transitioning) .next_slide {
  opacity: 0 !important;
  visibility: hidden !important;
  display: none !important;
}

.slide[style*='display: none'],
.prev_slide[style*='display: none'],
.next_slide[style*='display: none'] {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  display: none !important;
}

html.transitioning {
  overscroll-behavior: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
       user-select: none;
  overflow: hidden;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  touch-action: pan-y;
  transition: transform 0.2s cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 0.2s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform, opacity;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translate3d(0, 0, 0);
}

/* Shared styles for next and previous slide peeks */
.next_slide_peek,
.prev_slide_peek {
  position: absolute;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  will-change: transform;
  z-index: 1;
  transition: transform 0.2s cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 0.2s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Position next slide below current */
.next_slide_peek {
  top: 100%;
  transform: translateY(0);
}

/* Position previous slide above current */
.prev_slide_peek {
  top: -100%;
  transform: translateY(0);
}

.content_container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  position: relative;
}

.slide_active {
  z-index: 10;
}

.slide_up_enter {
  animation: slideInFromBottom 0.2s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.slide_up_exit {
  animation: slideOutToTop 0.2s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.slide_down_enter {
  animation: slideInFromTop 0.2s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.slide_down_exit {
  animation: slideOutToBottom 0.2s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.bounce_back {
  animation: bounceBack 0.2s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.loading_message {
  color: white;
  font-size: 24px;
  text-align: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  font-family: 'Montserrat', 'Heebo', 'Assistant', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, Helvetica, Arial, sans-serif;
}

.footer_container {
  position: absolute;
  bottom: 1.5rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 1000;
  transform: scale(0.7);
  opacity: 0.8;
}

.footer_container-no-background {
  bottom: 0.5rem !important;
}

/* Responsive footer for different screen sizes */
@media (min-width: 768px) {
  .footer_container {
    bottom: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .footer_container {
    bottom: 1.75rem;
  }
}

@media (min-width: 1440px) {
  .footer_container {
    bottom: 2rem;
  }
}

@media (min-height: 800px) {
  .footer_container {
    bottom: 2rem;
  }
}

@media (min-height: 1000px) {
  .footer_container {
    bottom: 2.5rem;
  }
}

/* Mobile specific adjustments */
@media (max-width: 480px) {
  .footer_container {
    transform: scale(0.6);
    opacity: 0.7;
  }
}

.action_buttons {
  position: absolute;
  bottom: 9%;
  right: max(40px, env(safe-area-inset-right));
  display: flex;
  gap: 15px;
  z-index: 1000;
  flex-direction: row;
  align-items: center;
}

/* Style for CircleButton components inside action_buttons */
.action_buttons button {
  position: relative;
}

.action_button {
  background: transparent;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease;
  outline: none;
  padding: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.action_button:active {
  transform: scale(0.9);
}

.poll_container {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: max(5vh, calc(env(safe-area-inset-top) + 5vh));
  position: relative;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 75.39%,
    rgba(0, 0, 0, 0.43) 99.65%,
    rgba(255, 255, 255, 0.5) 133.69%
  );
}

.poll_progress_bar_container {
  position: relative;
  width: 100%;
  z-index: 1000;
  margin-bottom: 10px;
  height: 20px;
  display: block;
}

.poll_content {
  transform: scale(0.99);
  transform-origin: center top;
  width: 86%;
  height: 90%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: none;
  background: none;
  position: relative;
  z-index: 10;
  font-family: 'Montserrat', 'Heebo', 'Assistant', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, Helvetica, Arial, sans-serif;
}

.poll_content * {
  font-family: 'Montserrat', 'Heebo', 'Assistant', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, Helvetica, Arial, sans-serif !important;
}

.poll_content [class*='questionTitle'] {
  color: white !important;
  font-family: 'Montserrat', 'Heebo', 'Assistant', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, Helvetica, Arial, sans-serif !important;
}

.poll_content [class*='itemOptionTitle'],
.poll_content [class*='itemOptionPercentage'],
.poll_content [class*='footer'] {
  font-family: 'Montserrat', 'Heebo', 'Assistant', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, Helvetica, Arial, sans-serif !important;
}

.poll_content [class*='container'] {
  background: transparent !important;
  box-shadow: none !important;
}

.poll_content [class*='inline-standalone-poll_container'] {
  padding-bottom: 72px;
  justify-content: center;
}

.poll_content--top [class*='inline-standalone-poll_container'] {
  justify-content: flex-start;
}

.poll_content--center [class*='inline-standalone-poll_container'] {
  justify-content: center;
}

.poll_content--bottom [class*='inline-standalone-poll_container'] {
  justify-content: flex-end;
}

@media (max-height: 600px) {
  .poll_container {
    padding-top: max(3vh, calc(env(safe-area-inset-top) + 3vh));
  }
}

@media (min-height: 900px) {
  .poll_container {
    padding-top: max(8vh, calc(env(safe-area-inset-top) + 8vh));
  }
}

/* Like Button Animation */
.like-pulse {
  animation: like-pulse-animation 0.6s ease;
}

@keyframes like-pulse-animation {
  0% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.2);
  }
  50% {
    transform: scale(0.95);
  }
  75% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.copy_feedback {
  position: absolute;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 14px;
  bottom: 60px;
  right: 0;
  white-space: nowrap;
  animation: fadeIn 0.3s ease-in-out;
  z-index: 100;
  font-family: 'Montserrat', 'Heebo', 'Assistant', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, Helvetica, Arial, sans-serif;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Fix for mobile browser toolbar issues */
@supports (-webkit-touch-callout: none) {
  /* CSS specific to iOS devices */
  html,
  body {
    height: -webkit-fill-available;
  }

  .container {
    height: -webkit-fill-available;
  }
}

/* Add standard support check too */
@supports (touch-callout: none) {
  /* CSS specific to browsers that support standard property */
  html,
  body {
    height: 100%;
  }

  .container {
    height: 100%;
  }
}

@media screen and (display-mode: standalone) {
  /* CSS for PWA mode */
  .container {
    height: 100%;
  }
}

/* Swipe Up Animation */
@keyframes fadeInOut {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.swipe_up_overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 3, 3, 0.7);
  -webkit-backdrop-filter: blur(2.8px);
          backdrop-filter: blur(2.8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeInOut 2s ease-in-out forwards;
}

.swipe_up_container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.swipe_up_container img,
.swipe_up_container span {
  background: transparent !important;
}

.swipe_up_text {
  color: white;
  font-size: 20px;
  font-weight: bold;
  margin-top: 15px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  font-family: 'Montserrat', 'Heebo', 'Assistant', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, Helvetica, Arial, sans-serif;
}

.list-questions_footer__0Bpa9,
.container .list-questions_footer__0Bpa9 {
  display: none !important;
}

.loading_placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top: 4px solid white;
  animation: spin 1s linear infinite;
}

.poll_spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top: 4px solid white;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

.poll_loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes float {
  0% {
    transform: translateY(0);
  }
  25% {
    transform: translateY(15px);
  }
  50% {
    transform: translateY(-30px);
  }
  75% {
    transform: translateY(15px);
  }
  100% {
    transform: translateY(0);
  }
}

.container-transitioning {
  pointer-events: none;
}

.slide-container-transitioning {
  filter: blur(0);
  transform: translate3d(0, 0, 0) scale(1.0001);
  perspective: 1000;
  transform-style: preserve-3d;
}

.slide-container-transitioning .slide,
.slide-container-transitioning .next_slide,
.slide-container-transitioning .prev_slide {
  transform-style: preserve-3d;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  filter: blur(0);
}

.slide-container-transitioning .slide {
  transition-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1) !important;
  transition-duration: 0.18s !important;
}

.swiper-slide.swiper-slide-active {
  direction: rtl !important;
}

/* Embla carousel styles */
.embla {
  overflow: hidden;
  height: 100vh;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.embla__container {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin-top: 0;
  transition: background-color 0.5s ease;
}

.embla__slide {
  flex: 0 0 100%;
  min-width: 0;
  min-height: 100vh;
  position: relative;
  will-change: transform;
  transition: opacity 0.3s ease;
}

.embla__slide--current {
  z-index: 2;
}

/* Smoother transitions */
.embla .content_container {
  opacity: 1;
  transition: opacity 0.4s ease;
}

.embla__slide:not(.embla__slide--current) .content_container {
  pointer-events: none;
}

/* Fix for video element */
.embla__slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body,
html,
#__next {
  background: transparent !important;
  overflow: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background: transparent;
}

.global-background {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background: transparent;
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
}

/* Desktop Phone Frame - Add at the end of the file */
.desktop-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #4d48488d;
  z-index: 100;
  padding: 20px;

  .cta-button-container {
    right: 3%;

    body[dir='ltr'] & {
      right: unset;
      left: 1%;
    }
  }
}

.cta-button-container {
  position: absolute;
  right: 5%;
  bottom: 46px;
  z-index: 100;
}

body[dir='ltr'] .cta-button-container {
  right: unset;
  left: 1%;
}

.mobile-frame {
  height: 85vh;
  width: calc((85vh * 9) / 16);
  max-width: 95vw;
  max-height: 95vh;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  position: relative;
  margin: 0 auto;
}

@media (max-height: 600px) and (min-width: 800px) {
  .mobile-frame {
    height: 95vh;
    width: calc((95vh * 9) / 16);
  }
}

@media (max-width: 1024px) and (orientation: landscape) {
  .mobile-frame {
    height: 85vh;
    width: calc((85vh * 9) / 16);
  }
}

.mobile-frame .embla {
  height: 100% !important;
}

.mobile-frame .embla__slide {
  min-height: unset !important;
  height: 100% !important;
}

.mobile-frame .content_container {
  height: 100% !important;
}

.mobile-frame .close_button {
  top: 5%;
  left: 8%;
}

body[dir='ltr'] .mobile-frame .close_button {
  left: unset;
  right: 8%;
}

/* Styling for display over carousel */
.over-carousel {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 9999 !important;
  background: transparent !important;
}

/* Apply animation only when over carousel */
.over-carousel {
  animation: fadeIn 0.3s forwards;
}

/* Add overlay when over carousel */
.over-carousel::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: -1;
}

/* Close button styling */
.over-carousel .close_button {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  padding: 10px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}

body[dir='ltr'] .over-carousel .close_button {
  left: 20px;
  right: unset;
}

.over-carousel .close_button:hover {
  background: rgba(0, 0, 0, 0.6);
}

/* Placeholder content for non-active slides to optimize performance */
.placeholder_content {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  min-height: 100vh;
  position: relative;
}

.placeholder_spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  opacity: 0.8;
}

.mb-100 {
  margin-bottom: 100px;
}

