/**
 * Dock Styles - Aurora Steppe
 * Улучшенный дизайн с текстовыми подписями
 */

/* Скрываем dock в админ-панели */
body:has(.tabs-nav) .dock,
.admin-panel .dock,
[data-admin-panel] .dock {
  display: none !important;
}

.dock {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-6);
  background: linear-gradient(135deg, 
    rgba(106, 124, 255, 0.15) 0%, 
    rgba(18, 230, 166, 0.12) 100%);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(106, 124, 255, 0.3);
  border-radius: var(--radius-2xl);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset,
    0 0 80px rgba(106, 124, 255, 0.2);
  z-index: 1000;
  transition: all var(--motion-base) var(--easing-default);
}

[data-theme="dark"] .dock {
  background: linear-gradient(135deg, 
    rgba(106, 124, 255, 0.2) 0%, 
    rgba(18, 230, 166, 0.15) 100%);
  border: 1px solid rgba(106, 124, 255, 0.4);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 0 80px rgba(106, 124, 255, 0.25);
}

.dock::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.02'/%3E%3C/svg%3E");
  border-radius: var(--radius-2xl);
  opacity: 0.3;
  pointer-events: none;
}

.dock-item {
  position: relative;
  min-width: 72px;
  height: 72px;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--motion-base) var(--easing-default);
  background: rgba(255, 255, 255, 0.05);
  padding: var(--space-3);
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .dock-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.dock-item-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
}

.dock-item:hover {
  transform: translateY(-12px) scale(1.08);
  background: linear-gradient(135deg, 
    rgba(106, 124, 255, 0.15) 0%, 
    rgba(18, 230, 166, 0.12) 100%);
  border-color: rgba(106, 124, 255, 0.3);
  box-shadow: 
    0 12px 24px rgba(0, 0, 0, 0.15),
    0 0 30px rgba(106, 124, 255, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.dock-item.active {
  background: linear-gradient(135deg, 
    rgba(106, 124, 255, 0.2) 0%, 
    rgba(18, 230, 166, 0.18) 100%);
  border: 1px solid rgba(106, 124, 255, 0.4);
  box-shadow: 
    0 8px 20px rgba(0, 0, 0, 0.12),
    0 0 40px rgba(106, 124, 255, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  transform: translateY(-4px);
}

.dock-item.active::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--gradient-accent);
  border-radius: var(--radius-lg);
  opacity: 0.1;
  z-index: -1;
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.1; }
  50% { opacity: 0.2; }
}

.dock-item-indicator {
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: var(--radius-full);
  opacity: 0;
  transition: all var(--motion-base) var(--easing-default);
  box-shadow: 0 0 8px rgba(106, 124, 255, 0.4);
}

.dock-item.active .dock-item-indicator {
  opacity: 1;
  width: 32px;
  height: 4px;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, 
    rgba(106, 124, 255, 1) 0%, 
    rgba(18, 230, 166, 1) 100%);
  box-shadow: 
    0 0 12px rgba(106, 124, 255, 0.8),
    0 0 20px rgba(18, 230, 166, 0.4);
  animation: pulse-indicator 2s ease-in-out infinite;
}

@keyframes pulse-indicator {
  0%, 100% { 
    opacity: 1;
    box-shadow: 
      0 0 12px rgba(106, 124, 255, 0.8),
      0 0 20px rgba(18, 230, 166, 0.4);
  }
  50% { 
    opacity: 0.8;
    box-shadow: 
      0 0 16px rgba(106, 124, 255, 1),
      0 0 30px rgba(18, 230, 166, 0.6);
  }
}

