/**
 * ACENCIA - Dock Navigation Styles
 * 
 * macOS-inspirierte Dock-Navigation für Dashboard und Admin-Panel.
 * Verwendet Glassmorphism-Effekte mit backdrop-filter und modernen
 * CSS-Animationen für ein poliertes Benutzererlebnis.
 * 
 * Komponenten:
 * - .dock-outer: Container, fixiert am unteren Bildschirmrand
 * - .dock-panel: Der eigentliche Dock-Bereich mit Blur-Effekt
 * - .dock-item: Einzelne Dock-Icons mit Hover-Effekten
 * - .dock-label: Tooltip-Labels für Dock-Items
 * 
 * Features:
 * - Magnification-Effekt beim Hover (wie macOS)
 * - Aktiv-Zustands-Anzeige mit orangem Rahmen
 * - Responsive Design für Mobile
 * - Accessibility-Unterstützung (Focus-States)
 * 
 * @author ACENCIA IT Solutions
 * @version 1.0.0
 */

/* Dock Navigation - macOS Style */

/* Dock Container - Fixed at bottom */
.dock-outer {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dock-panel {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  padding: 0 1rem 0.5rem 1rem;
  height: 30px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 1.5rem;
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  pointer-events: auto;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: visible;
}

/* Dock Item - Glass Surface Effect */
.dock-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(12px) saturate(1.8) brightness(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.8) brightness(1.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 1rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 8px 32px 0 rgba(31, 38, 135, 0.2),
    0 2px 16px 0 rgba(31, 38, 135, 0.1),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.4),
    inset 0 -1px 0 0 rgba(255, 255, 255, 0.2);
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  transform-origin: center bottom;
  overflow: visible;
}

/* Fallback for browsers that don't support backdrop-filter */
@supports not (backdrop-filter: blur(10px)) {
  .dock-item {
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 
      inset 0 1px 0 0 rgba(255, 255, 255, 0.5),
      inset 0 -1px 0 0 rgba(255, 255, 255, 0.3);
  }
  
  .dock-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: inherit;
    z-index: -1;
  }
}

.dock-item:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.dock-item:active {
  transform: scale(0.95);
}

/* Dock Item - Active State */
.dock-item.active {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  border-color: rgba(250, 153, 57, 0.3);
  box-shadow: 
    0 6px 20px rgba(250, 153, 57, 0.3),
    0 2px 8px rgba(250, 153, 57, 0.2);
}

.dock-item.active .dock-icon {
  filter: brightness(0) invert(1);
}

/* Active Tab State - Orange Border for Admin Panel Tabs */
.dock-item.active-tab {
  position: relative;
}

.dock-item.active-tab::after {
  content: '';
  position: absolute;
  inset: -3px;
  border: 3px solid var(--primary-color);
  border-radius: 1rem;
  box-shadow: 
    0 0 15px rgba(255, 157, 28, 0.6),
    0 0 30px rgba(255, 157, 28, 0.3),
    inset 0 0 10px rgba(255, 157, 28, 0.2);
  animation: pulseOrangeBorder 2s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes pulseOrangeBorder {
  0%, 100% {
    box-shadow: 
      0 0 15px rgba(255, 157, 28, 0.6),
      0 0 30px rgba(255, 157, 28, 0.3),
      inset 0 0 10px rgba(255, 157, 28, 0.2);
  }
  50% {
    box-shadow: 
      0 0 25px rgba(255, 157, 28, 0.9),
      0 0 45px rgba(255, 157, 28, 0.5),
      inset 0 0 15px rgba(255, 157, 28, 0.3);
  }
}

/* Dock Icon */
.dock-icon {
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

/* Dock Label - Tooltip */
.dock-label {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-0.5rem);
  white-space: nowrap;
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: white;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 100;
}

.dock-label::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: rgba(30, 41, 59, 0.95);
}

.dock-item:hover .dock-label,
.dock-item:focus .dock-label {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-0.75rem);
}

/* Hover Effects */
.dock-item:hover {
  transform: scale(1.1) translateY(-4px);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.12),
    0 4px 8px rgba(0, 0, 0, 0.08);
  border-color: rgba(250, 153, 57, 0.2);
  z-index: 10;
}

/* Magnification Effect - Adjacent Items */
.dock-item.adjacent-left {
  transform: scale(1.05) translateY(-2px);
}

.dock-item.adjacent-right {
  transform: scale(1.05) translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
  .dock-outer {
    bottom: 0.5rem;
  }
  
  .dock-panel {
    gap: 0.5rem;
    padding: 0.5rem 0.75rem 0.75rem 0.75rem;
    border-radius: 1.25rem;
  }
  
  .dock-item {
    width: 42px;
    height: 42px;
    border-radius: 0.875rem;
  }
  
  .dock-icon {
    font-size: 1.25rem;
  }
  
  /* Disable magnification on mobile */
  .dock-item:hover {
    transform: scale(1.05) translateY(-2px);
  }
  
  .dock-item.adjacent-left,
  .dock-item.adjacent-right {
    transform: scale(1);
  }
}

@media (max-width: 480px) {
  .dock-outer {
    width: calc(100% - 1rem);
    left: 50%;
  }
  
  .dock-panel {
    width: 100%;
    justify-content: space-around;
    gap: 0.25rem;
    padding: 0.5rem;
  }
  
  .dock-item {
    width: 38px;
    height: 38px;
    flex: 1;
    max-width: 50px;
  }
  
  .dock-icon {
    font-size: 1.125rem;
  }
}

/* Animation for dock appearance */
@keyframes dockSlideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.dock-outer.dock-animate {
  animation: dockSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Special styling for user info in dock */
.dock-item.user-info-item {
  width: auto;
  min-width: 50px;
  padding: 0 0.75rem;
  background: rgba(250, 153, 57, 0.2);
  backdrop-filter: blur(12px) saturate(1.8) brightness(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.8) brightness(1.1);
  border-color: rgba(250, 153, 57, 0.4);
}

.dock-item.user-info-item .dock-icon {
  font-size: 0.625rem;
  gap: 0.25rem;
  flex-direction: column;
  line-height: 1.2;
  text-align: center;
}

.dock-item.user-info-item:hover {
  transform: scale(1.05) translateY(-2px);
}

/* Logout button styling */
.dock-item.logout-item {
  background: rgba(220, 38, 38, 0.2);
  backdrop-filter: blur(12px) saturate(1.8) brightness(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.8) brightness(1.1);
  border-color: rgba(220, 38, 38, 0.4);
}

.dock-item.logout-item:hover {
  border-color: #dc2626;
  box-shadow: 
    0 8px 24px rgba(220, 38, 38, 0.3),
    0 4px 8px rgba(220, 38, 38, 0.2);
}

/* Hide old navbar when dock is active */
body.has-dock .navbar {
  display: none;
}

/* Adjust page content padding when dock is active */
body.has-dock {
  padding-bottom: 100px;
}

/* Old navbar fallback for non-dock pages */
body:not(.has-dock) .dock-outer {
  display: none;
}

