/* Spider Popup - Simple Welcome Modal */

.spider-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}

/* .spider-popup-overlay.hidden,
.spider-action-buttons.hidden {
  display: none;
} */

.spider-popup-container {
  overflow: hidden;
  position: relative;
  background: #02cdf8;
  border-radius: 30px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  width: 90vw;
  max-width: 1100px;
  height: 80vh;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 10px;
  animation: modalSlideIn 0.4s ease-out;
  background-image: url("../assets/images/spider-bg.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Close Button */
.spider-close-btn {
  position: absolute;
  top: 25px;
  right: 30px;
  background: none;
  border: none;
  font-size: 40px;
  color: var(--color-dark-gunmetal-60);
  cursor: pointer;
  padding: 0;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
}
.chat-back-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(255, 255, 255, 1);
  border: 2px solid #ffa500;
  color: #ffa500;
  font-size: 24px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease-in-out;
  visibility: visible;
  opacity: 1;
}

.chat-back-btn:hover {
  transform: scale(1.1);
}

.chat-back-btn.hidden {
  visibility: hidden;
  opacity: 0;
}

/* Hand animations now handled by GSAP */
.spider-close-btn:hover {
  background: var(--color-light-gray);
  color: var(--color-brilliant-blue);
  transform: rotate(90deg);
}

/* Welcome Section */
.spider-welcome-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
  margin-bottom: 40px;
  position: relative;
  width: 100%;
}

.spider-welcome-image {
  height: auto;
  margin-bottom: 30px;
  animation: gentleBounce 3s ease-in-out infinite;
}

.welcome-speech-bubble {
  background: #fff;
  color: #000;
  border-radius: 25px;
  padding: 10px;
  position: relative;
  max-width: 600px;
  box-shadow: 0 10px 25px rgba(2, 205, 248, 0.3);
  position: absolute;
  top: 100px;
  right: 60px;
  max-width: 360px;
  z-index: 100;
  padding: 20px 25px;
  transition: all 0.5s ease-in-out;
  transition-delay: 0.5s;
}

.playlist-mode .welcome-speech-bubble {
  right: 125px;
}

.welcome-speech-bubble::before {
  content: "";
  position: absolute;
  bottom: -15px;
  left: 20%;
  width: 0;
  height: 0;

  border-right: 22px solid transparent;
  border-top: 20px solid #fff;
}

.welcome-speech-bubble p {
  font-family: "Gurgle Jock", sans-serif;
  font-size: 28px;
  font-weight: 400;
  margin: 0;
  line-height: 1.3;
}

.speech-bubble-scale {
  animation: speechBubbleScale 1s ease-in-out;
}

@keyframes speechBubbleScale {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* Action Buttons */
.spider-action-buttons {
  display: flex;
  gap: 25px;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 0 20px 45px 20px;
  position: absolute;
  bottom: 0;
  transition: all 0.3s ease-in-out;
  z-index: -1;
}
.spider-action-buttons.hidden {
  opacity: 0;
  visibility: hidden;
}
.action-btn {
  position: relative;
  background-color: #fff;
  color: var(--color-dark-gunmetal-light);
  border-radius: 100px;
  padding: 10px;
  font-family: "Lato", sans-serif;
  font-size: var(--font-size-md);
  font-weight: 400;
  letter-spacing: 1px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease-in-out;
  height: 60px;
  width: 295px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #121d31;
}

.action-btn:hover {
  transform: scale(1.1);
}

.read-btn {
  border: 1px solid #3dcd76;
  box-shadow: 0px 5px 0px 0px #3dcd76;
}

.play-btn {
  border: 1px solid #e395e0;
  box-shadow: 0 4px 0 #e395e0;
}

.chat-btn {
  background-color: #ffd93b;
  box-shadow: 0 4px 0 #ffa500;
  border: 1px solid #ffa500;
}

.age-btn {
  background-color: #fff !important;
  border: 1px solid #ffd93b !important;
  box-shadow: 0px 5px 0px 0px #ffd93b !important;
  color: var(--color-dark-gunmetal-light) !important;
}

/* Emoji Keyboard */
.emoji-keyboard-container {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 20px;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  z-index: 50;
  border: 3px solid #ffd93b;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.emoji-keyboard-container.hidden {
  display: none;
}

.emoji-keyboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 15px 0 15px;
}

