/**
 * File: C:\xampp\htdocs\charapp\assets\css\app-tabbar.css
 * 
 * Purpose:
 * - Bottom Tabbar (Fixed Navigation with RPG Theme)
 * - Tabbar Dock/Collapse Mechanism
 * - Tabbar Handle (Floating Toggle Button)
 * 
 * Dependencies:
 * - app.css (CSS variables: --tabbarH, --safeB, --line, --muted, --text, --accent)
 * - assets/js/tabbar-dock.js (for collapsing behavior)
 * - assets/js/tabbar-handle.js (for toggle button)
 * 
 * Load Order: 3
 * 
 * OPTIMIZATIONS:
 * - Magical gradient background with noise texture
 * - Glow effects for active tabs
 * - Icon pulse animations
 * - Smooth transitions with depth
 * - RPG-themed color accents
 */

/* =========================
   Bottom Tabbar (ENHANCED RPG THEME)
   ========================= */
.bottom-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9998;
  background: 
    linear-gradient(180deg, rgba(10,12,16,.95), rgba(10,12,16,.98)),
    radial-gradient(circle at 20% 50%, rgba(93,214,201,0.08), transparent 60%),
    radial-gradient(circle at 80% 50%, rgba(176,140,255,0.08), transparent 60%);
  border-top: 1px solid rgba(93,214,201,0.2);
  backdrop-filter: blur(16px);
  box-shadow: 
    0 -4px 24px rgba(0,0,0,0.5),
    0 -1px 0 rgba(93,214,201,0.1),
    inset 0 1px 0 rgba(93,214,201,0.05);
  padding-bottom: var(--safeB, 0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.bottom-tabbar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 40px,
      rgba(93,214,201,0.02) 40px,
      rgba(93,214,201,0.02) 80px
    );
  pointer-events: none;
  opacity: 0.5;
}

.bottom-tabbar::after {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(93,214,201,0.6) 20%,
    rgba(93,214,201,0.6) 80%,
    transparent
  );
  box-shadow: 0 0 12px rgba(93,214,201,0.4);
}

/* Bootstrap Nav Pills Container */
.bottom-tabbar .nav {
  position: relative;
  z-index: 1;
  padding: 0.5rem 0;
}

.bottom-tabbar .container {
  position: relative;
}

/* =========================
   Nav Items (RPG Style)
   ========================= */
.bottom-tabbar .nav-item {
  flex: 1;
}

.bottom-tabbar .nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 0.25rem;
  color: rgba(255,255,255,0.5);
  background: transparent;
  border: none;
  border-radius: 0.75rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  cursor: pointer;
}

.bottom-tabbar .nav-link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at center,
    rgba(93,214,201,0.15),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bottom-tabbar .nav-link:hover {
  color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.05);
  transform: translateY(-2px);
}

.bottom-tabbar .nav-link:hover::before {
  opacity: 1;
}

.bottom-tabbar .nav-link i {
  font-size: 1.25rem;
  color: inherit;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  transition: all 0.3s ease;
}

.bottom-tabbar .nav-link:hover i {
  transform: scale(1.15);
}

