/**
 * LIQUID GLASS TOOLBAR PLUGIN - CSS (Glass Edition)
 */

/* ==========================================================================
   1. BASIS LAYOUT, CONTAINER & FARBEN
   ========================================================================== */
.ios.keyboard-open .liquid-glass-toolbar-enabled.hide-on-keyboard{
display:none!important;	
}
.ios .liquid-glass-toolbar-enabled::before {
  backdrop-filter: blur(1px);
  mask-image: linear-gradient(to top, #000 calc(50% + var(--f7-safe-area-bottom, 0px)), #0000 100%);
}

html.device-standalone.ios .liquid-glass-toolbar-enabled {
  bottom: -20px;
}

.ios .liquid-glass-toolbar-enabled .toolbar-pane {
  display: flex !important;
  position: relative !important;
  backdrop-filter: saturate(180%) blur(4px) !important;
  background-color: #ffffff4a !important;
  flex: 1;
  height: 100%;  
  height: 60px;
  margin: 0 2px;
  align-items: stretch;
  overflow: visible !important; 
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.ios.dark .liquid-glass-toolbar-enabled .toolbar-pane {
  background-color: #32323287 !important;
}


/* ==========================================================================
   2. LINK STYLING & ELEMENTE (BADGES, LABELS)
   ========================================================================== */

.ios .liquid-glass-toolbar-enabled .link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;  
  position: relative;
  z-index: 5; 
  transition: transform 100ms linear, color 250ms;
  will-change: transform;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

.ios .liquid-glass-toolbar-enabled .link-active { 
  color: var(--f7-toolbar-link-active-color, #be72bc);
}

.ios .liquid-glass-toolbar-enabled .label {
  font-size: 10px !important;
}

.ios .liquid-glass-toolbar-enabled .link i + span {
  margin-left: 0px !important;
}

.ios .liquid-glass-toolbar-enabled .badge {
  position: absolute;
  top: -2px;
  right: calc(50% - 20px);
  z-index: 6;
}


/* ==========================================================================
   3. DAS ZENTRALE HIGHLIGHT-ELEMENT (PILL)
   ========================================================================== */

.ios .liquid-glass-toolbar-highlight {
  position: absolute;
  left: 0;
  top: 0px;
  bottom: 0px;
  border-radius: 100px;
  pointer-events: none;
  display: block !important;
  z-index: 1;
  opacity: 0;
  will-change: transform, width, top, bottom;
  transition: 
    transform 350ms cubic-bezier(0.175, 0.885, 0.42, 1.315), 
    width 350ms cubic-bezier(0.175, 0.885, 0.42, 1.315), 
    opacity 200ms,
    top 300ms cubic-bezier(0.175, 0.885, 0.42, 1.315), 
    bottom 300ms cubic-bezier(0.175, 0.885, 0.42, 1.315);
}

.ios .liquid-glass-toolbar-highlight:before {
  content: "";
  position: absolute;
  inset: 4px; 
  border-radius: 35px;
  background-color: var(--f7-tabbar-link-highlight-bg-color, rgba(255,255,255,0.15));
  transition: inset 300ms cubic-bezier(0.175, 0.885, 0.42, 1.315), background-color 250ms;
}
.ios.dark .liquid-glass-toolbar-highlight:before {
  background-color: rgba(0,0,0,0.65);
}
.ios .liquid-glass-toolbar-enabled .link-active .label{
	color:var(--f7-toolbar-text-color, var(--f7-bars-text-color))!important;
	font-weight:bold;
}
/* Aktivierter Zustand (Milchglas & Refraktion) */
.ios .liquid-glass-toolbar-highlight.is-active {
  z-index: 2;
  top: -3px;
  bottom: -4px;
  background-color: transparent;
  -webkit-backdrop-filter: url(#liquid-refraction) blur(20px) saturate(140%);
  backdrop-filter: url(#liquid-refraction) blur(20px) saturate(140%);
}

.ios .liquid-glass-toolbar-highlight.is-active:before {
  inset: 0px; 
  background-color: transparent;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: var(--f7-glass-shadow-thumb);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-top: 1px solid rgba(255, 255, 255, 0.5);
}

/* Framework7 Touch-Highlight-Klasse im Toolbar-Kontext ausblenden, damit MorphPopovers unberührt bleiben */
.ios .liquid-glass-toolbar-highlight .rounded-\[inherit\] {
  display: none;
}


/* ==========================================================================
   4. TRANSITIONS & ANIMATIONEN (ICON-BRECHUNG IN/OUT)
   ========================================================================== */

.ios .liquid-glass-toolbar-enabled .link i,
.ios .liquid-glass-toolbar-enabled .link .icon,
.ios .liquid-glass-toolbar-enabled .link span:not(.label) {
  transition: filter 300ms ease;
  filter: none;
  -webkit-filter: none;
  transform-origin: center center !important;
  -webkit-transform-origin: center center !important;
  animation: liquidRefractionExit 250ms cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.ios .liquid-glass-toolbar-enabled .link-active i,
.ios .liquid-glass-toolbar-enabled .link-active .icon,
.ios .liquid-glass-toolbar-enabled .link-active span:not(.label) {
  animation: liquidRefractionOvershoot 280ms cubic-bezier(0.215, 0.610, 0.355, 1) forwards;
  transform-origin: center center !important;
  -webkit-transform-origin: center center !important;
}

@keyframes liquidRefractionOvershoot {
  0% {
    transform: scale(0.65, 1.45) translateY(0px);
    -webkit-transform: scale(0.65, 1.45) translateY(0px);
    filter: blur(1px) saturate(180%);
  }
  45% {
    transform: scale(1.25, 0.8) translateY(0px);
    -webkit-transform: scale(1.25, 0.8) translateY(0px);
    filter: blur(0.4px);
  }
  75% {
    transform: scale(1.18, 1.15) translateY(0px);
    -webkit-transform: scale(1.18, 1.15) translateY(0px);
    filter: blur(0px) saturate(120%);
  }
  100% {
    transform: scale(1.05) translateY(0px);
    -webkit-transform: scale(1.05) translateY(0px);
    filter: blur(0px) saturate(100%);
  }
}

@keyframes liquidRefractionExit {
  0% {
    transform: scale(1.05) translateY(0px);
    -webkit-transform: scale(1.05) translateY(0px);
  }
  35% {
    transform: scale(1.22, 0.82) translateY(0px);
    -webkit-transform: scale(1.22, 0.82) translateY(0px);
    filter: blur(0.5px) saturate(90%);
  }
  70% {
    transform: scale(0.95, 1.04) translateY(0px);
    -webkit-transform: scale(0.95, 1.04) translateY(0px);
  }
  100% {
    transform: scale(1) translateY(0px);
    -webkit-transform: scale(1) translateY(0px);
    filter: blur(0px) saturate(100%);
  }
}


.ios .liquid-glass-toolbar-enabled .link .label {
  display: inline-block;
  transform-origin: center center !important;
  -webkit-transform-origin: center center !important;
  animation: liquidLabelExit 250ms cubic-bezier(0.25, 1, 0.5, 1) forwards;
  will-change: transform;
}

.ios .liquid-glass-toolbar-enabled .link-active .label {
  animation: liquidLabelOvershoot 280ms cubic-bezier(0.215, 0.610, 0.355, 1) forwards;
  will-change: transform;
}

@keyframes liquidLabelOvershoot {
  0% {
    transform: scale(0.8, 1.25);
    -webkit-transform: scale(0.8, 1.25);
  }
  45% {
    transform: scale(1.15, 0.88);
    -webkit-transform: scale(1.15, 0.88);
  }
  75% {
    transform: scale(1.10, 1.08);
    -webkit-transform: scale(1.10, 1.08);
  }
  100% {
    transform: scale(1);
    -webkit-transform: scale(1);
  }
}

@keyframes liquidLabelExit {
  0% {
    transform: scale(1);
    -webkit-transform: scale(1);
  }
  35% {
    transform: scale(1.12, 0.90);
    -webkit-transform: scale(1.12, 0.90);
  }
  70% {
    transform: scale(0.97, 1.02);
    -webkit-transform: scale(0.97, 1.02);
  }
  100% {
    transform: scale(1);
    -webkit-transform: scale(1);
  }
}