.emoji-keyboard-header h3 {
  margin: 0;
  color: #333;
  font-family: "Gurgle Jock", sans-serif;
  font-size: 1rem;
}

.emoji-close-btn {
  background: none;
  border: none;
  font-size: 30px;
  color: #666;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.emoji-close-btn:hover {
  background: #f0f0f0;
  color: #333;
}

.emoji-keyboard-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 15px;
}

.emoji-categories {
  display: flex;

  gap: 10px;
  justify-content: space-between;
}

.emoji-category {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.emoji-category.active {
  border-bottom-color: #323898;
  background: none;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(35px, 1fr));
  gap: 8px;
  max-height: 150px;
  overflow-y: auto;
  margin-bottom: 15px;
  padding: 10px;
  background: #fafafa;
  border-radius: 15px;
}

.emoji-item {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 5px;
  font-size: 1.2rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 35px;
}

.emoji-item:hover {
  background: #fff3cd;
  border-color: #ffd93b;
  transform: scale(1.2);
}

/* Suggested Emojis Section */
.suggested-emojis-section {
  margin-bottom: 0;
  padding: 5px;
  background: linear-gradient(135deg, #ffd93b, #ffed4e);
  border-radius: 15px;
  border: 2px solid #ffa500;
}

.suggested-emojis-section.hidden {
  display: none;
}

.suggested-emojis-header {
  font-family: "Gurgle Jock", sans-serif;
  font-size: 18px;
  color: #333;
  margin-bottom: 10px;
  text-align: center;
  font-weight: normal;
}

.suggested-emojis-grid {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.suggested-emojis-grid .emoji-item {
  background: white;
  border: 2px solid #ffa500;
  border-radius: 10px;
  padding: 8px;
  font-size: 1.4rem;
  box-shadow: 0 2px 4px rgba(255, 165, 0, 0.3);
  animation: suggestedPulse 2s ease-in-out infinite;
}

.suggested-emojis-grid .emoji-item:hover {
  background: #fff;
  border-color: #ff8c00;
  transform: scale(1.3);
  animation: none;
}

@keyframes suggestedPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 2px 4px rgba(255, 165, 0, 0.3);
  }

  50% {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(255, 165, 0, 0.5);
  }
}

.emoji-input-area {
  display: flex;
  gap: 10px;
  width: 100%;
  align-items: center;
}

#emoji-input {
  flex: 1;
  padding: 12px 15px;
  border: 1px solid#EFF3FB;
  background-color: #eff3fb;
  border-radius: 25px;
  font-size: 1rem;
  font-family: "Lato", sans-serif;
  outline: none;
}

#emoji-input:focus {
  border-color: #ffd93b;
  box-shadow: 0 0 0 3px rgba(255, 217, 59, 0.2);
}

.emoji-send-btn {
  background: #62e295;
  border: 1px solid #3db96f;
  border-radius: 12px;
  padding: 12px 20px;
  font-family: "Gurgle Jock", sans-serif;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  /* box-shadow: 0 3px 0 #ffa500; */
}

.emoji-send-btn:hover {
  background: #ffed4e;
  transform: translateY(-2px);
  box-shadow: 0 5px 0 #ffa500;
}

.emoji-send-btn:disabled {
  background: #ccc;
  border-color: #999;
  box-shadow: 0 3px 0 #999;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Video List Container */
.video-list-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-top: 0;
  justify-content: flex-end;
}

.video-list-container.hidden {
  display: none;
}

/* Play Section Container */
.play-section-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-top: 0;
  justify-content: flex-end;
}

.play-section-container.hidden {
  display: none;
}

.play-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 20px;
  height: 350px;
}

.play-content {
  background: white;
  border-radius: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 10px;
  text-align: center;
  max-width: 100%;
  width: 100%;
  height: 100%;
  position: relative;
}

.play-content h3 {
  margin: 0 0 20px 0;
  color: #333;
  font-family: "Gurgle Jock", sans-serif;
  font-size: 28px;
  font-weight: 400;
}

.video-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  grid-auto-rows: 1fr;
  gap: 15px;
  overflow-y: auto;
  padding: 10px;
  height: 350px;
}

.video-item {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.2s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 160px;
  height: fit-content;
}

.video-item:hover {
  transform: scale(1.05);
}

