/**
 * Widget Container
 * 
 * Groups multiple floating widgets into a single expandable container
 * in the bottom right corner
 */

.widget-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  display: none !important; /* Hidden - functionality preserved but UI removed */
  visibility: hidden !important;
}

/* Main toggle button to expand/collapse */
.widget-container-toggle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: 3px solid rgba(255, 255, 255, 0.3);
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4),
              0 0 0 0 rgba(102, 126, 234, 0);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible;
  z-index: 2;
}

.widget-container-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6),
              0 0 0 8px rgba(102, 126, 234, 0.1);
}

.widget-container-toggle:active {
  transform: scale(0.95);
}

.widget-container-toggle::before {
  content: '⚙️';
  font-size: 1.8rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.widget-container.expanded .widget-container-toggle::before {
  content: '✕';
  font-size: 2rem;
  font-weight: bold;
}

/* Widget count badge */
.widget-count-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: rgba(255, 59, 48, 0.95);
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Expanded panel - completely transparent, no background, no width constraint, clicks pass through */
.widget-container-panel {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: auto;
  max-height: none;
  background: transparent;
  backdrop-filter: none;
  border-radius: 0;
  border: none;
  box-shadow: none;
  padding: 0;
  display: none;
  flex-direction: column;
  overflow: visible;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none; /* Clicks pass through panel to buttons */
}

.widget-container.expanded .widget-container-panel {
  display: flex;
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Panel header - hidden */
.widget-container-header {
  display: none;
}

/* Widget list - displays original buttons stacked vertically, no padding */
.widget-container-list {
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  overflow-y: visible;
  max-height: none;
}

.widget-button-wrapper {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  margin-bottom: 10px;
  pointer-events: none; /* Allow clicks to pass through wrapper to button */
}

.widget-button-wrapper > * {
  pointer-events: auto; /* But buttons themselves are clickable */
}

.widget-button-wrapper:last-child {
  margin-bottom: 0;
}

.widget-container-list::-webkit-scrollbar {
  width: 6px;
}

.widget-container-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
}

.widget-container-list::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.3);
  border-radius: 3px;
}

.widget-container-list::-webkit-scrollbar-thumb:hover {
  background: rgba(102, 126, 234, 0.5);
}

/* Original widget buttons are displayed as-is, just stacked */
/* No custom styling needed - they keep their original appearance */

/* Widget toggle buttons removed - widgets are now accessed via companion overlay menu */
/* Widgets are hidden via CSS (display: none !important) in their respective CSS files */

/* Responsive */
@media (max-width: 768px) {
  .widget-container {
    bottom: 15px;
    right: 15px;
  }
  
  .widget-container-toggle {
    width: 56px;
    height: 56px;
    font-size: 1.3rem;
  }
  
  .widget-container-panel {
    width: auto;
    max-width: none;
    bottom: 70px;
    right: 0;
  }
  
  .widget-container-header {
    padding: 8px 10px;
  }
  
  .widget-container-header h3 {
    font-size: 0.8rem;
  }
  
  .widget-container-list {
    padding: 10px;
    max-height: 300px;
  }
}

/* Animation for widget items */
@keyframes widgetItemSlideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.widget-item {
  animation: widgetItemSlideIn 0.3s ease forwards;
}

.widget-item:nth-child(1) { animation-delay: 0.05s; }
.widget-item:nth-child(2) { animation-delay: 0.1s; }
.widget-item:nth-child(3) { animation-delay: 0.15s; }
.widget-item:nth-child(4) { animation-delay: 0.2s; }

