/**
 * Shared Taskbar Styles for Nebula
 * Used by both nebula view and monitoring view
 */

.taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(0, 0, 0, 0.3); 
  backdrop-filter: blur(3px); 
  -webkit-backdrop-filter: blur(30px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 1.5rem;
  z-index: 100;
  transition: transform 0.3s ease;
}

.taskbar.hidden {
  transform: translateY(100%);
}

.taskbar-toggle {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 20px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  cursor: pointer;
  z-index: 99;
  transition: bottom 0.3s ease;
}

.taskbar.hidden + .taskbar-toggle {
  bottom: 0;
}

.taskbar-toggle i {
  color: #00D9FF;
  font-size: 12px;
  padding-top: 4px;
}

.taskbar-toggle:hover {
  border-color: #00D9FF;
}

/* Nebula logo button - circular with glow */
.taskbar-logo {
  font-size: 1.5rem;
  color: #00D9FF;
  filter: drop-shadow(0 2px 8px #00D9FF);
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.taskbar-logo:hover {
  background: rgba(0, 217, 255, 0.1);
  filter: drop-shadow(0 4px 16px #00D9FF);
}

.taskbar-title {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.05em;
  font-family: 'Bruno Ace SC';
}

.taskbar-agents {
  flex: 1;
  display: flex;
  gap: 2rem;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.taskbar-agent {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.taskbar-agent-icon {
  font-size: 1.2rem;
  filter: drop-shadow(0 2px 4px currentColor);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

/* Icon lights up when agent is active */
.taskbar-agent-icon.lit {
  filter: drop-shadow(0 4px 12px currentColor);
}

.taskbar-bars {
  width: 100px;
  height: 24px;
  display: flex;
  flex-direction: row;
  gap: 2px;
  align-items: flex-end;
  flex-shrink: 0;
}

.taskbar-bar {
  width: 100%;
  height: 100%;
  background-color: #222; /* Dark when inactive */
  border-radius: 1px;
  transition: background-color 0.1s ease, box-shadow 0.1s ease, opacity 0.1s ease;
}

.taskbar-bar.active {
  background-color: var(--bar-color, #222); /* Agent color when active */
  opacity: 0.4; /* Only slightly lighter than background */
  box-shadow: 0 0 2px var(--bar-color);
}

/* Control buttons - consistent circular style with glow */
.taskbar-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.audio-controls {
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 0.5rem;
  padding-top: 85px; /* Create hover zone for slider */
  margin-top: -85px; /* Offset padding to maintain position */
}

.audio-toggle,
.taskbar-chart {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: #00D9FF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.audio-toggle:hover,
.taskbar-chart:hover {
  background: rgba(0, 217, 255, 0.1);
  filter: drop-shadow(0 4px 16px #00D9FF);
}

.audio-toggle.muted {
  opacity: 0.4;
}

/* Base slider styles - common to both vertical and horizontal */
.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 4px; /* Track thickness */
  background: rgba(255, 255, 255, 0.2);
  outline: none;
  border-radius: 2px;
  opacity: 0;
  transition: width 0.2s ease, opacity 0.2s ease 0.1s;
  pointer-events: none;
}

/* Desktop vertical slider - rotated */
.volume-slider-vertical {
  position: absolute;
  bottom: 80px; /* Center point for rotation */
  left: 50%;
  transform: translateX(-50%) rotate(-90deg);
  transform-origin: center;
  width: 0; /* Horizontal width (becomes vertical when rotated) */
}

.audio-controls:hover .volume-slider-vertical,
.volume-slider-vertical:hover {
  width: 80px; /* Expands (appears vertical when rotated) */
  opacity: 1;
  pointer-events: auto;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #00D9FF;
  cursor: pointer;
  box-shadow: 0 0 4px #00D9FF;
}

.volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #00D9FF;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 4px #00D9FF;
}


/* Responsive breakpoints - bars get progressively smaller and more compact */
@media (max-width: 1400px) {
  .taskbar {
    padding: 0 1.5rem;
    gap: 1rem;
  }

  .taskbar-agents {
    gap: 1.5rem;
  }

  .taskbar-bars {
    width: 80px;
    gap: 1.5px; /* Reduce gap */
  }
}

@media (max-width: 1100px) {
  .taskbar {
    padding: 0 1rem;
    gap: 0.75rem;
  }

  .taskbar-agents {
    gap: 1rem;
  }

  .taskbar-bars {
    width: 60px;
    gap: 1px; /* More compact */
  }
}

@media (max-width: 900px) {
  .taskbar {
    padding: 0 0.75rem;
    gap: 0.5rem;
  }

  .taskbar-agents {
    gap: 0.75rem;
  }

  .taskbar-bars {
    width: 40px;
    gap: 0.5px; /* Nearly solid */
  }

  .taskbar-title {
    font-size: 0.85rem;
  }
}

/* Hamburger menu button - hidden by default */
.taskbar-hamburger {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: #00D9FF;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.taskbar-hamburger:hover {
  background: rgba(0, 217, 255, 0.1);
  filter: drop-shadow(0 4px 16px #00D9FF);
}

.taskbar-hamburger i {
  font-size: 1.2rem;
}

/* Menu overlay for mobile */
.taskbar-menu-overlay {
  display: none;
  position: fixed;
  bottom: 60px;
  right: 0;
  background: rgba(0, 0, 0, 0.6); /* 60% opaque */
  backdrop-filter: blur(30px); /* Stronger blur */
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px 0 0 0;
  padding: 1rem;
  gap: 1rem;
  flex-direction: column;
  z-index: 99;
}

.taskbar-menu-overlay.active {
  display: flex;
}

/* Hamburger menu horizontal slider - extends to left */
.volume-slider-horizontal {
  position: absolute;
  right: 40px; 
  width: 0; /* Hidden by default */
  direction: rtl; /* Flip slider: max left, min right */
  cursor: pointer;
}

/* Show slider on hover - like desktop */
.taskbar-menu-overlay .audio-controls:hover .volume-slider-horizontal,
.volume-slider-horizontal:hover {
  width: 100px;
  opacity: 1;
  pointer-events: auto;
}

/* Match desktop slider thumb exactly */
.taskbar-menu-overlay .volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #00D9FF;
  cursor: pointer;
  box-shadow: 0 0 4px #00D9FF;
}

.taskbar-menu-overlay .volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #00D9FF;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 4px #00D9FF;
}

.taskbar-menu-overlay .audio-controls {
  position: relative; /* Positioning context for absolute slider */
  flex-direction: row;
  height: auto;
  width: auto;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-start;
  padding-left: 105px; /* Create hover zone to the left for slider */
  margin-left: -105px; /* Offset padding to maintain button position */
}

/* Desktop and above - hide hamburger menu completely */
@media (min-width: 769px) {
  .taskbar-menu-overlay {
    display: none !important; /* Force hide menu on wide screens */
  }
}

/* Tablet portrait and below - show hamburger, hide controls */
@media (max-width: 768px) {
  .taskbar-controls {
    display: none !important;
  }

  .taskbar-hamburger {
    display: flex;
  }
}

@media (max-width: 700px) {
  .taskbar {
    padding: 0 0.5rem;
    gap: 0.5rem;
  }

  .taskbar-agents {
    gap: 0.5rem;
  }

  .taskbar-bars {
    width: 30px;
    gap: 0px; /* Solid bar appearance */
  }

  .taskbar-title {
    font-size: 0.75rem;
  }

  .taskbar-logo {
    font-size: 1.2rem;
  }
}

@media (max-width: 550px) {
  .taskbar-title {
    display: none; /* Hide title */
  }

  .taskbar-bars {
    width: 24px;
    gap: 0px; /* Solid bar */
  }
}

@media (max-width: 450px) {
  .taskbar {
    padding: 0 0.5rem;
    gap: 0.25rem;
  }

  .taskbar-agents {
    gap: 0.5rem;
  }

  .taskbar-bars {
    display: none; /* Icons only */
  }

  .taskbar-agent-icon {
    font-size: 1.3rem;
  }
}