.video-thumbnail {
  width: 100%;
  height: 100px;
  object-fit: cover;
  flex-shrink: 0;
}

.video-title {
  padding: 8px;
  font-size: 12px;
  font-weight: bold;
  color: #333;
  line-height: 1.2;
  text-align: center;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading {
  text-align: center;
  padding: 40px;
  color: #666;
  font-style: italic;
}

/* Video Overlay */
.video-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Spider-specific video overlay classes */
.spider-video-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  z-index: 25000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-overlay.hidden,
.spider-video-overlay.hidden {
  display: none;
}

.spider-video-overlay-content {
  position: relative;
  background: white;
  border-radius: 15px;
  padding: 20px;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.spider-video-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.spider-video-overlay iframe {
  border-radius: 10px;
  width: 100%;
  height: 100%;
}

.spider-video-close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 30px;
  color: #666;
  cursor: pointer;
  z-index: 1;
}

.spider-video-close-btn:hover {
  color: #333;
}

.video-close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 40px;
  color: #666;
  cursor: pointer;
  z-index: 10000;
}

.video-close-btn:hover {
  color: #333;
}

/* Smaller spider when playlist is shown */
.spider-welcome-section.playlist-mode {
  margin-bottom: 0;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.9);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes gentleBounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-15px);
  }

  60% {
    transform: translateY(-8px);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .welcome-speech-bubble {
    right: 0;
  }
  .emoji-keyboard-header {
    padding: 15px;
  }
  .spider-popup-container {
    width: 100vw;
    height: 100vh;
    padding: 30px 20px;
  }
  .spider-welcome-section.playlist-mode .welcome-speech-bubble {
    max-width: 100%;
    right: 0;
  }
  emoji-keyboard-content {
    padding: 10px;
  }

  .emoji-send-btn {
    padding: 10px 20px;
  }

  .emoji-grid {
    display: grid;
    grid-auto-flow: column;
    /* flow items by columns */
    grid-template-rows: repeat(2, 1fr);
    max-width: 350px;
    margin: 0;
  }
  .emoji-grid::-webkit-scrollbar {
    display: none;
  }
}

.spider-welcome-image {
  width: 300px;
  margin-bottom: 0;
}

.spider-welcome-section {
  justify-content: flex-start;
  padding-top: 110px;
}
.welcome-speech-bubble::before {
  right: 20%;
  left: unset;
}

.video-list {
  height: 320px;
}

.spider-close-btn {
  top: 20px;
  right: 20px;
  font-size: 35px;
  width: 45px;
  height: 45px;
}

/* Video Overlay Responsive */
.video-close-btn {
  top: 5px;
  right: 10px;
  font-size: 45px;
}
.video-overlay-content {
  padding: 8px;
  max-width: 80vw;
  max-height: 80vh;
  margin: 5px;
  width: 100%;
  height: 100%;
  position: relative;
  background: white;
  border-radius: 15px;
  overflow: hidden;
}
#video-container {
  width: 100%;
  height: 100%;
}
.video-overlay iframe {
  width: 100%;
  height: 100%;
  max-width: 100%;
  aspect-ratio: 16/9;
  border-radius: 10px;
  overflow: hidden;
}
@media (max-width: 480px) {
  .welcome-speech-bubble p {
    font-size: var(--font-size-md);
  }
  .spider-action-buttons {
    flex-direction: column;
    gap: 15px;
    width: 100%;
  }
  .video-overlay-content,
  .spider-video-overlay-content {
    max-height: 70vh;
    height: auto;
  }

  .spider-video-close-btn {
    top: 5px;
    right: 10px;
    font-size: 25px;
  }

  .action-btn {
    padding: 18px 30px;
    font-size: 18px;
    min-height: 5px;
    width: 100%;
  }
  /* Video Overlay for Very Small Screens */

  .video-close-btn {
    top: 2px;
    right: 5px;
    font-size: 22px;
  }
}

/* Close Confirmation Modal */
.close-confirmation-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.close-confirmation-modal.hidden {
  display: none;
}

.close-confirmation-content {
  background: white;
  border-radius: 15px;
  padding: 20px 15px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-width: 340px;
  height: 150px;
  width: 100%;
}

.close-confirmation-content h3 {
  margin: 0 0 20px 0;
  color: #333;
  font-size: 18px;
  font-family: "Gurgle Jock", sans-serif;
  line-height: 1;
  font-weight: 400;
  max-width: 290px;
  font-size: 20px;
}