.bottom-tabbar .nav-link .lbl {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

/* =========================
   Active Tab State (ENHANCED)
   ========================= */
.bottom-tabbar .nav-link.active {
  color: #fff;
  background: 
    linear-gradient(135deg, rgba(93,214,201,0.15), rgba(77,163,255,0.15)),
    radial-gradient(circle at center, rgba(93,214,201,0.2), transparent 70%);
  border: 1px solid rgba(93,214,201,0.3);
  box-shadow: 
    0 4px 12px rgba(93,214,201,0.2),
    0 0 20px rgba(93,214,201,0.15),
    inset 0 1px 1px rgba(255,255,255,0.1);
  transform: translateY(-2px);
}

.bottom-tabbar .nav-link.active::before {
  opacity: 1;
  animation: activeGlow 3s ease-in-out infinite;
}

@keyframes activeGlow {
  0%, 100% {
    background: radial-gradient(circle at center, rgba(93,214,201,0.15), transparent 70%);
  }
  50% {
    background: radial-gradient(circle at center, rgba(93,214,201,0.25), transparent 70%);
  }
}

.bottom-tabbar .nav-link.active i {
  color: #5dd6c9;
  filter: drop-shadow(0 0 8px rgba(93,214,201,0.6));
  animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.bottom-tabbar .nav-link.active .lbl {
  opacity: 1;
  color: #5dd6c9;
  text-shadow: 0 0 8px rgba(93,214,201,0.5);
}

/* =========================
   Tab-specific Icon Colors (When Active)
   ========================= */
.bottom-tabbar .nav-link[href="#overview"].active i {
  color: #5dd6c9; /* Cyan - Übersicht */
}

.bottom-tabbar .nav-link[href="#progress"].active i {
  color: #ffd36b; /* Gold - Level */
}

.bottom-tabbar .nav-link[href="#attacks"].active i {
  color: #b08cff; /* Violett - Kampf */
}

.bottom-tabbar .nav-link[href="#stats"].active i {
  color: #4da3ff; /* Blau - Stats */
}

.bottom-tabbar .nav-link[href="#inventory"].active i {
  color: #ffd36b; /* Gold - Items */
}

.bottom-tabbar .nav-link[href="#equipment"].active i {
  color: #5dd6c9; /* Cyan - Ausrüstung */
}

.bottom-tabbar .nav-link[href="#notes"].active i {
  color: #8b949e; /* Grau - Notizen */
}

/* =========================
   Responsive (Mobile)
   ========================= */
@media (max-width: 576px) {
  .bottom-tabbar .nav-link {
    padding: 0.4rem 0.15rem;
    gap: 0.25rem;
  }
  
  .bottom-tabbar .nav-link i {
    font-size: 1.15rem;
  }
  
  .bottom-tabbar .nav-link .lbl {
    font-size: 0.65rem;
  }
}

/* =========================
   Tabbar Handle (Floating Arrow) (ENHANCED)
   ========================= */
.tabbar-handle,
.tabbar-handle-toggle {
  position: fixed;
  right: 1rem;
  bottom: 5rem;
  z-index: 9999;
  border: 1px solid rgba(93,214,201,0.3);
  background: 
    linear-gradient(135deg, rgba(10,12,16,0.9), rgba(10,12,16,0.95)),
    radial-gradient(circle at center, rgba(93,214,201,0.1), transparent 70%);
  backdrop-filter: blur(12px);
  border-radius: 50%;
  padding: 0.75rem;
  display: none;
  color: #5dd6c9;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 4px 12px rgba(0,0,0,0.4),
    0 0 20px rgba(93,214,201,0.2),
    inset 0 1px 1px rgba(255,255,255,0.1);
}

.tabbar-handle::before,
.tabbar-handle-toggle::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle at center,
    rgba(93,214,201,0.2),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tabbar-handle:hover,
.tabbar-handle-toggle:hover {
  background: 
    linear-gradient(135deg, rgba(10,12,16,0.95), rgba(10,12,16,0.98)),
    radial-gradient(circle at center, rgba(93,214,201,0.15), transparent 70%);
  border-color: rgba(93,214,201,0.5);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 
    0 6px 16px rgba(0,0,0,0.5),
    0 0 30px rgba(93,214,201,0.3),
    inset 0 1px 1px rgba(255,255,255,0.15);
}

.tabbar-handle:hover::before,
.tabbar-handle-toggle:hover::before {
  opacity: 1;
}

.tabbar-handle i,
.tabbar-handle-toggle i {
  font-size: 1rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.tabbar-handle.is-visible,
.tabbar-handle-toggle.is-visible {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* =========================
   Tabbar Dock/Collapse
   ========================= */
.bottom-tabbar.tabbar-docked {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9998;
  transform: translateY(0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.tabbar-collapsed .bottom-tabbar.tabbar-docked {
  transform: translateY(110%);
}

/* =========================
   Legacy Support (Old .tabbar class)
   ========================= */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--tabbarH, 72px);
  padding-bottom: var(--safeB, 0);
  display: flex;
  background: 
    linear-gradient(180deg, rgba(10,12,16,.95), rgba(10,12,16,.98)),
    radial-gradient(circle at 20% 50%, rgba(93,214,201,0.08), transparent 60%);
  border-top: 1px solid rgba(93,214,201,0.2);
  backdrop-filter: blur(16px);
  z-index: 20;
  box-shadow: 
    0 -4px 24px rgba(0,0,0,0.5),
    0 -1px 0 rgba(93,214,201,0.1);
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: transparent;
  border: 0;
  color: rgba(255,255,255,0.5);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.tab::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(93,214,201,0.1), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tab:hover {
  color: rgba(255,255,255,0.8);
}

.tab:hover::before {
  opacity: 1;
}

.tab.active {
  color: #fff;
}

.tab.active::before {
  opacity: 1;
  animation: activeGlow 3s ease-in-out infinite;
}

.tab.active i {
  color: #5dd6c9;
  filter: drop-shadow(0 0 8px rgba(93,214,201,0.6));
}