.dock-item-icon {
  width: 28px;
  height: 28px;
  color: var(--text-secondary);
  transition: all var(--motion-base) var(--easing-default);
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.dock-item:hover .dock-item-icon {
  color: var(--primary);
  transform: scale(1.15) rotate(5deg);
  filter: drop-shadow(0 0 8px rgba(106, 124, 255, 0.5));
}

.dock-item.active .dock-item-icon {
  color: var(--primary);
  transform: scale(1.2);
  filter: drop-shadow(0 0 12px rgba(106, 124, 255, 0.6));
}

.dock-item-label {
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  color: var(--text-tertiary);
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-6px) scale(0.9);
  transition: all var(--motion-base) var(--easing-default);
  font-family: var(--font-primary);
  letter-spacing: 0.4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.dock-item:hover .dock-item-label {
  opacity: 1;
  transform: translateY(0) scale(1);
  color: var(--text-primary);
}

.dock-item.active .dock-item-label {
  opacity: 1;
  transform: translateY(0) scale(1);
  color: var(--primary);
  font-weight: var(--font-weight-bold);
  text-shadow: 0 0 8px rgba(106, 124, 255, 0.4);
}

/* Desktop: вертикальное меню слева */
@media (min-width: 1024px) {
  .dock {
    left: var(--space-6);
    bottom: auto;
    top: 50%;
    transform: translateY(-50%);
    flex-direction: column;
    width: 200px;
    height: auto;
    padding: var(--space-5) var(--space-4);
    gap: var(--space-2);
    border-radius: var(--radius-2xl);
    background: linear-gradient(135deg, 
      rgba(106, 124, 255, 0.12) 0%, 
      rgba(18, 230, 166, 0.1) 100%);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(106, 124, 255, 0.25);
    box-shadow: 
      0 8px 32px rgba(0, 0, 0, 0.15),
      0 0 0 1px rgba(255, 255, 255, 0.1) inset,
      0 0 80px rgba(106, 124, 255, 0.2);
  }
  
  .dock-item {
    width: 100%;
    min-width: auto;
    height: 64px;
    flex-direction: row;
    justify-content: flex-start;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all var(--motion-base) var(--easing-default);
  }

  .dock-item-content {
    flex-direction: row;
    gap: var(--space-3);
    width: 100%;
    justify-content: flex-start;
    align-items: center;
    min-width: 0;
  }

  .dock-item-label {
    opacity: 1;
    transform: translateY(0) scale(1);
    font-size: 14px;
    color: var(--text-primary);
    font-weight: var(--font-weight-medium);
    text-shadow: none;
    letter-spacing: 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    transition: color var(--motion-base) var(--easing-default);
  }

  .dock-item:hover .dock-item-label {
    color: var(--primary);
    font-weight: var(--font-weight-semibold);
  }

  .dock-item.active .dock-item-label {
    color: var(--primary);
    font-weight: var(--font-weight-semibold);
    text-shadow: 0 0 8px rgba(106, 124, 255, 0.3);
    letter-spacing: -0.1px;
  }

  .dock-item:hover {
    transform: translateX(6px) scale(1.02);
    background: linear-gradient(90deg, 
      rgba(106, 124, 255, 0.2) 0%, 
      rgba(18, 230, 166, 0.15) 100%);
    padding-left: var(--space-5);
    border-left: 3px solid rgba(106, 124, 255, 0.4);
    border-color: rgba(106, 124, 255, 0.3);
    box-shadow: 
      0 4px 16px rgba(0, 0, 0, 0.1),
      0 0 20px rgba(106, 124, 255, 0.25),
      0 0 0 1px rgba(255, 255, 255, 0.15) inset;
  }

  .dock-item.active {
    background: linear-gradient(90deg, 
      rgba(106, 124, 255, 0.3) 0%, 
      rgba(18, 230, 166, 0.25) 100%);
    border-left: 4px solid var(--primary);
    border-color: rgba(106, 124, 255, 0.5);
    padding-left: var(--space-5);
    padding-right: var(--space-4);
    transform: translateX(4px);
    box-shadow: 
      0 6px 24px rgba(0, 0, 0, 0.12),
      0 0 30px rgba(106, 124, 255, 0.4),
      0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    position: relative;
  }

  .dock-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--gradient-accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    box-shadow: 0 0 16px rgba(106, 124, 255, 0.8);
    animation: pulse-glow-indicator 2s ease-in-out infinite;
  }

  @keyframes pulse-glow-indicator {
    0%, 100% { 
      box-shadow: 0 0 16px rgba(106, 124, 255, 0.8);
    }
    50% { 
      box-shadow: 0 0 24px rgba(106, 124, 255, 1), 0 0 40px rgba(18, 230, 166, 0.6);
    }
  }

  .dock-item.active::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(106, 124, 255, 0.15), transparent);
    border-radius: var(--radius-xl);
    pointer-events: none;
  }

  .dock-item-indicator {
    left: 0;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    width: 0;
    height: 0;
  }

  .dock-item.active .dock-item-indicator {
    width: 4px;
    height: 40px;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: var(--gradient-accent);
    border-radius: var(--radius-full);
    box-shadow: 
      0 0 16px rgba(106, 124, 255, 0.9),
      0 0 30px rgba(18, 230, 166, 0.5);
  }

  .dock-item-icon {
    width: 22px;
    height: 22px;
    color: var(--text-primary);
    transition: all var(--motion-base) var(--easing-default);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
    flex-shrink: 0;
  }

  .dock-item:hover .dock-item-icon {
    color: var(--primary);
    transform: scale(1.08);
    filter: drop-shadow(0 0 8px rgba(106, 124, 255, 0.5));
  }

  .dock-item.active .dock-item-icon {
    width: 24px;
    height: 24px;
    color: var(--primary);
    filter: drop-shadow(0 0 12px rgba(106, 124, 255, 0.7));
    transform: scale(1.1);
  }

  .dock-item.active .dock-item-label {
    color: var(--primary);
    font-weight: var(--font-weight-semibold);
    text-shadow: 0 0 8px rgba(106, 124, 255, 0.3);
    letter-spacing: -0.1px;
  }

  [data-theme="dark"] .dock {
    background: linear-gradient(135deg, 
      rgba(106, 124, 255, 0.25) 0%, 
      rgba(18, 230, 166, 0.2) 100%);
    border: 1px solid rgba(106, 124, 255, 0.5);
    box-shadow: 
      0 8px 32px rgba(0, 0, 0, 0.4),
      0 0 0 1px rgba(255, 255, 255, 0.08) inset,
      0 0 80px rgba(106, 124, 255, 0.3);
  }

  [data-theme="dark"] .dock-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  [data-theme="dark"] .dock-item:hover {
    background: linear-gradient(90deg, 
      rgba(106, 124, 255, 0.25) 0%, 
      rgba(18, 230, 166, 0.2) 100%);
    border-color: rgba(106, 124, 255, 0.5);
  }

  [data-theme="dark"] .dock-item.active {
    background: linear-gradient(90deg, 
      rgba(106, 124, 255, 0.35) 0%, 
      rgba(18, 230, 166, 0.3) 100%);
    border-color: rgba(106, 124, 255, 0.6);
  }
}

