/*==================================================
  FLOATING ISLAND NAVIGATION
  Ultra-minimal bottom navigation bar
  Coherente con diseño premium metaverso CoinLottery
  
  Reutiliza funcionalidades existentes:
  - Home: scroll a #home
  - Wallet: navega a wallet.html
  - Game: scroll a #slot
  - Keno: toggleKenoModal()
==================================================*/

/* Variables locales coherentes con el sitio */
:root {
  --island-bg: linear-gradient(135deg, rgba(26, 26, 46, 0.85), rgba(40, 40, 60, 0.75));
  --island-border: rgba(255, 215, 0, 0.3);
  --island-glow-gold: rgba(255, 215, 0, 0.2);
  --island-glow-purple: rgba(139, 92, 246, 0.15);
  --island-btn-active: linear-gradient(135deg, #FFD700 0%, #8b5cf6 100%);
}

/* ==========================================
   NAV CONTAINER - FLOATING ISLAND
   ========================================== */
.floating-island-nav {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  
  /* Glassmorphism premium (como tus modales) */
  background: var(--island-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  
  /* Borde dorado brillante (coherente con tu diseño) */
  border: 2px solid var(--island-border);
  border-radius: 50px;
  
  /* Sombra multicapa con glow dorado/morado (como tus botones) */
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 40px var(--island-glow-gold),
    0 0 60px var(--island-glow-purple),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  
  /* Layout flexbox - column para incluir toggle arriba */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 20px 10px 20px;
  
  /* Animación de entrada (bounce) */
  animation: islandSlideUp 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  
  /* Transición suave para collapse */
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Safe area iPhone (para home indicator) */
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}

/* Container de botones principales */
.island-buttons-container {
  display: flex;
  gap: 15px;
  align-items: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Navegación colapsada - solo muestra toggle */
.floating-island-nav.collapsed {
  padding: 6px 20px;
  border-radius: 30px;
  max-height: 40px;
  overflow: hidden;
}

.floating-island-nav.collapsed .island-buttons-container {
  max-height: 0;
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
}

/* ==========================================
   TOGGLE BUTTON - PESTAÑA SUPERIOR
   ========================================== */
.island-toggle {
  width: 50px;
  height: 24px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 215, 0, 0.2);
  
  display: flex;
  align-items: center;
  justify-content: center;
  
  cursor: pointer;
  position: relative;
  
  /* Reset de estilos de botón */
  outline: none;
  padding: 0;
  
  transition: all 0.3s ease;
}

.island-toggle i {
  font-size: 1.2rem;
  color: rgba(255, 215, 0, 0.7);
  transition: all 0.3s ease;
}

.island-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 215, 0, 0.4);
}

.island-toggle:hover i {
  color: rgba(255, 215, 0, 1);
}

/* Rotar icono cuando está colapsado */
.floating-island-nav.collapsed .island-toggle i {
  transform: rotate(180deg);
}

/* ==========================================
   BOTONES DEL ISLAND
   ========================================== */
.island-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.08);
  
  display: flex;
  align-items: center;
  justify-content: center;
  
  cursor: pointer;
  position: relative;
  overflow: hidden;
  
  /* Reset de estilos de botón */
  outline: none;
  padding: 0;
  
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Íconos */
.island-btn i {
  font-size: 1.6rem;
  color: rgba(255, 255, 255, 0.65);
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
  pointer-events: none;
}

/* ==========================================
   ESTADO ACTIVO - Wallet verde
   ========================================== */
.island-btn.active {
  background: var(--island-btn-active);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 
    0 5px 20px rgba(255, 215, 0, 0.4),
    0 0 35px rgba(139, 92, 246, 0.3);
}

.island-btn.active i {
  color: white;
  transform: scale(1.1);
}

/* ==========================================
   HOVER - Glow dorado (como tus otros botones)
   ========================================== */
