/* Float Menu Component CSS */
body{
  padding: 0;
  margin: 0;
}
/* CSS 變數定義 */
:root {
  --white: #ffffff;
  --gradient-cyan: #00ffff;
  --gradient-purple: #00215f;
  --gradient-blue: #0058ff;
}

/* 右側浮動選單 */
.float_menu {
  position: fixed;
  right: 10px;
  top: 30%;
  transform: translateY(-50%) translateX(20px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
  will-change: transform, opacity, visibility;
}

/* 顯示狀態控制 */
.show-floating-menu .float_menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
  transition: all 0.3s ease;
  pointer-events: auto;
}

.hide-floating-menu .float_menu {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-50%) translateX(20px);
  transition: none; /* 隱藏時立即生效，避免殘影 */
  pointer-events: none;
}

/* 確保隱藏時完全不可見 */
.hide-floating-menu .float_menu * {
  pointer-events: none;
}

/* 選單項目 */
.float_menu_item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 15px;
}

.float_menu_item:hover {
  transform: translateX(-10px);
}

.float_menu_item:active {
  transform: translateX(-10px) scale(0.95);
}

/* 選單圖標 */
.menu_icon {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
  position: relative;
  z-index: 10;
}

.float_menu_item:hover .menu_icon {
  transform: scale(1.05);
}

.menu_icon img {
  width: 95px;
  height: 95px;
  filter: brightness(1.2);
}

/* 工具提示 */
.menu_tooltip {
  position: absolute;
  right: 110px;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(135deg, var(--gradient-purple), var(--gradient-blue));
  color: var(--white);
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  border: 2px solid var(--gradient-cyan);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  z-index: 5;
}

.menu_tooltip::after {
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border: 8px solid transparent;
  border-left-color: var(--gradient-cyan);
}

.float_menu_item:hover .menu_tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(-8px);
}

/* 響應式設計 */
@media (max-width: 768px) {
  .float_menu {
    right: 10px;
  }
  
  .menu_icon img {
    width: 45px;
    height: 45px;
  }
  
  .menu_tooltip {
    right: 120%;
    font-size: 0.9rem;
    padding: 10px 16px;
  }
}

@media (max-width: 480px) {
  .float_menu {
    right: 5px;
  }
  
  .menu_icon img {
    width: 60px;
    height: 60px;
  }
  
  .menu_tooltip {
    font-size: 0.8rem;
    padding: 8px 12px;
  }
  
  .float_menu_item {
    margin-bottom: 10px;
  }
}

/* 動畫效果 */
@keyframes floatMenuFadeIn {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

@keyframes floatMenuFadeOut {
  from {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
  to {
    opacity: 0;
    transform: translateY(-50%) translateX(20px);
  }
}

/* 可選：自定義主題 */
.float_menu.theme-dark {
  --gradient-cyan: #00ffff;
  --gradient-purple: #4a148c;
  --gradient-blue: #1565c0;
}

.float_menu.theme-light {
  --gradient-cyan: #00bcd4;
  --gradient-purple: #9c27b0;
  --gradient-blue: #2196f3;
}

/* 右下角禮物圖示 */
.gift-icon {
  position: fixed;
  right: 5px;
  bottom: 20px;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  pointer-events: none;
  will-change: transform, opacity, visibility;
}

.gift-icon img {
  width: 100px;
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s ease, filter 0.3s ease;
}

/* Hover 效果 */
.gift-icon:hover {
  transform: translateY(0) scale(1.1);
}

.gift-icon:hover img {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3)) brightness(1.3);
}

/* 顯示狀態控制 - 與側邊選單同步 */
.show-floating-menu .gift-icon {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: all 0.3s ease;
  pointer-events: auto;
}

.show-floating-menu .gift-icon:hover {
  transform: translateY(0) scale(1.1);
}

.hide-floating-menu .gift-icon {
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: none; /* 隱藏時立即生效，避免殘影 */
  pointer-events: none;
}

/* 響應式設計 */
@media (max-width: 768px) {
  .gift-icon {
    right: 15px;
    bottom: 15px;
  }
  
  .gift-icon img {
    width: 60px;
  }
}

@media (max-width: 480px) {
  .gift-icon {
    right: 5px;
    bottom: 10px;
  }
  
  .gift-icon img {
    width: 50px;
  }
}