/* Mobile: горизонтальное меню снизу */
@media (max-width: 1023px) {
  .dock {
    bottom: var(--space-3);
    left: var(--space-3);
    right: var(--space-3);
    transform: none;
    border-radius: var(--radius-2xl);
    justify-content: space-around;
    padding: var(--space-4) var(--space-3);
    box-shadow: 
      0 -4px 24px rgba(0, 0, 0, 0.1),
      0 8px 32px rgba(0, 0, 0, 0.12),
      0 0 60px rgba(106, 124, 255, 0.15);
  }

  .dock-item {
    flex: 1;
    max-width: 90px;
    height: 72px;
    min-width: 64px;
  }

  .dock-item-label {
    font-size: 10px;
  }
  
  .dock-item:hover {
    transform: translateY(-10px) scale(1.08);
  }
  
  .dock-item.active {
    transform: translateY(-6px);
  }
}

@media (max-width: 640px) {
  .dock {
    bottom: var(--space-2);
    left: var(--space-2);
    right: var(--space-2);
    padding: var(--space-3) var(--space-2);
  }
  
  .dock-item-label {
    display: none;
  }

  .dock-item {
    height: 64px;
    min-width: 56px;
  }
  
  .dock-item-icon {
    width: 24px;
    height: 24px;
  }
}