.island-btn:not(.active):hover {
  background: rgba(255, 215, 0, 0.12);
  border-color: rgba(255, 215, 0, 0.5);
  transform: translateY(-4px) scale(1.1);
  box-shadow: 
    0 10px 30px rgba(255, 215, 0, 0.35),
    0 0 50px rgba(255, 215, 0, 0.25);
}

.island-btn:not(.active):hover i {
  color: #FFD700;
  transform: scale(1.15);
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
}

/* ==========================================
   ACTIVE (click) - Feedback táctil
   ========================================== */
.island-btn:active {
  transform: translateY(-2px) scale(1.05);
}

/* Shimmer effect en hover (como tus botones premium) */
.island-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.25),
    transparent
  );
  transition: left 0.6s ease;
}

.island-btn:hover::before {
  left: 100%;
}

/* ==========================================
   ESTADO OCULTO (no se usa - menú siempre visible)
   ========================================== */
.floating-island-nav.is-hidden {
  transform: translateX(-50%) translateY(120px);
  opacity: 0;
  pointer-events: none;
}

/* ==========================================
   KENO MODAL OVERRIDE - Z-INDEX ELEVADO
   ========================================== */
.floating-island-nav.above-keno {
  z-index: 10001; /* Por encima de modal Keno (z-index: 1050) */
}

/* Animación de entrada */
@keyframes islandSlideUp {
  from {
    transform: translateX(-50%) translateY(120px);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

/* ==========================================
   RESPONSIVE - TABLET
   ========================================== */
@media (max-width: 768px) {
  .floating-island-nav {
    bottom: 30px; /* Más espacio para safe area en mobile */
    gap: 12px;
    padding: 8px 16px;
  }
  
  .island-btn {
    width: 48px;
    height: 48px;
  }
  
  .island-btn i {
    font-size: 1.4rem;
  }
}

/* ==========================================
   RESPONSIVE - MOBILE
   ========================================== */
@media (max-width: 480px) {
  .floating-island-nav {
    bottom: 35px;
    gap: 10px;
    padding: 8px 14px;
  }
  
  .island-btn {
    width: 48px;
    height: 48px;
  }
  
  .island-btn i {
    font-size: 1.3rem;
  }
}

/* ==========================================
   ACCESIBILIDAD
   ========================================== */
.island-btn:focus {
  outline: 2px solid #FFD700;
  outline-offset: 2px;
}

.island-btn:focus:not(:focus-visible) {
  outline: none;
}

/* ==========================================
   ESTADO CUANDO KENO MODAL ESTÁ ABIERTO
   ========================================== */
.island-btn[data-action="keno"].modal-open {
  background: linear-gradient(135deg, #ff6b6b, #ee5a52);
  border-color: rgba(255, 107, 107, 0.5);
  box-shadow: 
    0 5px 20px rgba(255, 107, 107, 0.4),
    0 0 35px rgba(255, 107, 107, 0.3);
}

.island-btn[data-action="keno"].modal-open i {
  color: white;
}

/* ==========================================
   KENO ICON IMAGE - Imagen personalizada
   ========================================== */
.island-keno-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
  pointer-events: none;
  opacity: 0.65;
}

/* Hover effect para la imagen de Keno */
.island-btn[data-action="keno"]:not(.active):hover .island-keno-icon {
  transform: scale(1.15);
  filter: brightness(1.3) drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
  opacity: 1;
}

/* Active state para la imagen de Keno */
.island-btn[data-action="keno"].active .island-keno-icon {
  transform: scale(1.1);
  filter: brightness(1.2);
  opacity: 1;
}

/* Modal open state para la imagen de Keno */
.island-btn[data-action="keno"].modal-open .island-keno-icon {
  filter: brightness(1.2);
  opacity: 1;
}

/* Responsive - Tablet */
@media (max-width: 768px) {
  .island-keno-icon {
    width: 22px;
    height: 22px;
  }
}

/* Responsive - Mobile */
@media (max-width: 480px) {
  .island-keno-icon {
    width: 21px;
    height: 21px;
  }
}
