/* Gesture Tutorial CSS - Fully Responsive */

#gesture-tutorial-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 999999;
  display: none;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.4s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
}

#gesture-tutorial-overlay.active {
  display: flex;
  opacity: 1;
}

#gesture-tutorial-overlay.fade-out {
  opacity: 0;
}

/* Tutorial Title */
.gesture-tutorial-title {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  margin: 0;
  width: 90%;
}

.gesture-tutorial-title span {
  color: #00ff64;
}

/* Tutorial Content Container */
.gesture-tutorial-content {
  display: flex;
  flex-direction: row;
  gap: 40px;
  padding: 40px;
  max-width: 1200px;
  margin-top: 60px;
}

/* Individual Gesture Card */
.gesture-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 25px 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  min-width: 180px;
  flex: 1;
}

.gesture-card-title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 15px;
}

.gesture-card-action {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-top: 15px;
}

/* Hand SVG Container */
.gesture-hand-container {
  width: 100px;
  height: 140px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.gesture-hand-svg {
  width: 70px;
  height: auto;
  filter: drop-shadow(0 4px 20px rgba(0, 255, 100, 0.3));
}

/* Skip button */
.gesture-skip-btn {
  position: absolute;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 30px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 30px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.gesture-skip-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Countdown timer */
.gesture-countdown {
  position: absolute;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
}

/* SCROLL UP ANIMATION */
.scroll-up-hand {
  animation: scrollUpAnim 1.8s ease-in-out infinite;
}

@keyframes scrollUpAnim {
  0%, 100% {
    transform: translateY(25px);
    opacity: 0.4;
  }
  50% {
    transform: translateY(-25px);
    opacity: 1;
  }
}

.gesture-card.scroll-up .gesture-hand-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 14px solid rgba(0, 255, 100, 0.6);
  animation: arrowPulseUp 1.8s ease-in-out infinite;
}

@keyframes arrowPulseUp {
  0%, 100% { 
    opacity: 0.3; 
    transform: translateX(-50%) translateY(10px); 
  }
  50% { 
    opacity: 1; 
    transform: translateX(-50%) translateY(-5px); 
  }
}

/* SCROLL DOWN ANIMATION */
.scroll-down-hand {
  animation: scrollDownAnim 1.8s ease-in-out infinite;
}

@keyframes scrollDownAnim {
  0%, 100% {
    transform: translateY(-25px);
    opacity: 0.4;
  }
  50% {
    transform: translateY(25px);
    opacity: 1;
  }
}

.gesture-card.scroll-down .gesture-hand-container::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 14px solid rgba(0, 255, 100, 0.6);
  animation: arrowPulseDown 1.8s ease-in-out infinite;
}

@keyframes arrowPulseDown {
  0%, 100% { 
    opacity: 0.3; 
    transform: translateX(-50%) translateY(-10px); 
  }
  50% { 
    opacity: 1; 
    transform: translateX(-50%) translateY(5px); 
  }
}

/* PINCH TO CLICK ANIMATION */
.pinch-hand {
  animation: pinchAnim 2s ease-in-out infinite;
}

@keyframes pinchAnim {
  0%, 20%, 100% {
    transform: scale(1);
  }
  35%, 65% {
    transform: scale(0.9);
  }
}

.gesture-card.pinch .gesture-hand-container::after {
  content: '';
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 25px;
  height: 25px;
  border: 3px solid rgba(0, 255, 100, 0.8);
  border-radius: 50%;
  animation: pinchCircle 2s ease-in-out infinite;
}

@keyframes pinchCircle {
  0%, 20%, 100% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.3;
  }
  35%, 65% {
    transform: translate(-50%, -50%) scale(0.6);
    opacity: 1;
  }
}

/* =========================================================
   TABLET STYLES (max-width: 992px)
   ========================================================= */
@media (max-width: 992px) {
  .gesture-tutorial-title {
    font-size: 24px;
    top: 25px;
  }

  .gesture-tutorial-content {
    gap: 25px;
    padding: 30px 20px;
    margin-top: 50px;
  }

  .gesture-card {
    padding: 20px 15px;
    min-width: 150px;
  }

  .gesture-card-title {
    font-size: 11px;
    letter-spacing: 1px;
    margin-bottom: 12px;
  }

  .gesture-card-action {
    font-size: 16px;
    margin-top: 12px;
  }

  .gesture-hand-container {
    width: 80px;
    height: 110px;
  }

  .gesture-hand-svg {
    width: 55px;
  }

  .gesture-countdown {
    bottom: 65px;
    font-size: 13px;
  }

  .gesture-skip-btn {
    bottom: 20px;
    padding: 10px 25px;
    font-size: 13px;
  }
}