.close-confirmation-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.close-confirm-btn,
.close-cancel-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  color: #fff;
  width: 140px;
  height: 40px;
}

.close-confirm-btn {
  background: #f7685d;
  color: white;
}

.close-cancel-btn {
  background: #3dcd76;
  color: white;
}

.close-confirm-btn:hover {
  background: #ff3838;
}

.close-cancel-btn:hover {
  background: #26d063;
}

/* Rock Paper Scissors Game Styles */
.rps-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 100%;
  width: 100%;
  padding: 10px 20px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
  align-items: center;
  justify-content: center;
  height: 100%;
}
.option_title {
  color: var(--color-brilliant-blue);
  font-size: 15px;
  margin: 15px 0;
  font-size: 28px;
  font-family: "Gurgle Jock", sans-serif;
}
.result_images {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  position: relative;
  overflow: hidden;
}

/* Confetti Effects */
.confetti-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 90%;
  height: 90%;
  pointer-events: none;
  z-index: 10;
  overflow: hidden;
  transform: translate(10%, 10%);
}

/* Confetti now uses GIF animation */

.player-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.player-label {
  font-family: "Gurgle Jock", sans-serif;
  font-size: 32px;
  font-weight: normal;
  color: var(--color-brilliant-blue);
}

.vs-text {
  font-family: "Gurgle Jock", sans-serif;
  font-size: 24px;
  font-weight: bold;
  color: var(--color-brilliant-blue);
}

.rps-container.start .user_result {
  transform-origin: left;
  animation: userShake 0.7s ease infinite;
}

@keyframes userShake {
  50% {
    transform: rotate(10deg);
  }
}

.rps-container.start .bot_result {
  transform-origin: right;
  animation: botShake 0.7s ease infinite;
}

@keyframes botShake {
  50% {
    transform: rotate(-10deg);
  }
}

.result_images img {
  width: 100px;
}

.user_result img {
  transform: rotate(90deg);
}

.bot_result img {
  transform: rotate(-90deg) rotateY(180deg);
}

.option_image img {
  width: 50px;
}

.option_images {
  display: flex;
  width: 100%;
  align-items: center;
  margin-top: 0;
  justify-content: center;
  gap: 50px;
}

.rps-container.start .option_images {
  pointer-events: none;
}

.option_image {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}
.option_image img {
  opacity: 0.5;
  cursor: pointer;
  transition: opacity 0.3s ease;
}
.option_image:hover img {
  opacity: 1;
  transform: scale(1.1);
  transition: all 0.3s ease-in-out;
}

.option_image.active img {
  opacity: 1;
  transform: scale(1.1);
}

.option_image img {
  pointer-events: none;
}

.option_image p {
  color: var(--color-brilliant-blue);
  font-size: 24px;
  margin-top: 15px;
  pointer-events: none;
  font-family: "Gurgle Jock", sans-serif;
  letter-spacing: 1px;
}
.options-container {
  border: 1px solid var(--color-brilliant-blue);
  border-radius: 20px;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

/* Play Again Overlay */
.play-again-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.play-again-overlay.hidden {
  display: none;
}

.play-again-content {
  text-align: center;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  border: 2px solid var(--color-brilliant-blue);
  cursor: pointer;
  transition: all 0.3s ease-in-out;
}
.play-again-content:hover {
  transform: scale(1.2);
}
.play-again-content h2 {
  margin: 0;
  font-family: "Gurgle Jock", sans-serif;
  font-size: 36px;
  color: var(--color-brilliant-blue);
  font-weight: normal;
  letter-spacing: 2px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
/* Responsive for rock paper scissors */
@media (max-width: 768px) {
  .rps-container {
    padding: 10px;
    grid-template-columns: 1fr;
  }

  .result_images {
    gap: 25px;
  }
  .option_images {
    gap: 30px;
  }
  .result_images img {
    width: 40px;
  }
  .option_image {
    width: 60px;
  }
  .option_title {
    margin: 0 0 10px 0;
  }
  .option_image img {
    width: 40px;
  }
  .play-section {
    height: 400px;
    padding: 10px;
  }

  .play-again-content {
    padding: 30px 40px;
  }

  .play-again-content h2 {
    font-size: 28px;
  }
}
