:host {
  // Host element styles
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.group-container {
  width: 100%;
  height: 100%;
  border: 2px dashed #333;
  border-radius: 16px;
  position: relative;
  padding: 1rem;
  min-width: 500px;
  min-height: 200px;

  &.collapsed {
    background-color: transparent !important;
    border: none;
    border-radius: 8px;
    min-width: 0;
    min-height: 0;
    &.f-selected {
      border: none;
    }

    &.f-parent-for-drop {
      border: none;
    }
  }

  &.f-parent-for-drop {
    border-color: var(--accent-color);
  }
}

:host:hover {
  .port-wrapper .port-label {
    opacity: 1;
  }
}
:host.f-parent-for-drop {
  .group-container {
    border-color: var(--accent-color);
  }
}
// Move selected state from host to container
:host.f-selected {
  .group-container {
    border-color: var(--accent-color);
  }
  .color-palette-button {
    opacity: 1;
  }
}

// Color palette button
.color-palette-button {
  position: absolute;
  top: -45px;
  right: 0;
  width: 28px;
  height: 28px;
  background-color: #2a2a2a;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background-color 0.2s ease;
  z-index: 15;

  // Create transparent zone around the button
  &::before {
    content: "";
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: transparent;
    z-index: -1;
  }

  &.visible {
    opacity: 1;
  }

  &:hover {
    background-color: #3a3a3a;

    i {
      color: white; // Make icons white on hover by default
    }
  }

  &.pallete-opened {
    i {
      color: var(--accent-color, #2196f3);

      &:hover {
        color: var(
          --accent-color,
          #2196f3
        ); // Keep accent color on hover when palette is opened
      }
    }
  }

  i {
    font-size: 16px;
    color: #aaa;
    transition: color 0.2s ease;
  }
}

// Color palette container for custom color picker
.color-palette-container {
  position: absolute;
  top: -45px;
  right: -320px;
  background-color: #1a1a1a;
  border: 1px solid #333;
  border-radius: 6px;
  z-index: 20;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);

  // Create transparent zone around the container
  &::before {
    content: "";
    position: absolute;
    top: -30px;
    left: -30px;
    right: -30px;
    bottom: -30px;
    background: transparent;
    z-index: -1;
  }

  // Additional transparent bridge between button and container
  &::after {
    content: "";
    position: absolute;
    top: -20px;
    left: -320px; // Connect to the button
    width: 320px; // Bridge the gap
    height: 60px;
    background: transparent;
    z-index: -2;
  }

  .color-palette-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid #333;

    span {
      font-size: 14px;
      color: #e0e0e0;
      font-weight: 500;
    }
  }

  .color-picker-wrapper {
    padding: 8px;
  }
}