/* =========================================================
   MOBILE STYLES (max-width: 768px)
   ========================================================= */
@media (max-width: 768px) {
  #gesture-tutorial-overlay {
    padding: 15px;
    align-items: flex-start;
    padding-top: 80px;
  }

  .gesture-tutorial-title {
    font-size: 20px;
    top: 20px;
    width: 95%;
  }

  .gesture-tutorial-content {
    flex-direction: column;
    gap: 15px;
    padding: 10px;
    margin-top: 20px;
    width: 100%;
  }

  .gesture-card {
    flex-direction: row;
    padding: 15px 20px;
    min-width: unset;
    width: 100%;
    gap: 15px;
    text-align: left;
    align-items: center;
  }

  .gesture-card-title {
    display: none;
  }

  .gesture-card-action {
    font-size: 16px;
    margin-top: 0;
    flex: 1;
  }

  .gesture-hand-container {
    width: 60px;
    height: 80px;
    flex-shrink: 0;
  }

  .gesture-hand-svg {
    width: 45px;
  }

  /* Smaller animations on mobile */
  @keyframes scrollUpAnim {
    0%, 100% {
      transform: translateY(15px);
      opacity: 0.4;
    }
    50% {
      transform: translateY(-15px);
      opacity: 1;
    }
  }

  @keyframes scrollDownAnim {
    0%, 100% {
      transform: translateY(-15px);
      opacity: 0.4;
    }
    50% {
      transform: translateY(15px);
      opacity: 1;
    }
  }

  .gesture-card.scroll-up .gesture-hand-container::before,
  .gesture-card.scroll-down .gesture-hand-container::before {
    border-left-width: 8px;
    border-right-width: 8px;
  }

  .gesture-card.scroll-up .gesture-hand-container::before {
    border-bottom-width: 10px;
  }

  .gesture-card.scroll-down .gesture-hand-container::before {
    border-top-width: 10px;
  }

  .gesture-card.pinch .gesture-hand-container::after {
    width: 20px;
    height: 20px;
    border-width: 2px;
  }

  .gesture-countdown {
    bottom: 60px;
    font-size: 12px;
  }

  .gesture-skip-btn {
    bottom: 15px;
    padding: 10px 20px;
    font-size: 12px;
  }
}

/* =========================================================
   SMALL MOBILE STYLES (max-width: 480px)
   ========================================================= */
@media (max-width: 480px) {
  #gesture-tutorial-overlay {
    padding: 10px;
    padding-top: 70px;
  }

  .gesture-tutorial-title {
    font-size: 18px;
    top: 15px;
  }

  .gesture-tutorial-content {
    gap: 10px;
    padding: 5px;
  }

  .gesture-card {
    padding: 12px 15px;
    gap: 12px;
    border-radius: 15px;
  }

  .gesture-card-action {
    font-size: 14px;
  }

  .gesture-hand-container {
    width: 50px;
    height: 65px;
  }

  .gesture-hand-svg {
    width: 38px;
  }

  .gesture-countdown {
    bottom: 55px;
    font-size: 11px;
  }

  .gesture-skip-btn {
    bottom: 12px;
    padding: 8px 18px;
    font-size: 11px;
  }
}

/* =========================================================
   LANDSCAPE MOBILE FIX
   ========================================================= */
@media (max-height: 500px) and (orientation: landscape) {
  #gesture-tutorial-overlay {
    padding-top: 10px;
    align-items: center;
  }

  .gesture-tutorial-title {
    position: relative;
    top: 0;
    transform: none;
    margin-bottom: 10px;
    font-size: 16px;
  }

  .gesture-tutorial-content {
    flex-direction: row;
    margin-top: 5px;
    gap: 15px;
    padding: 10px;
  }

  .gesture-card {
    flex-direction: column;
    padding: 10px;
  }

  .gesture-card-title {
    display: block;
    font-size: 9px;
    margin-bottom: 5px;
  }

  .gesture-card-action {
    font-size: 12px;
    margin-top: 5px;
  }

  .gesture-hand-container {
    width: 50px;
    height: 60px;
  }

  .gesture-hand-svg {
    width: 35px;
  }

  .gesture-countdown {
    bottom: 40px;
    font-size: 10px;
  }

  .gesture-skip-btn {
    bottom: 8px;
    padding: 6px 15px;
    font-size: 10px;
  }
}
